July 6, 2002 at 9:15 pm
Hi...
I'm using SQL Server 7.
Is it possible to passing Table Name / Database Name as parameter in Store Procedure ?
For Example :
Create Proc SP_01 @TableName varchar(10) as
Select *
From @TableName
--or--
Create Proc SP_02 @DBName varchar(10) as
Select *
From @DBName.Table01
-- Note : @TableName is a name of table, and @DBName is a name of database.
Thank you
Ikka Vertika
- Jakarta, Indonesia
July 6, 2002 at 9:49 pm
July 8, 2002 at 12:10 am
Have a look at sp_rename and sp_renamedb.
quote:
Hi...I'm using SQL Server 7.
Is it possible to passing Table Name / Database Name as parameter in Store Procedure ?
For Example :
Create Proc SP_01 @TableName varchar(10) as
Select *
From @TableName
--or--
Create Proc SP_02 @DBName varchar(10) as
Select *
From @DBName.Table01
-- Note : @TableName is a name of table, and @DBName is a name of database.
Thank you
Ikka Vertika
- Jakarta, Indonesia
July 8, 2002 at 2:16 am
Just think about the fact that your sp will run dynamic sql ! (privileges)
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply