Search This Blog

COLUMNPROPERTY

Menghasilkan informasi kolom atau parameter procedure.

Syntax

COLUMNPROPERTY ( id , column , property )

Argumen

id adalah ekpresi yang mengandung ID table atau procedure.

column adalah ekpresi yang mengandung nama dari column atau parameter.

property adalah ekpresi yang mengandung informasi yang dikembalikan untuk id, dan dapat berupa suatu nilai.

Nilai Keterangan Nilai yang dihasilkan
AllowsNull Boleh milai null.
1 = TRUE
0 = FALSE
NULL = Invalid input
IsComputed Kolom adalah dapat dilakukan operasi perhitungan. 1 = TRUE
0 = FALSE
NULL = Invalid input
IsCursorType procedure parameter adalah type CURSOR. 1 = TRUE
0 = FALSE
NULL = Invalid input
IsDeterministic Kolom adalah deterministic. Property ini hanya untuk kolom yang dapat dilakukan operasi perhitungan 1 = TRUE
0 = FALSE
NULL = Invalid input. Not a computed column or view column.
IsFulltextIndexed Kolom sudah diregister untuk full-text indexing. 1 = TRUE
0 = FALSE
NULL = Invalid input
IsIdentity Kolom menggunakan the IDENTITY property. 1 = TRUE
0 = FALSE
NULL = Invalid input
IsIdNotForRepl Kolom memeriksa IDENTITY_INSERT setting. JIka IDENTITY NOT FOR REPLICATION is specified, IDENTITY_INSERT setting tidak di-checked. 1 = TRUE
0 = FALSE
NULL = Invalid input
IsIndexable Kolom dapat diindexed. 1 = TRUE
0 = FALSE
NULL = Invalid input
IsOutParam Procedure parameter adalah output parameter. 1 = TRUE
0 = FALSE
NULL = Invalid input
IsPrecise Kolom adalah precise. Property ini hanya untuk kolom deterministic. 1 = TRUE
0 = FALSE
NULL = Invalid input. Not a deterministic column
IsRowGuidCol Kolom memiliki uniqueidentifier data type dan didefinisikan dengan ROWGUIDCOL property. 1 = TRUE
0 = FALSE
NULL = Invalid input
Precision Presisi type kolom atau parameter. The precision of the specified column data type

NULL = Invalid input

Scale Skala untuk tipe data dari kolom atau parameter. The scale

NULL = Invalid input

UsesAnsiTrim Seting ANSI padding ON ketika table telah dibuat diinisialisasi. 1= TRUE
0= FALSE
NULL = Invalid input

Type Hasil

int

Catatan

Ketika memeriksa property kolom, peratma cek apakah kolom bisa dilakukan operasi perhitungan. IsDeterministic menghasilkan NULL untuk kolom yang tidak bisa dilakukan operasi perhitungan.

Misalnya

Contoh berikut menghasilkan panjang dari kolom au_lname

SELECT COLUMNPROPERTY( OBJECT_ID('authors'),'au_lname','PRECISION')

No comments: