stored procedur problem

Last Post 10 Oct 2008 05:44 AM by mamacita3009. 4 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
mamacita3009
New Member
New Member

--
09 Oct 2008 03:38 AM
v
SQLUSA
New Member
New Member

--
09 Oct 2008 04:16 AM
You cannot do that. Table names, db names are static in statements.

You have to use dynamic SQL.

Look up sp_executeSQL in BOL.

Here is also a link:

http://www.sqlteam.com/article/intr...sql-part-1

Kalman Toth
www.sqlusa.com
mamacita3009
New Member
New Member

--
10 Oct 2008 01:28 AM
x
mamacita3009
New Member
New Member

--
10 Oct 2008 05:44 AM
h
SQLUSA
New Member
New Member

--
10 Oct 2008 09:28 AM
You can do sp_MSforeachDB.

However, it will be still 20x one db execution.

Kalman Toth
www.sqlusa.com
You are not authorized to post a reply.

Acceptable Use Policy