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.
To get the column name of a table we use sp_help with the name of the object or table name. sp_columns returns all the column names of the object. The following query will return the table's column names: sp_columns @table_name = 'News'
Yep, this should work:
select * from INFORMATION_SCHEMA.COLUMNS
where DATA_TYPE = 'varchar'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With