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 is a fill factor?

1044


Difference between group by clause and having clause in SQL?

935


Why I am getting this error when renaming a database in ms sql server?

1008


What is difference between clustered and non clustered index?

933


How many types of subqueries are there in sql server?

949


What is report rendering ?

151


What is the difference between implicit and explicit transaction?

968


What is 'Join' and explain its various types.

1077


How to delete existing triggers using "drop trigger"?

1006


What is the difference between ddl,dml and dcl commands?

1073


What is bcp? When does it used?

934


How can a database be repaired?

934


List some case manipulation functions in sql?

980


How to loop through returning rows?

984


What are advantages of ssrs or why we should use ssrs?

135