Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.identity_columns

  No additional text.


Syntax
CREATE VIEW sys.identity_columns AS
	SELECT object_id = id,
		name = name,
		column_id = colid,
		system_type_id = xtype,
		user_type_id = utype,
		max_length = length,
		precision = prec,
		scale = scale,
		collation_name = convert(sysname,CollationPropertyFromId(collationid,'name')),
		is_nullable = sysconv(bit, 1 - (status & 1)), 	-- CPM_NOTNULL
		is_ansi_padded = sysconv(bit, status & 2), 	-- CPM_NOTRIM
		is_rowguidcol = sysconv(bit, status & 8), 	-- CPM_ROWGUIDCOL
		is_identity = sysconv(bit, status & 4), 		-- CPM_IDENTCOL
		is_filestream = sysconv(bit, status & 32), 	-- CPM_FILESTREAM
		is_replicated = sysconv(bit, status & 0x20000), 	-- CPM_REPLICAT
		is_non_sql_subscribed = sysconv(bit, status & 0x40000), 	-- CPM_NONSQSSUB
		is_merge_published = sysconv(bit, status & 0x80000), 		-- CPM_MERGEREPL
		is_dts_replicated = sysconv(bit, status & 0x100000), 		-- CPM_REPLDTS
		is_xml_document = sysconv(bit, 0),
		xml_collection_id = sysconv(int, 0),
		default_object_id = sysconv(int, 0),
		rule_object_id = sysconv(int, 0),
		seed_value = IdentityProperty(id, 'SeedValue'),
		increment_value = IdentityProperty(id, 'IncrementValue'),
		last_value = IdentityProperty(id, 'LastValue'),
		is_not_for_replication = sysconv(bit, status & 0x10000),	-- CPM_ID_REPL
		is_computed = sysconv(bit, status & 16),			-- CPM_COMPUTED				
		sysconv(bit, 0) as is_sparse,
		sysconv(bit, 0) as is_column_set
	FROM sys.syscolpars
	WHERE number = 0	-- SOC_COLUMN
		AND (status & 4) = 4 	-- CPM_IDENTCOL
		AND has_access('CO', id) = 1

 
Last revision 2008RTM
See also

  sp_bindefault (Procedure)
sp_help (Procedure)
sp_identitycolumnforreplication (Procedure)
sp_MSenableautonosync (Procedure)
sp_MSfixup_single_artddls (Procedure)
sp_MSgeneratenosyncsubscriptionsetupscript (Procedure)
sp_MSget_identity_range_info (Procedure)
sp_MSNonSQLDDL (Procedure)
sp_MSrefresh_idrange_check_constraint (Procedure)
sp_MSreseed (Procedure)
sp_MSscript_update_statement (Procedure)
sp_MSsetup_publisher_idrange (Procedure)
sp_scriptinsproccore (Procedure)
sp_scriptupdproccore (Procedure)
       



News

  Query a named instance
Sybase+ASE+silent+install
SQL 2008 R2
Deprecated procedures in SQL2008
Reporting Services item-level role definitions
Create all your missing indexes
Converting datetime field
Start MSSQL Server Profiler at time
Replicating MSSQL Server views
Exploring Microsoft Sharepoint
The OLE DB provider "SQLNCLI10" for linked server indicates.
Mobile solar charger
Oracle to SQL Server replication
Cannot insert the value NULL into column
Undocumented Microsoft SQL Server 2008
VMware
Zoekmachine optimalisatie
SQL Servers hidden objects
FckEditor
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
PHP
sIFR; de combinatie tussen HTML en Flash