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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Writing Special Procedure

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-08-08 : 07:36:01
Ashish Kumar writes "I have a problem, i want write a procedure that dyanamically
takes table name .
Table name is assigned it at the time of execution of program i.e my dotnet program.Table name varies as requirement.

I am in deep trouble please solve this.I am waiting for your answer.


Thanks
Ashish Kumar "

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-08-08 : 08:53:19
check out dynamic sql using exec() or sp_executesql from the Books On Line.


KH

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-08-08 : 12:57:38
Why do you pass table name as parameter?
Read this fully
http://www.sommarskog.se/dynamic_sql.html

Madhivanan

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

- Advertisement -