Drop Table
Support Forum for database administrators and web based access to important newsgroups related to databasesRunning the script below the error number is not generated and the transaction is rolled back ... Should be like this, or it should nicely give the error number and let me decide what to do? This is very usefull when using EXECUTE() or sp_executesql(). Here is hwo you can reproduce the problem: CREATE TABLE xTest (IDCol int, xText varchar(100)) INSERT INTO xTest(IDCol,xText1) VALUES (1,'aaa') SELECT @@ERROR --should be 207 DROP TABLE xTest
Post Follow-up to this messageSome errors terminates the batch. See the error handling articles at www.sommarsko g.se for details. -- Tibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://www. solidqualitylearning .com/ Blog: http:// solidqualitylearning .com/blogs/tibor/ "Florin Lazar" < FlorinLazar@discussi ons.microsoft.com> wrote in message news:A436FCDD-B959-42C6-965F- 4D40B47F6434@microso ft.com... > Running the script below the error number is not generated and the > transaction is rolled back ... > Should be like this, or it should nicely give the error number and let me > decide what to do? > This is very usefull when using EXECUTE() or sp_executesql(). > > Here is hwo you can reproduce the problem: > > CREATE TABLE xTest (IDCol int, xText varchar(100)) > > INSERT INTO xTest(IDCol,xText1) VALUES (1,'aaa') > SELECT @@ERROR --should be 207 > > DROP TABLE xTest
Post Follow-up to this messageThe batch does not compile, and thus it is never executed. So the line "SELECT @@ERROR" will never be executed. Gert-Jan Florin Lazar wrote: > > Running the script below the error number is not generated and the > transaction is rolled back ... > Should be like this, or it should nicely give the error number and let me > decide what to do? > This is very usefull when using EXECUTE() or sp_executesql(). > > Here is hwo you can reproduce the problem: > > CREATE TABLE xTest (IDCol int, xText varchar(100)) > > INSERT INTO xTest(IDCol,xText1) VALUES (1,'aaa') > SELECT @@ERROR --should be 207 > > DROP TABLE xTest
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread