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
 How to set table name dynamically....

Author  Topic 

rakeshgautam1233
Starting Member

5 Posts

Posted - 2011-07-28 : 01:46:50
Hello everyone.....

I need to select data from a table where the table name I want to get from another table column.
i,e.
Suppose I am having table
INTERFACE(InterfaceType nvarchar(40),TableName nvarchar(40))

and I want to select data into TARGETTABLE from another table SOURCETABLE whose name will be value of TableName column of INTERFACE table.

I want to execute this inside a stored procedure.....

Please guide me....

Thanks in advance.

regards:Rakesh

vaibhavktiwari83
Aged Yak Warrior

843 Posts

Posted - 2011-07-28 : 03:36:54
Post some sample data...

Vaibhav T

If I cant go back, I want to go fast...
Go to Top of Page
   

- Advertisement -