Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.databases.ms-sqlserver > #1161
| 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-02 19:09 +0200 |
| Organization | Erland Sommarskog |
| Message-ID | <XnsA084C2D1F8717Yazorman@127.0.0.1> (permalink) |
| References | <32eaaf26-9cca-4dbc-a4e7-e5bf92635876@googlegroups.com> |
> I have had an odd error message today from > "Microsoft SQL Server 2005 - 9.00.4035.00 (X64)" > that suggests that the following test did not work > as intended, which was to generate and execute > dynamic SQL code to create a table (by SELECT INTO) > if the table does not already exist. The table > does exist, so I would expect OBJECT_ID(...) NOT NULL. > The "path" consists of a database name and ".[dbo].", > I'm reasonably sure. And apparently it works /now/. > > Should I be using a different "object there" test? > > ---- > > SET @tblPeriod_fq = > @pathTarget_q + N'[period]' > > IF ( OBJECT_ID(@tblPeriod_fq) IS NULL ) > BEGIN > .... What is the odd error message? How did the complete batch look like? -- 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 | Next — Previous in thread | Next in thread | Find similar
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