Re: funny exception (Error: 208, Severity: 16, State: 1)

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Dan Guzman (danguzman_at_nospam-earthlink.net)
Date: 07/28/04


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


Relevant Pages

  • Re: ASP.NET 2.0 - a newbie question
    ... the exception can be identified using the exception stack trace below. ... established connection failed because connected host has failed to ... connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& ... Microsoft SQL Server? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Login failed for user x, Error: 18456
    ... string returnValue = string.Empty; ... catch (Exception ex) ... Make sure that account that is running the asp.net account has a sql server ... The port could be "moving" on you. ...
    (microsoft.public.sqlserver.programming)
  • Re: Authentication problem continued
    ... This is the exception I get if on my test box if I haven't run ... I have a SQL Server login established now and I can log in on my ... SQL Server is configured for Windows Authentication only and not ... I'm still having trouble getting my app to authenticate correctly. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ASP: IIS 5.1 und Datenbankzugriff mit Web-Control: CreateUserWizard
    ... Damit kam die ursprüngliche Exception nicht mehr. ... Setzen des Properties "User-Instance" auf false der richtige Weg? ... Du verwendest anscheinend keine Datenbank, die fix im SQL Server ...
    (microsoft.public.de.german.entwickler.dotnet.asp)
  • Re: Logreader access violation
    ... Windows and System Admin rights for SQL Server. ... Microsoft SQL Server Replication: Exception Stack Dump ...
    (microsoft.public.sqlserver.replication)