Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is wrong with this query?
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01350270
Message ID:
01350283
Vues:
21
See my new post. I'll send you the text file with all fields in a second.

>>Ok, I found my answer. For varchar(max) it shows -1
>>
>>Too bad :( Can I send someone csv file and a VFP script to run since I missed several important fields with my statement?
>>
>>>Hi everybody,
>>>
>>>Do you know why this query
>>>
>>>
>>>select tc1.PK_Field, col.Table_Name, col.Column_Name, col.Data_Type, col.Character_Maximum_Length from INFORMATION_SCHEMA.COLUMNS col INNER JOIN INFORMATION_SCHEMA.TABLES tab on col.Table_Name = tab.Table_Name 
>>>LEFT JOIN (SELECT ccu.Column_Name as PK_Field, tc.Table_Name from INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc 
>>>	INNER JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE ccu
>>>		ON tc.CONSTRAINT_name = ccu.CONSTRAINT_name 
>>>WHERE CONSTRAINT_type = 'PRIMARY KEY') tc1 ON col.Table_Name = tc1.Table_Name 
>>>WHERE tab.Table_Type = 'BASE TABLE' AND col.Character_Maximum_Length >=50 order by 2,3
>>>
>>>
>>>misses lots of fields in some table?
>
>You could change your last WHERE to:
>
>WHERE tab.Table_Type = 'BASE TABLE' AND (col.Character_Maximum_Length >=50 OR col.Character_Maximum_Length= -1)
>      order by 2,3
>
>But sure send it what you want :-)
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform