November 24, 2014 at 4:50 am
Hi,
how to check schema information of tables in the database.there is any script to check all this without using the SSMS
November 24, 2014 at 5:11 am
Sure, here's all the catalog views, between them all you should be able to get what data you need.
http://msdn.microsoft.com/en-us/library/ms174365.aspx
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 24, 2014 at 5:11 am
Yes, you can query the system tables to get data about the database objects. Here's how to get the schema for all user-defined tables in your database.
select ss.name, so.name
from sys.schemas ss
inner join sys.objects so on so.schema_id = ss.schema_id
where so.type = 'u'
order by ss.name, so.name;
November 24, 2014 at 8:13 am
What is it that you're trying to do?
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply