Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PRIMARY KEY problems

Status
Not open for further replies.

Morpheus1981

Programmer
Aug 9, 2001
105
CR
I am using this query ("SELECT * FROM INFORMATION_SCHEMA.constraint_column_usage")
with my personal DataBase "demo01", for some reason it doesn't bring primary key fields for tables which its owner is not dbo, which is very necesary.

Does anyone know why? or what can I do to make my tables with a different owner be shown by this query?

Thanks,
 
you can try like this
select * from <ownere Name>.<tableName>
 
The view that you are selecting from, INFORMATION_SCHEMA.constraint_column_usage, only displays records from tables for which the current user has permissions. Check to make sure the user that you are connecting with has permission to use/see the tables in question.



“I apologize for this long letter. I didn't have the time to make it any shorter” --Blaise Pascal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top