select *
from information_schema.routines
where routine_definition like '%employee_id%'
and routine_type='procedure'
-- Syntax for SQL Server and Azure SQL Database
SET QUOTED_IDENTIFIER { ON | OFF }
-- Syntax for Azure SQL Data Warehouse and Parallel Data Warehouse
SET QUOTED_IDENTIFIER ON
DECLARE @QUOTED_IDENTIFIER VARCHAR(3) = 'OFF';
IF ( (256 & @@OPTIONS) = 256 ) SET @QUOTED_IDENTIFIER = 'ON';
SELECT @QUOTED_IDENTIFIER AS QUOTED_IDENTIFIER;
SET QUOTED_IDENTIFIER
setting must be ON
, and the keywords in table names must be in double quotation marks to create and use objects that have reserved keyword names.SET QUOTED_IDENTIFIER OFF
GO
-- An attempt to create a table with a reserved keyword as a name
-- should fail.
CREATE TABLE "select" ("identity" INT IDENTITY NOT NULL, "order" INT NOT NULL);
GO
SET QUOTED_IDENTIFIER ON;
GO
-- Will succeed.
CREATE TABLE "select" ("identity" INT IDENTITY NOT NULL, "order" INT NOT NULL);
GO
SELECT "identity","order"
FROM "select"
ORDER BY "order";
GO
DROP TABLE "SELECT";
GO
SET QUOTED_IDENTIFIER OFF;
GO
SET QUOTED_IDENTIFIER
set to ON
and OFF
.SET QUOTED_IDENTIFIER OFF;
GO
USE AdventureWorks2012;
IF EXISTS(SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'Test')
DROP TABLE dbo.Test;
GO
USE AdventureWorks2012;
CREATE TABLE dbo.Test (ID INT, String VARCHAR(30)) ;
GO
-- Literal strings can be in single or double quotation marks.
INSERT INTO dbo.Test VALUES (1, "'Text in single quotes'");
INSERT INTO dbo.Test VALUES (2, '''Text in single quotes''');
INSERT INTO dbo.Test VALUES (3, 'Text with 2 '''' single quotes');
INSERT INTO dbo.Test VALUES (4, '"Text in double quotes"');
INSERT INTO dbo.Test VALUES (5, """Text in double quotes""");
INSERT INTO dbo.Test VALUES (6, "Text with 2 """" double quotes");
GO
SET QUOTED_IDENTIFIER ON;
GO
-- Strings inside double quotation marks are now treated
-- as object names, so they cannot be used for literals.
INSERT INTO dbo."Test" VALUES (7, 'Text with a single '' quote');
GO
-- Object identifiers do not have to be in double quotation marks
-- if they are not reserved keywords.
SELECT ID, String
FROM dbo.Test;
GO
DROP TABLE dbo.Test;
GO
SET QUOTED_IDENTIFIER OFF;
GO
ID String
----------- ------------------------------
1 'Text in single quotes'
2 'Text in single quotes'
3 Text with 2 '' single quotes
4 "Text in double quotes"
5 "Text in double quotes"
6 Text with 2 "" double quotes
7 Text with a single ' quote
SELECT NAME from SYS.PROCEDURES
where name like '%CUSTOMER%'
order by name
How to Know the internal details of a Procedure
sp_depends procedureName
How to Know the internal details of a Table
sp_depends TableName
Select List of Table Names
from any DB.
SELECT NAME from SYS.Tables
order by name
Select List of triggers from any DB.
SELECT NAME from SYS.Triggers
order by name
Select List of Views from any DB.
SELECT NAME from SYS.Views
order by name
Select List of Sequences
from any DB.
SELECT NAME from SYS.Sequences
order by name
Select List of Types
from any DB.
SELECT NAME from SYS.Types
order by name
Select List of Assemblies
from any DB.
SELECT NAME from SYS.Assemblies
order by name
SELECT ROUTINE_NAMESelect List of Functions
from any DB.FROM information_schema.routines
WHERE routine_type = 'function'
Entities must depend on abstractions not on concretions. It states that the high level module must not depend on the low level module, but they should depend on abstractions.
A client should never be forced to implement an interface that it doesn't use or clients shouldn't be forced to depend on methods they do not use.
Let q(x) be a property provable about objects of x of type T. Then q(y) should be provable for objects y of type S where Sis a subtype of T.
Objects or entities should be open for extension, but closed for modification.
A class should have one and only one reason to change, meaning that a class should have only one job.