Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What are the advantages of passing name-value pairs as parameters?

1101


How many levels of sp nesting are possible?

957


What is user-defined function? Explain its types i.e. Scalar and inline table value user-defined function?

839


What can be used instead of trigger?

1096


Why do you need a sql server?

1027


What do you understand by physical_only option in dbcc checkdb?

932


Where views are stored in sql server?

924


What is the name of reporting services config file and what’s it’s used for?

132


Tell me what is the order in which the sql query is executed?

894


Your sql server is running out of disk space. You notice that there are several large files with ldf extensions what are these files?

1124


What are the differences between substr and charindex in sql server.

1012


Does partitioning improve performance?

915


How to connect php with different port numbers?

1001


What are logical/boolean operations in ms sql server?

975


can we have a nested transaction? : Sql server database administration

991