Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
ann06
Posting Yak Master
171 Posts |
Posted - 2008-04-22 : 03:33:14
|
| in msdn site they used schemaid in the below ex although its not mentioned in the porperty tablewhere schemaid is documented how they knew it can be used here?SELECT name, object_id, type_descFROM sys.objects WHERE OBJECTPROPERTY(object_id, N'SchemaId') = SCHEMA_ID(N'Production')ORDER BY type_desc, name;http://msdn2.microsoft.com/en-us/library/ms176105.aspx |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-04-22 : 05:11:58
|
Seems like they missed it from documentation. You can always give feedback so they can correct their contents. Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
ann06
Posting Yak Master
171 Posts |
Posted - 2008-04-22 : 09:29:39
|
| i thought so :SThanks Mr. Harsh |
 |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2008-04-22 : 14:24:59
|
| It's in BOL, if that helps:SCHEMA_ID( [ schema_name ] ) Argumentsschema_nameIs the name of the schema. schema_name is a sysname. If schema_name is not specified, SCHEMA_ID will return the ID of the default schema of the caller. Return Typesint NULL will be returned if schema_name is not a valid schema.RemarksSCHEMA_ID will return IDs of system schemas and user-defined schemas. SCHEMA_ID can be called in a select list, in a WHERE clause, and anywhere an expression is allowed.ExamplesA. Returning the default schema ID of a callerselect schema_id();GO B. Returning the schema ID of a named schemaUSE AdventureWorks;GOSELECT SCHEMA_ID('HumanResources');GO |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-04-23 : 06:29:52
|
quote: Originally posted by Lamprey It's in BOL, if that helps:SCHEMA_ID( [ schema_name ] ) Argumentsschema_nameIs the name of the schema. schema_name is a sysname. If schema_name is not specified, SCHEMA_ID will return the ID of the default schema of the caller. Return Typesint NULL will be returned if schema_name is not a valid schema.RemarksSCHEMA_ID will return IDs of system schemas and user-defined schemas. SCHEMA_ID can be called in a select list, in a WHERE clause, and anywhere an expression is allowed.ExamplesA. Returning the default schema ID of a callerselect schema_id();GO B. Returning the schema ID of a named schemaUSE AdventureWorks;GOSELECT SCHEMA_ID('HumanResources');GO
I guess, OP is talking about SchemaID attribute of OBJECTPROPERTY() function. Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2008-04-23 : 11:52:18
|
Doh! |
 |
|
|
|
|
|
|
|