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
 General SQL Server Forums
 New to SQL Server Programming
 sqlcm exit(select 100)

Author  Topic 

Raju2002
Starting Member

1 Post

Posted - 2012-03-29 : 23:09:50
I have a batch file something like

sqlcmd -S .\SQLEXPRESS -E -i "Test.sql"
IF %ERRORLEVEL% == 100 GOTO END
batchfile2.bat
:END

and in test.sql

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET NOCOUNT ON
print 'xyz'
EXIT(SELECT 100)

above code works fine. but code below ie when exit(...) is put inside a if block it give error.

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET NOCOUNT ON
print 'xyz'
if 2=2 EXIT(SELECT 100)

X002548
Not Just a Number

15586 Posts

Posted - 2012-03-30 : 10:05:46
Where did you get the SQL Server Parameter of EXIT???



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page
   

- Advertisement -