Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

Is this a bug in SQL 2000/2005?
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

Report this thread to moderator Post Follow-up to this message
Old Post
Florin Lazar
03-01-06 01:23 AM


Re: Is this a bug in SQL 2000/2005?
Some 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


Report this thread to moderator Post Follow-up to this message
Old Post
Tibor Karaszi
03-01-06 01:23 AM


Re: Is this a bug in SQL 2000/2005?
The 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

Report this thread to moderator Post Follow-up to this message
Old Post
Gert-Jan Strik
03-01-06 01:23 AM


Sponsored Links





Last Thread Next Thread
Post New Thread

MS SQL Server archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 08:07 AM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006