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

Why Master database is required?

1144


What is rolap and its advantage? : sql server analysis services, ssas

1283


How to loop through the result set with @@fetch_status?

1349


What do you understand by mirroring and mention the advantages of the mirroring?

1068


What is sql server english query?

1129


How to provide values to stored procedure parameters in ms sql server?

1037


How can you list all the table constraints in a database?

938


How to change the system date and time from SQL Plus Terminal ?

1221


What is a trigger? Why we need it?

996


How can I tell if sql server is 32 or 64 bit?

966


What are the different type of replication in sql server?

981


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

1750


what is the main function of a query parameter?

152


What type of Index will get created after executing the above statement?

1100


What is mean by clustered index and non clustered index, give syntax of creation? : sql server database administration

1083