|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Error on Stored Procedure
I need to perform a select statement across servers.... this statement works in query analyzer but not as a procedure. It tells me I need to enable the ANSI_NULLS and ANSI_WARNINGS options when put into a procedure (which it looks like i did!) I think it has something to do with this GO as the stored procedure isn't recognizing it. I tried even building it as a string and executing. Any ideas as to enable this in a procedure?
CREATE PROCEDURE TESTING AS SET ANSI_NULLS ON GO SET ANSI_WARNINGS ON GO SELECT * FROM MIDSERV.DB000.dbo.tblcustomer select * from #table |
|
#2
|
|||
|
|||
|
Remove the GOs. It is used to indicate the end of a batch so you just need one at the end.
|
|
#3
|
|||
|
|||
|
I removed the gos... still no go
CREATE PROCEDURE procedure1 AS SET ANSI_NULLS ON SET ANSI_WARNINGS ON SELECT * FROM RemoteServer.RemoteDB.dbo.tlbcustomer GO I did get it to work this way but I need it to execute through one stored procedure. CREATE PROCEDURE procedure1 AS SET ANSI_NULLS ON SET ANSI_WARNINGS ON exec procedure2 GO CREATE PROCEDURE procedure2 AS SELECT * FROM RemoteServer.RemoteDB.dbo.tblcustomer GO Do you have any ideas how to get that select statement to work through one procedure?? |
|
#4
|
|||
|
|||
|
I'm not clear as to what your problem is. Do you want to process the result of the select in procedure2 in procedure1 or ?
|
|
#5
|
|||
|
|||
|
I just want the result of that select statement to work in one procedure. procedure 1.
|
|
#6
|
|||
|
|||
|
A bit uncertain still but you need
SET ANSI_NULLS ON SET ANSI_WARNINGS ON in procedure2 as well. |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > Error on Stored Procedure |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|