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 |
banersa
Starting Member
8 Posts |
Posted - 2011-09-21 : 06:43:54
|
Hi, Can you please which queries will give user table information for whole database like column name, data type, length and precision Or any other way to find out above information in the database apart from queries. |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-09-21 : 07:14:28
|
[code]SELECT c.* FROM INFORMATION_SCHEMA.COLUMNS cJOIN INFORMATION_SCHEMA.TABLES tON t.TABLE_NAME = c.TABLE_NAMEAND t.SCHEMA_NAME = c.SCHEMA_NAMEWHERE t.TABLE_TYPE='BASE TABLE'[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
banersa
Starting Member
8 Posts |
Posted - 2011-09-21 : 07:53:29
|
Hi , The above as worked with slight modification in sql server 2008-R2 SELECT c.* FROM INFORMATION_SCHEMA.COLUMNS cJOIN INFORMATION_SCHEMA.TABLES tON t.TABLE_NAME = c.TABLE_NAMEAND t.TABLE_SCHEMA = c.TABLE_SCHEMAWHERE t.TABLE_TYPE='BASE TABLE'can you please also let me know how to check the length of data type also. |
|
|
|
|
|