Search

Advertisements

Showing posts with label catalog views. Show all posts
Showing posts with label catalog views. Show all posts

SQL Server services information

Though there is an option in Windows to get SQL Server services information by typing Services.msc in Start - > Search Programs

From SQL Server 2008R2, DMV is available to get SQL Server services information.

SQL Server - Dynamic SQL - SQL Injection - EXEC [ QUOTENAME() , REPLACE() , EXECUTE AS ] - Sp_executesql - [ RECOMPILE ]

Recently I had mess up with dynamic SQL , So whats next !!! , I started to explore on this topic and post it here , when I googled to gather some information , but what I found was , this topic has been already drilled to the core , carved and with the sculpture mounted on the walls of SQL Server by some of the great SQL Server guru's , much before an year I started to work with SQL Server .

For my regular readers , I will definitely share the good links with the abstract from the same .

To execute a string , we can make use of sp_executesql or EXEC - “Dynamic String Execution”  (DSE)

As mentioned in the BOL :

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