Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Find out the new features and enhancements added into SQL Server 2012, codenamed "Denali"

Moderators

Top Categories · View All
TSQL Enhancements 28
Discontinued Features 16
SSIS Enhancements 10
SSMS Enhancements 10
Database Engine 10
Database Administration 8
Security 3
Full Text Search 2
DataTime 1
Breaking Changes 1

Browse by Tags · View All
Denali 82
SQL Server 2012 79
SSIS 9
SSMS Enhancements 9
Analytic Functions 8
Usability Enhancements 5
SQL11 4
TSQL 4
Security 3
Database Engine 3
Datetime 3
Query Hints 2
OVER Clause 2
DMV 2
Groups 2
Dynamic Management Functions 2
DMF 2
System stored procedures 2
DBA 2
FTS 2

Browse by Release · View All
All 58
RC0 20
SQL Server 2012 Denali 2
CTP3 2
SQL Server Denali 1

What is new in SQL Server 2012 - Denali

SQL Server 2012 Denali - OBJECT ID of #TEMP tables are negative values, may break your code

Nov 29 2011 1:27AM by Jacob Sebastian   

One of the breaking changes added in SQL Server 2012 is related to the creation of #TEMP tables. SQL Server 2012 assigns a negative value as the OBJECT ID of the #TEMP tables.

Your code may or may not break depending upon the method you use to check for the existence of tables. My preferred usage is given below.

CREATE TABLE #cust (Col1 INT)
GO

IF OBJECT_ID('tempdb..#cust', 'U') IS NOT NULL
BEGIN
    PRINT 'Object Exists'
    -- Do Something
END

But, I have seen people using the following method to check for the existence of a table.

IF OBJECT_ID('tempdb..#cust') > 0
BEGIN
    PRINT 'Object Exists'
    -- Do Something
END

If you are using this method, you code may break in SQL Server 2012, because TEMP tables are assigned a negative Object ID value in SQL Server 2012.

Read More Have you written a blog post or article related to this feature and want to get them added here? Read More...
Category : Database Engine, Breaking Changes
Release : All
Tags : SQL Server 2012, Denali, Temp Tables, Object ID, Breaking Changes


Jacob Sebastian
1 · 100% · 32235
2



Submit

Your Comment


Sign Up or Login to post a comment.

"SQL Server 2012 Denali - OBJECT ID of #TEMP tables are negative values, may break your code" rated 5 out of 5 by 2 readers
SQL Server 2012 Denali - OBJECT ID of #TEMP tables are negative values, may break your code , 5.0 out of 5 based on 2 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]