Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 procedure for select

Author  Topic 

svicky9
Posting Yak Master

232 Posts

Posted - 2005-08-30 : 03:57:59
Hi friends

can anyone tell me a procedure for selecting a table

I want a procedure like
display [tablename]
and it should work the same like
select * from tablename

regards
Vic

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-08-30 : 04:05:52
Create Procedure Display (@table varchar(50))
as
Exec('Select * from '+@table)



Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

svicky9
Posting Yak Master

232 Posts

Posted - 2005-08-30 : 05:03:00
Thank you its working

cheers
Vic
Go to Top of Page
   

- Advertisement -