Skip to content

Commit 0beeffe

Browse files
Merge pull request #11 from EmergentSoftware/dev
Init
2 parents 3b842d4 + c53b586 commit 0beeffe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1022
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
SET QUOTED_IDENTIFIER ON
2+
GO
3+
SET ANSI_NULLS ON
4+
GO
5+
CREATE FUNCTION [dbo].[MulitStatement] (@ParameterName1 AS INT, @ParameterName2 AS VARCHAR(50))
6+
RETURNS @VariableName TABLE (ColumnName1 INT NOT NULL, ColumnName2 VARCHAR(50) NOT NULL)
7+
AS
8+
BEGIN
9+
-- Return the result of the function
10+
INSERT INTO
11+
@VariableName (ColumnName1, ColumnName2)
12+
SELECT ColumnName1 = @ParameterName1, ColumnName2 = @ParameterName2;
13+
RETURN;
14+
END;
15+
GO
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
SET QUOTED_IDENTIFIER ON
2+
GO
3+
SET ANSI_NULLS ON
4+
GO
5+
6+
CREATE FUNCTION [dbo].[NonInlineable] (@Param1 INT)
7+
RETURNS DATETIME2
8+
AS
9+
BEGIN
10+
-- Declare the return variable here
11+
DECLARE @ResultVar DATETIME2(7);
12+
13+
-- Add the T-SQL statements to compute the return value here
14+
SET @ResultVar = GETDATE();
15+
16+
-- Return the result of the function
17+
RETURN @ResultVar;
18+
19+
END;
20+
GO
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
SET QUOTED_IDENTIFIER ON
2+
GO
3+
SET ANSI_NULLS ON
4+
GO
5+
-- =============================================
6+
-- Author: <Author,,Name>
7+
-- Create date: <Create Date,,>
8+
-- Description: <Description,,>
9+
-- =============================================
10+
CREATE FUNCTION [dbo].[fnPrefixNameTableValuedFunction]
11+
(
12+
-- Add the parameters for the function here
13+
@param1 int
14+
)
15+
RETURNS TABLE
16+
AS
17+
RETURN
18+
(
19+
-- Add the SELECT statement with parameter references here
20+
SELECT @param1 AS ColumnName
21+
)
22+
GO
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
SET QUOTED_IDENTIFIER ON
2+
GO
3+
SET ANSI_NULLS ON
4+
GO
5+
-- =============================================
6+
-- Author: <Author,,Name>
7+
-- Create date: <Create Date, ,>
8+
-- Description: <Description, ,>
9+
-- =============================================
10+
CREATE FUNCTION [dbo].[fn_PrefixName]
11+
(
12+
@Param1 INT
13+
)
14+
RETURNS INT
15+
AS
16+
BEGIN
17+
-- Declare the return variable here
18+
DECLARE @ResultVar int
19+
20+
-- Add the T-SQL statements to compute the return value here
21+
SET @ResultVar = 1
22+
23+
-- Return the result of the function
24+
RETURN @ResultVar
25+
26+
END
27+
GO

Test Database/RedGateDatabaseInfo.xml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<DatabaseInformation Version="3">
3+
<ScriptFileEncoding>UTF8</ScriptFileEncoding>
4+
<DefaultCollation>SQL_Latin1_General_CP1_CI_AS</DefaultCollation>
5+
<DefaultSchema>dbo</DefaultSchema>
6+
<DefaultUser>dbo</DefaultUser>
7+
<DefaultFilegroup>PRIMARY</DefaultFilegroup>
8+
<DatabaseVersion>14</DatabaseVersion>
9+
<IsAzure>False</IsAzure>
10+
<ScriptFolderType>Default</ScriptFolderType>
11+
<MaxDataFileSize>10485760</MaxDataFileSize>
12+
<ProjectGuid>de1f58fd-c0a2-4990-a972-f945cb49d3a6</ProjectGuid>
13+
<WriteToFileOptions>
14+
<Prefixes>
15+
<None>
16+
</None>
17+
<Table>Tables</Table>
18+
<StoredProcedure>Stored Procedures</StoredProcedure>
19+
<View>Views</View>
20+
<Default>Defaults</Default>
21+
<FullTextCatalog>Storage\Full Text Catalogs</FullTextCatalog>
22+
<Function>Functions</Function>
23+
<Role>Security\Roles</Role>
24+
<Rule>Rules</Rule>
25+
<User>Security\Users</User>
26+
<UserDefinedType>Types\User-defined Data Types</UserDefinedType>
27+
<Trigger>
28+
</Trigger>
29+
<DdlTrigger>Database Triggers</DdlTrigger>
30+
<Assembly>Assemblies</Assembly>
31+
<Synonym>Synonyms</Synonym>
32+
<XmlSchemaCollection>Types\XML Schema Collections</XmlSchemaCollection>
33+
<MessageType>Service Broker\Message Types</MessageType>
34+
<Contract>Service Broker\Contracts</Contract>
35+
<Queue>Service Broker\Queues</Queue>
36+
<Service>Service Broker\Services</Service>
37+
<Route>Service Broker\Routes</Route>
38+
<EventNotification>Service Broker\Event Notifications</EventNotification>
39+
<PartitionScheme>Storage\Partition Schemes</PartitionScheme>
40+
<PartitionFunction>Storage\Partition Functions</PartitionFunction>
41+
<Field>
42+
</Field>
43+
<Index>
44+
</Index>
45+
<Schema>Security\Schemas</Schema>
46+
<ServiceBinding>Service Broker\Remote Service Bindings</ServiceBinding>
47+
<Certificate>Security\Certificates</Certificate>
48+
<SymmetricKey>Security\Symmetric Keys</SymmetricKey>
49+
<AsymmetricKey>Security\Asymmetric Keys</AsymmetricKey>
50+
<CheckConstraint>
51+
</CheckConstraint>
52+
<FullTextStoplist>Storage\Full Text Stoplists</FullTextStoplist>
53+
<ExtendedProperty>Extended Properties</ExtendedProperty>
54+
<Data>Data</Data>
55+
<Sequence>Sequences</Sequence>
56+
<SearchPropertyList>Search Property Lists</SearchPropertyList>
57+
<SecurityPolicy>Security Policies</SecurityPolicy>
58+
</Prefixes>
59+
<DataWriteAllFilesInOneDirectory>True</DataWriteAllFilesInOneDirectory>
60+
</WriteToFileOptions>
61+
<DataFileSet>
62+
<Count>0</Count>
63+
</DataFileSet>
64+
</DatabaseInformation>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
SET QUOTED_IDENTIFIER ON
2+
GO
3+
SET ANSI_NULLS ON
4+
GO
5+
CREATE PROCEDURE [dbo].[DoNotLock1Get]
6+
AS
7+
BEGIN
8+
SET NOCOUNT ON;
9+
10+
SELECT
11+
N.NewspaperId,
12+
N.Name
13+
FROM
14+
dbo.Newspaper AS N WITH (NOLOCK);
15+
16+
END;
17+
GO
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
SET QUOTED_IDENTIFIER ON
2+
GO
3+
SET ANSI_NULLS ON
4+
GO
5+
6+
CREATE PROCEDURE [dbo].[DoNotLock2Get]
7+
AS
8+
BEGIN
9+
SET NOCOUNT ON;
10+
11+
SELECT
12+
N.NewspaperId,
13+
N.Name
14+
FROM
15+
dbo.Newspaper AS N WITH (NOWAIT,NOLOCK,INDEX(1));
16+
17+
END;
18+
GO
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
SET QUOTED_IDENTIFIER ON
2+
GO
3+
SET ANSI_NULLS ON
4+
GO
5+
6+
7+
CREATE PROCEDURE [dbo].[DoNotLock3Get]
8+
AS
9+
BEGIN
10+
SET NOCOUNT ON;
11+
12+
SELECT
13+
N.NewspaperId,
14+
N.Name
15+
FROM
16+
dbo.Newspaper AS N WITH (READUNCOMMITTED);
17+
18+
END;
19+
GO
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
SET QUOTED_IDENTIFIER ON
2+
GO
3+
SET ANSI_NULLS ON
4+
GO
5+
6+
7+
CREATE PROCEDURE [dbo].[DoNotLock4Get]
8+
AS
9+
BEGIN
10+
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
11+
SET NOCOUNT ON;
12+
13+
SELECT N.NewspaperId, N.Name FROM dbo.Newspaper AS N;
14+
15+
END;
16+
GO
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
SET QUOTED_IDENTIFIER ON
2+
GO
3+
SET ANSI_NULLS ON
4+
GO
5+
-- =============================================
6+
-- Author: <Author,,Name>
7+
-- Create date: <Create Date,,>
8+
-- Description: <Description,,>
9+
-- =============================================
10+
CREATE PROCEDURE [dbo].[HardcodedDatabaseNameReference]
11+
AS
12+
BEGIN
13+
SET NOCOUNT ON;
14+
15+
SELECT
16+
WideId
17+
,Column1
18+
,Column2
19+
,Column3
20+
,Column4
21+
,Column5
22+
,Column6
23+
,Column7
24+
,Column8
25+
,Column9
26+
,Column10
27+
,Column11
28+
,Column12
29+
,Column13
30+
,Column14
31+
,Column15
32+
,Column16
33+
,Column17
34+
,Column18
35+
,Column19
36+
,Column20
37+
FROM
38+
spDevelop.dbo.Wide;
39+
END;
40+
GO

0 commit comments

Comments
 (0)