Search
 
SCRIPT & CODE EXAMPLE
 

SQL

Create parameterized VIEW in SQL Server

CREATE FUNCTION dbo.fxnExample (@Parameter1 INTEGER)
RETURNS TABLE
AS
RETURN
(
    SELECT Field1, Field2
    FROM SomeTable
    WHERE Field3 = @Parameter1
)

-- Then call like this, just as if it's a table/view just with a parameter
SELECT * FROM dbo.fxnExample(1)
Comment

PREVIOUS NEXT
Code Example
Sql :: mysql create view 
Sql :: mysql max connections exceeded max_connections_per_hour 
Sql :: mysql workbench change default value 
Sql :: linq inner join 
Sql :: sql group_concat 
Sql :: postgresql select top 1 from each group 
Sql :: cross join sl 
Sql :: mysql select field if condition 
Sql :: insert ip address in mysql 
Sql :: t sql first and last day of week 
Sql :: pl sql command line run 
Sql :: mysql regex select 
Sql :: find duplicates in column sql 
Sql :: alter table add multiple columns mysql 
Sql :: database passwords from dbeaver 
Sql :: sql server express 
Sql :: get into database psql 
Sql :: postgres backup of table 
Sql :: how to start postgresql laravel 
Sql :: joining tables in sql 
Sql :: desc sql 
Sql :: Sql Text or Varchar 
Sql :: mysql_union 
Sql :: sql check if column exists 
Sql :: SQL SELECT AS Alias 
Sql :: sql select condition with left join 
Sql :: make a socket server to detect changes in mysql 
Sql :: load utilities in sql server 
Sql :: sql countif 
Sql :: A good way of running a SQL query in JDBC using a parameterized statement 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =