Search

Advertisements

Showing posts with label system tables. Show all posts
Showing posts with label system tables. Show all posts

SQL Server 2008 System Views Map



SQL Server 2008 System Views Map shows the key system views included in SQL Server 2008, and the relationships between them.

Refer below link for complete details about  SQL Server 2008 System Views,
also by looking into below link,you will get an idea about data modelling,if you are familiar with system catalog views.

http://www.microsoft.com/en-us/download/details.aspx?id=9301


Sql Server - Object dependencies



Dependencies by creating Primary & Foreign keys:

 

CREATE DATABASE TEST_DEPENDENCY_DB1
GO
USE TEST_DEPENDENCY_DB1
GO
CREATE TABLE TEST_DEPENDENCY_PRIMARY(EMPID INT PRIMARY KEY,NAME VARCHAR(10))
INSERT INTO TEST_DEPENDENCY_PRIMARY SELECT 1 ,'Sathya'
INSERT INTO TEST_DEPENDENCY_PRIMARY SELECT 2 ,'Deepak'
CREATE TABLE TEST_DEPENDENCY_SECONDARY(EMPID INT FOREIGN KEY REFERENCES TEST_DEPENDENCY_PRIMARY (EMPID),[ROLE] VARCHAR(10))
INSERT INTO TEST_DEPENDENCY_SECONDARY SELECT 1 ,'Developer'
INSERT INTO TEST_DEPENDENCY_SECONDARY SELECT 2 ,'DBA'


Under Object Explorer, right click Table - > View Dependencies
After creating foreign key constraint, you can see dependencies created for tables  TEST_DEPENDENCY_PRIMARY & TEST_DEPENDENCY_SECONDARY

 

Advertisements