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
What are the advantages of passing name-value pairs as parameters?
How many levels of sp nesting are possible?
What is user-defined function? Explain its types i.e. Scalar and inline table value user-defined function?
What can be used instead of trigger?
Why do you need a sql server?
What do you understand by physical_only option in dbcc checkdb?
Where views are stored in sql server?
What is the name of reporting services config file and what’s it’s used for?
Tell me what is the order in which the sql query is executed?
Your sql server is running out of disk space. You notice that there are several large files with ldf extensions what are these files?
What are the differences between substr and charindex in sql server.
Does partitioning improve performance?
How to connect php with different port numbers?
What are logical/boolean operations in ms sql server?
can we have a nested transaction? : Sql server database administration