SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

get rich schema details of all or some tables

By bob chatsrinopkun, 2006/08/30

Total article views: 469 | Views in the last 30 days: 5

to get information about tables+columns+primarykeys+foreignkeys+identity, i firstly used SQL server built-in INFORMATION_SCHEMA.xxx. however, my company have various DBAs and each of them owns objects. when using INFORMATION_SCHEMA.xxx, it retrieves data based on current login (version 2005 resolves this schema v.s. object owner problem already... yeah) , which bring me a great trouble. if you want to see problems, try to use INFORMATION_SCHEMA.xxx to get primary key details of objects not own by current login. so i develop my own version, which is not related to login. try for yourself. btw... support version 7/2000/2005


the process uses two functions together
1) infFKfrom to get foreign keys
2) infTB to compose fk-data with others

you can use the function these ways...
select * from infTB('%') --> to get all info of user tables
select * from infTB('%some%table%') --> to get some

good luck

By bob chatsrinopkun, 2006/08/30

Total article views: 469 | Views in the last 30 days: 5
Your response
 
 
Related Articles
FORUM

Objects Accessible by a Login / User

Objects Accessible by a Login / User

FORUM

How to Find Object Versions

How to Find Object Versions ,(Procedure ,views,Fucntions..)

SCRIPT

Find all objects in Server Owned by a Login

Find every object in every database owned by a particular Login.

FORUM

DTSX packages - have to hard code login information ?

Can I let my clients re-enter their own login information ?

FORUM

SSRS Logins & Object Access Report

Please Help!! Creating a report to detail SSRS logins & Objects

 
Contribute

Free registration required...

To read the rest of this article, and access thousands of other articles, we ask you to register on the site and subscribe to our newsletters.

Login (existing users)

Login

Email:   Password:   Remember me: Forgotten your password?

Register (new users)

Register

Email:   Password:
Confirm:

Subscribing to our newsletters gets you:

  • ALL of our content (thousands of articles, scripts, and forum postings)
  • A daily newsletter (example)
  • A weekly news round up (example)
  • The opportunity to ask and answer questions in our forums
  • A daily Question of the Day to test and help you increase your knowledge of SQL Server.

Steve Jones
Editor, SQLServerCentral.com