Hi,
Is it possible to find all the varchar() columns in my database?
I am using SQL Server 2008 and would like to get the list in SQL server management console.
JD.
Hi,
Is it possible to find all the varchar() columns in my database?
I am using SQL Server 2008 and would like to get the list in SQL server management console.
JD.
Yep, this should work:
select * from INFORMATION_SCHEMA.COLUMNS
where DATA_TYPE = 'varchar'
Try, this will give varchar and nvarchar, if the character_maximum_length column returns -1 then it is varchar(max) or nvarchar(max)
select * from
INFORMATION_SCHEMA.COLUMNS
where DATA_TYPE in('varchar','nvarchar')