Its a cool feature available in SQL Server 2005. Inorder to avoid direct access on the system tables. Microsoft have intoduced a layered structure to access the system related information. They have used views to achieve the same.
In the below query, I am trying to fetch all the Primary key and foreign key constriants available in the database.
Code Snippet |
select CONSTRAINT_NAME,TABLE_NAME from INFORMATION_SCHEMA.TABLE_CONSTRAINTS |
Happy Learning!!!
Regards,
Venkatesan prabu .J
No comments:
Post a Comment