- Syntaxe
- OBJECTPROPERTY(id, propriété)
-
- Arguments
- id
- Expression contenant l'ID de l'objet dans la base de données courante. id est de type int.
- propriété
- Expression contenant les informations à retourner pour l'objet spécifié par id.
-
- Exemples
- Cet exemple teste si authors est une table.
-
- IF OBJECTPROPERTY ( object_id('authors'),'ISTABLE') = 1
-
- print 'Authors is a table'
-
- ELSE IF OBJECTPROPERTY ( object_id('authors'),'ISTABLE') = 0
-
- print 'Authors is not a table'
-
- ELSE IF OBJECTPROPERTY ( object_id('authors'),'ISTABLE') IS NULL
-
- print 'ERROR: Authors is not an object'
Syntaxe
OBJECTPROPERTY(id, propriété)
Arguments
id
Expression contenant l'ID de l'objet dans la base de données courante. id est de type int.
propriété
Expression contenant les informations à retourner pour l'objet spécifié par id.
Exemples
Cet exemple teste si authors est une table.
IF OBJECTPROPERTY ( object_id('authors'),'ISTABLE') = 1
print 'Authors is a table'
ELSE IF OBJECTPROPERTY ( object_id('authors'),'ISTABLE') = 0
print 'Authors is not a table'
ELSE IF OBJECTPROPERTY ( object_id('authors'),'ISTABLE') IS NULL
print 'ERROR: Authors is not an object'