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 is a fill factor?
Difference between group by clause and having clause in SQL?
Why I am getting this error when renaming a database in ms sql server?
What is difference between clustered and non clustered index?
How many types of subqueries are there in sql server?
What is report rendering ?
What is the difference between implicit and explicit transaction?
What is 'Join' and explain its various types.
How to delete existing triggers using "drop trigger"?
What is the difference between ddl,dml and dcl commands?
What is bcp? When does it used?
How can a database be repaired?
List some case manipulation functions in sql?
How to loop through returning rows?
What are advantages of ssrs or why we should use ssrs?