WRITE A FUNCTION TO DISPLAY THE OUTPUT OF AN EXISTING TABLE
RANGE LIKE COMMAM SEPERATED VALUES LIKE RANGE1,RANGE2,...
Answer Posted / carmel franco
Create function int select_dynamic(range varchar(255))
As
declare
@Qry Varchar(2000)
Begin
Begin try
Set @Qry =”select * from table1 where col1
in (“+range+”)”
Exec @qry
Catch
Print “error processing parameter”
Return -1
End try
Return 1
END
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Why Master database is required?
What is rolap and its advantage? : sql server analysis services, ssas
How to loop through the result set with @@fetch_status?
What do you understand by mirroring and mention the advantages of the mirroring?
What is sql server english query?
How to provide values to stored procedure parameters in ms sql server?
How can you list all the table constraints in a database?
How to change the system date and time from SQL Plus Terminal ?
What is a trigger? Why we need it?
How can I tell if sql server is 32 or 64 bit?
What are the different type of replication in sql server?
Help!!!!!!!!!!!! My database has gone offline, it is highlighted as 'Suspect'. Foolishly, i haven't got a recent back up. Is there a way of quickly restoring the database? Thank you
what is the main function of a query parameter?
What type of Index will get created after executing the above statement?
What is mean by clustered index and non clustered index, give syntax of creation? : sql server database administration