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.
| Author |
Topic |
|
snufse
Constraint Violating Yak Guru
469 Posts |
Posted - 2009-02-06 : 12:36:14
|
I read below (http://www.experts-exchange.com/Databases/Microsoft_SQL_Server/Q_20629811.html)You can set ANSI options when you create the stored procedure...these will be inherited...SET ANSI_NULLS ONSET ANSI_WARNINGS ONCREATE PROCEDURE MyProc as Select * from [LinkedServer].DBname.dbo.Mytable So when I try create my proc:SET ANSI_NULLS OFFSET ANSI_WARNINGS OFFCREATE PROCEDURE dbo.sp_ZyTax_Import( @RetValue char(50), @Library nvarchar(10), @File nvarchar(10), @Member nvarchar(10), @rc int output)ASSET NOCOUNT ONExec ('Call QGPL.sp_ovrdbf(?,?,?,?)', @Library, @File, @Member, @rc) AT AS400SRV_IBMDASQLI get errorMsg 111, Level 15, State 1, Procedure sp_ZyTax_Import, Line 19'CREATE/ALTER PROCEDURE' must be the first statement in a query batch. |
|
|
revdnrdy
Posting Yak Master
220 Posts |
Posted - 2009-02-06 : 12:45:18
|
quote: Originally posted by snufse I read below (http://www.experts-exchange.com/Databases/Microsoft_SQL_Server/Q_20629811.html)You can set ANSI options when you create the stored procedure...these will be inherited...SET ANSI_NULLS ONGOSET ANSI_WARNINGS ONGOCREATE PROCEDURE MyProc as Select * from [LinkedServer].DBname.dbo.Mytable So when I try create my proc:SET ANSI_NULLS OFFSET ANSI_WARNINGS OFFCREATE PROCEDURE dbo.sp_ZyTax_Import( @RetValue char(50), @Library nvarchar(10), @File nvarchar(10), @Member nvarchar(10), @rc int output)ASSET NOCOUNT ONExec ('Call QGPL.sp_ovrdbf(?,?,?,?)', @Library, @File, @Member, @rc) AT AS400SRV_IBMDASQLI get errorMsg 111, Level 15, State 1, Procedure sp_ZyTax_Import, Line 19'CREATE/ALTER PROCEDURE' must be the first statement in a query batch.
Try what I posted in red.. I also encourage you to read up on the GO syntax which separates your code into batches (so to speak).r&r |
 |
|
|
snufse
Constraint Violating Yak Guru
469 Posts |
Posted - 2009-02-06 : 13:16:42
|
| Purrrfect, thank you. |
 |
|
|
|
|
|
|
|