Skip to content

Commit 30bd001

Browse files
Merge pull request #12 from EmergentSoftware/dev
Dev
2 parents 0beeffe + 432b40f commit 30bd001

File tree

2 files changed

+32
-6
lines changed

2 files changed

+32
-6
lines changed

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,21 @@ EXECUTE dbo.sp_Develop
2727
|@GetAllDatabases|Runs checks across all of the databases on the server instead of just your current database context. Does not work on Azure SQL Server.|
2828
|@IgnoreCheckIds|Comma-delimited list of check ids you want to skip|
2929
|@IgnoreDatabases|Comma-delimited list of databases you want to skip|
30-
|@BringThePain |If you’ve got more than 50 databases on the server, this only works if you also pass in @BringThePain = 1, because it’s gonna be slow.|
30+
|@BringThePain |If you’ve got more than 50 databases on the server, this only works if you also pass in @BringThePain = 1, because it’s gonna be slow.|
3131
|@OutputType|TABLE = table<br/>COUNT = row with number found<br/>MARKDOWN = bulleted list<br/>XML = table output as XML<br/>NONE = none|
3232
|@OutputXMLasNVARCHAR|Set to 1 if you like your XML out as NVARCHAR.|
3333
|@Debug|Default 0. When 1, we print out messages of what we're doing in the messages tab of SSMS. When 2, we print out the dynamic SQL query of the check.|
3434
|@Version|Output variable to check the version number.|
3535
|@VersionDate|Output variable to check the version date.|
3636
|@VersionCheckMode|Will set the version output variables and return without running the stored procedure.|
3737

38+
# Test Database Install
39+
40+
The 'Test Database' folder contains the RedGate SQL Source Control. Use this test database for testing checks.
41+
42+
**RedGate SQL Source Control Documentation**
43+
- [Getting Started ](https://documentation.red-gate.com/soc7/getting-started)
44+
- [Link to Git](https://documentation.red-gate.com/soc7/linking-to-source-control/link-to-git)
3845

3946

4047
# Current High Check Id
@@ -142,7 +149,7 @@ FROM
142149
## Using Plural in Name
143150
**Check Id:** 1
144151

145-
Table and view names should be singular, for example, "Customer" instead of "Customers". This rule is applicable because tables are patterns for storing an entity as a record – they are analogous to Classes serving up class instances. And if for no other reason than readability, you avoid errors due to the pluralization of English nouns in the process of database development. For instance, activity becomes activities, ox becomes oxen, person becomes people or persons, alumnus becomes alumni, while data remains data.
152+
Table and view names should be singular, for example, "Customer" instead of "Customers". This rule is applicable because tables are patterns for storing an entity as a record – they are analogous to Classes serving up class instances. And if for no other reason than readability, you avoid errors due to the pluralization of English nouns in the process of database development. For instance, activity becomes activities, ox becomes oxen, person becomes people or persons, alumnus becomes alumni, while data remains data.
146153

147154
If writing code for an data integration and the source is plural keep the staging/integration tables the same as the source so there is no confusion.
148155

@@ -305,9 +312,9 @@ Add a clustered index.
305312

306313
SQL Server storage is built around the clustered index as a fundamental part of the data storage and retrieval engine. The data itself is stored with the clustered key. All this makes having an appropriate clustered index a vital part of database design. The places where a table without a clustered index is preferable are rare; which is why a missing clustered index is a common code smell in database design.
307314

308-
A 'table' without a clustered index is actually a heap, which is a particularly bad idea when its data is usually returned in an aggregated form, or in a sorted order. Paradoxically, though, it can be rather good for implementing a log or a ‘staging’ table used for bulk inserts, since it is read very infrequently, and there is less overhead in writing to it.
315+
A 'table' without a clustered index is actually a heap, which is a particularly bad idea when its data is usually returned in an aggregated form, or in a sorted order. Paradoxically, though, it can be rather good for implementing a log or a ‘staging’ table used for bulk inserts, since it is read very infrequently, and there is less overhead in writing to it.
309316

310-
A table with a non-clustered index, but without a clustered index can sometimes perform well even though the index has to reference individual rows via a Row Identifier rather than a more meaningful clustered index. The arrangement can be effective for a table that isn’t often updated if the table is always accessed by a non-clustered index and there is no good candidate for a clustered index.
317+
A table with a non-clustered index, but without a clustered index can sometimes perform well even though the index has to reference individual rows via a Row Identifier rather than a more meaningful clustered index. The arrangement can be effective for a table that isn’t often updated if the table is always accessed by a non-clustered index and there is no good candidate for a clustered index.
311318

312319
Heaps have performance issues like table scans, forward fetches.
313320

@@ -366,7 +373,7 @@ Although the MONEY data type generally takes less storage and takes less bandwid
366373
## Using VARCHAR Instead of NVARCHAR for Unicode Data
367374
**Check Id:** [NONE YET]
368375

369-
You can't require everyone to stop using national characters or accents any more. Names are likely to have accents in them if spelled properly, and international addresses and language strings will almost certainly have accents and national characters that can’t be represented by 8-bit ASCII!
376+
You can't require everyone to stop using national characters or accents any more. Names are likely to have accents in them if spelled properly, and international addresses and language strings will almost certainly have accents and national characters that can’t be represented by 8-bit ASCII!
370377

371378
**Future columns to check:**
372379
- FirstName
@@ -519,7 +526,7 @@ Only use NOLOCK when the application stakeholders understand the problems and ap
519526
## Not Using Table Alias
520527
**Check Id:** [NONE YET]
521528

522-
Use aliases for your table names in most T-SQL statements; a useful convention is to make the alias out of the first or first two letters of each capitalized table name, e.g. “Site” becomes "S" and "SiteType" becomes “ST”.
529+
Use aliases for your table names in most T-SQL statements; a useful convention is to make the alias out of the first or first two letters of each capitalized table name, e.g. “Site” becomes "S" and "SiteType" becomes “ST”.
523530

524531

525532

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Use this Post-Deployment script to perform tasks after the deployment of the project.
3+
* Read more at https://www.red-gate.com/SOC7/post-deployment-script-help
4+
*/
5+
6+
7+
/* Create a table that we will delete so that we have an invalid object to test */
8+
CREATE TABLE dbo.UseToExist (
9+
UseToExistId INT IDENTITY(1, 1) NOT NULL
10+
,UseToExistColumn VARCHAR(30) NULL CONSTRAINT UseToExist_UseToExistId PRIMARY KEY CLUSTERED (UseToExistId)
11+
);
12+
GO
13+
14+
CREATE VIEW dbo.InvalidObject
15+
AS
16+
SELECT UTE.UseToExistId, UTE.UseToExistColumn FROM dbo.UseToExist AS UTE
17+
GO
18+
19+
DROP TABLE dbo.UseToExist

0 commit comments

Comments
 (0)