Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #1163

Re: SS2005, test that object exists / OBJECT_ID() NOT NULL, reliable?

From Erland Sommarskog <esquel@sommarskog.se>
Newsgroups comp.databases.ms-sqlserver
Subject Re: SS2005, test that object exists / OBJECT_ID() NOT NULL, reliable?
Date 2012-07-05 23:45 +0200
Organization Erland Sommarskog
Message-ID <XnsA087F1B0DC100Yazorman@127.0.0.1> (permalink)
References <32eaaf26-9cca-4dbc-a4e7-e5bf92635876@googlegroups.com> <XnsA084C2D1F8717Yazorman@127.0.0.1> <e35493c0-5a56-4384-83e2-9c29fd1b2029@googlegroups.com>

Show all headers | View raw


 (rja.carnegie@gmail.com) writes:
> Sorry for the late reply.  That isn't the error
> message, it wasn't really odd - just, that table 
> "period" already existed, when the code was trying 
> to create it.  The odd thing was that it happened -
> and then that it didn't happen when I re-ran 
> the procedure. 
> 
> Below is more of the code that I think generated 
> the error message.  

Since you are not able to recreate it, I cannot say more. There are some
traps that you can walk into, if you do it all in static SQL, because the 
error happens at compile time, but this does not apply here since you use 
dynamic SQL.

Of course one possibility is that two instances of the script ran in 
parallel.

-- 
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx

Back to comp.databases.ms-sqlserver | Previous | NextPrevious in thread | Find similar


Thread

SS2005, test that object exists / OBJECT_ID() NOT NULL, reliable? rja.carnegie@gmail.com - 2012-07-02 09:35 -0700
  Re: SS2005, test that object exists / OBJECT_ID() NOT NULL, reliable? Erland Sommarskog <esquel@sommarskog.se> - 2012-07-02 19:09 +0200
    Re: SS2005, test that object exists / OBJECT_ID() NOT NULL, reliable? rja.carnegie@gmail.com - 2012-07-05 06:02 -0700
      Re: SS2005, test that object exists / OBJECT_ID() NOT NULL, reliable? Erland Sommarskog <esquel@sommarskog.se> - 2012-07-05 23:45 +0200

csiph-web