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?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail
From Erland Sommarskog <esquel@sommarskog.se>
Newsgroups comp.databases.ms-sqlserver
Subject Re: SS2005, test that object exists / OBJECT_ID() NOT NULL, reliable?
Date Thu, 05 Jul 2012 23:45:32 +0200
Organization Erland Sommarskog
Lines 26
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>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252
Content-Transfer-Encoding 8bit
Injection-Info mx04.eternal-september.org; posting-host="nBFDv6s1VJQDuF1w6hpX2A"; logging-data="23119"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19p6OcwKov2dqPV8nIyThwS"
User-Agent Xnews/2006.08.24 Mime-proxy/2.1.c.0 (Win32)
Cancel-Lock sha1:epcB+fMDQ2SPun1MNKb2nPcCcwY=
Xref csiph.com comp.databases.ms-sqlserver:1163

Show key headers only | 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