Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use database in sp

Status
Not open for further replies.

sardinka2

Programmer
May 6, 2004
38
US
I am trying to redirect statement to a different db by using Use database statement in sp. however it is not alloud me to do.
What should I use instead?
 
Try fully qualifying the table name instead:
ie - <database>.<owner>.<table>

such as:
Code:
CREATE PROCEDURE pMyProcedure
AS
  SELECT  Field1 = 1
    INTO  MyDatabase..MyTable

HTH,
John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top