Re: funny exception (Error: 208, Severity: 16, State: 1)
From: Dan Guzman (danguzman_at_nospam-earthlink.net)
Date: 07/28/04
- Next message: Dan Guzman: "Re: Bug or limitation in the functionality of sp_OAMethod"
- Previous message: Dan Guzman: "Re: Can I put chunk of text from READTEXT into a variable ?"
- In reply to: Frank Uray: "funny exception (Error: 208, Severity: 16, State: 1)"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 27 Jul 2004 20:29:52 -0500
Some error 208 exceptions are handled internally by SQL Server and not
returned to the client. These expected errors occur when you reference an
object that hasn't yet been created, like your script does. For more
information, see
http://support.microsoft.com/default.aspx?scid=kb;EN-US;199037.
I can't definitively say why you sometimes don't see the exception. My
guess is that the table exists when the script is run in those instances.
BTW, why wrap the CREATE and DROPs in EXEC?
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Frank Uray" <Frank Uray@discussions.microsoft.com> wrote in message
news:DA35DD9E-76E7-487D-A4CC-609C984A3246@microsoft.com...
> hi all
>
> I have got very a lot of exception (Error: 208, Severity: 16, State: 1)
> in the SQL Profiler and I have tried to sort out why ...
> If you run the following code, it will always throw one exception! If you
> take the DISTINCT out of the Select Statement, it runs (sometimes...)
> without exception! For me, it does not make sense...
> Would be happy for any comments!!
>
> /*------------------------------*/
> IF EXISTS (select * from tempdb.dbo.sysobjects where name = 'Tbl_Test')
> EXEC('DROP TABLE tempdb.dbo.Tbl_Test')
> EXEC('CREATE TABLE tempdb.dbo.Tbl_Test (Fld_Field1 varchar(50) NULL,
Fld_Field2 varchar(50) NULL, Fld_Field3 varchar(50) NULL)')
>
> INSERT INTO tempdb.dbo.Tbl_Test
> SELECT DISTINCT '20040722' AS Fld_DatPer, 'IST' AS Fld_Layer, 'BLA'
>
> EXEC('DROP TABLE tempdb.dbo.Tbl_Test')
> /*------------------------------*/
>
> Best regards
> Frank
- Next message: Dan Guzman: "Re: Bug or limitation in the functionality of sp_OAMethod"
- Previous message: Dan Guzman: "Re: Can I put chunk of text from READTEXT into a variable ?"
- In reply to: Frank Uray: "funny exception (Error: 208, Severity: 16, State: 1)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|