Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I find out if the column allows nulls?
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Maintenance bases de données
Divers
Thread ID:
01043112
Message ID:
01043117
Vues:
16
This message has been marked as the solution to the initial question of the thread.
It's better to use INFORMATION_SCHEMA views than query system tables directly
SELECT * FROM
	pubs.INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'authors'	
>
>I have the following query:
>
>select c.name,t.name,c.length, cc.text as [default]
>from systypes t,sysobjects o, syscolumns c ,syscomments cc
>where 1=1
>and c.id=o.id
>and t.xtype=c.xtype
>and c.cdefault*=cc.id
>and o.name='tblcustomers'
>and t.name<>'sysname'
>order by c.colorder
>
>It gives me column name, type, size, default value - how do I find out if the field allows nulls?
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform