Monday, 4 May 2015

SQL Related Some Query

-- DEFAULT CONSTANT
SELECT * FROM sys.objects
WHERE  Type='D' and create_date >= '20150401'
--AND create_date < GETDATE()

-- FOREIGN KEY
SELECT * FROM sys.objects
WHERE  Type='F' and create_date >= '20150401'
--AND create_date < GETDATE()

-- SCALAR FUNCTION
SELECT * FROM sys.objects
WHERE Type='FN' and  create_date >= '20150401'
--AND create_date < GETDATE()

-- INLINE TABLE VALUE FUNCTION
SELECT * FROM sys.objects
WHERE Type='IF' and  create_date >= '20150401'
--AND create_date < GETDATE()

-- INTERNAL TABLE
SELECT * FROM sys.objects
WHERE Type='IT' and  create_date >= '20150401'
--AND create_date < GETDATE()

-- PROCEDURE
SELECT * FROM sys.objects
WHERE Type='P' and  create_date >= '20150401'
--AND create_date < GETDATE()

-- PRIMARY KEY
SELECT * FROM sys.objects
WHERE Type='PK' and  create_date >= '20150401'
--AND create_date < GETDATE()

-- SEQUENCE OBJECT
SELECT * FROM sys.objects
WHERE  Type='SO' and create_date >= '20150401'
--AND create_date < GETDATE()

-- SERVICE QUEUE
SELECT * FROM sys.objects
WHERE Type='SQ' and  create_date >= '20150401'
--AND create_date < GETDATE()

-- TABLE VALUED FUNCTION
SELECT * FROM sys.objects
WHERE Type='TF' and  create_date >= '20150401'
--AND create_date < GETDATE()

-- TRIGGER
SELECT * FROM sys.objects
WHERE Type='TR' and  create_date >= '20150401'
--AND create_date < GETDATE()

-- TYPE TABLE
SELECT * FROM sys.objects
WHERE Type='TT' and  create_date >= '20150401'
--AND create_date < GETDATE()

-- USER TABLE
SELECT * FROM sys.objects
WHERE Type='U' and  create_date >= '20150401'
--AND create_date < GETDATE()

-- UNIQUE CONSTANT
SELECT * FROM sys.objects
WHERE Type='U' and  create_date >= '20150401'
--AND create_date < GETDATE()

-- VIEW
SELECT * FROM sys.objects
WHERE Type='V' and  create_date >= '20150401'
--AND create_date < GETDATE()

No comments:

Post a Comment