Welcome to Geekdojo Sign in | Join | Help

Sql Server Function: OBJECT_ID({object name},{object type})

In order to setup ASP.NET Session State in Sql Sever, we have to run the InstallSqlState.sql script. In the script I came across :-

OBJECT_ID('tempdb..ASPStateTempSessions','U')

here 'U' is for User table.

I had used OBJECT_ID before but I wasn't aware of the second parameter which could filter the search based on the object's sysobjects.type column value.

I looked up the 'Sql Server Books Online' but it shows the function signature as :-

OBJECT_ID('object')

No mention of the second parameter!!

I wonder if its an undocumented feature or am i missing something ?

Anyways, its a useful thing to know.

Published Monday, November 22, 2004 1:40 PM by richardhsu
Filed Under:

Comments

Anonymous comments are disabled