Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
goodman2253
Yak Posting Veteran
88 Posts |
Posted - 2012-03-22 : 15:10:51
|
| Hi AllIs it possible to find the table on the basis of column length Example I want to find the tables in which the maximum length that column can have is 12 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-03-22 : 15:14:01
|
make use of INFORMATION_SCHEMA.COLUMNS viewSELECT DISTINCT TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE MAXIMUM_CHARACTER_LENGTH =12 will list all tables with columns having length as 12didnt understand the reason for this though!------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
goodman2253
Yak Posting Veteran
88 Posts |
Posted - 2012-03-23 : 23:26:27
|
| It shows the following errorMsg 207, Level 16, State 1, Line 1Invalid column name 'MAXIMUM_CHARACTER_LENGTH'. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-03-24 : 01:48:01
|
it should beSELECT DISTINCT TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE CHARACTER_MAXIMUM_LENGTH=12 ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|