Skip to content
Merged

Dev #104

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,17 @@ assignees: ''
**Version of the script**
Look in the stored procedure, and it'll have a version date & number near the top. Put that in here. If it's not the current version (dated in the last month), then upgrade to the current version and test that before reporting a bug - we fix a lot of stuff in each new build. We'll flat out close bug reports for older builds.


**What is the Check Id?**


**What is the current behavior?**


**If the current behavior is a bug, please provide the steps to reproduce.**


**What is the expected behavior?**


**Which versions of SQL Server and which OS are affected by this issue? Did this work in previous versions of our procedures?**
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ assignees: ''
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]


**Describe the solution you'd like**
A clear and concise description of what you want to happen.


**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.


**Are you ready to build the code for the feature?**
As much as we'd love to build everything that everyone wants for free, we need your help. Open source is built with your help and code. Are you ready to commit time to this project? Have you got existing code you can help contribute to solve the problem?
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# SQL Server Assess Overview
The SQL Server Assess project contains the sp_Develop stored procedure. It can be used by database developers, software developers and for performing database code (smell) reviews.
The SQL Server Assess project contains the [sp_Develop](https://github.com/EmergentSoftware/SQL-Server-Assess/blob/master/sp_Develop.sql) stored procedure. It can be used by database developers, software developers and for performing database code (smell) reviews.

This lists the database development best practice checks and naming conventions checks for the stored procedure named sp_Develop.

## Install Instructions

It is recommend installing this stored procedures in the master database for full SQL Servers, but if you want to use another one, that's totally fine.
It is recommend installing the [sp_Develop](https://github.com/EmergentSoftware/SQL-Server-Assess/blob/master/sp_Develop.sql) stored procedures in the master database for full SQL Servers, but if you want to use another one, that's totally fine.

On Azure SQL Server you will need to install this stored procedure in the user database.
On Azure SQL Server you will need to install the sp_Develop stored procedure in the user database.

## Usage Instructions

After installing the stored procedure open SSMS and run in the database you wish to check for database development best practices.
After installing the [sp_Develop](https://github.com/EmergentSoftware/SQL-Server-Assess/blob/master/sp_Develop.sql) stored procedure open SSMS and run in the database you wish to check for database development best practices.

```sql
EXECUTE dbo.sp_Develop
Expand Down Expand Up @@ -390,7 +390,7 @@ Although the MONEY data type generally takes less storage and takes less bandwid

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!

**Future columns to check:**
**Column names to check:**
- FirstName
- MiddleName
- LastName
Expand Down Expand Up @@ -651,7 +651,7 @@ It is common to need a database to operate under different names.
## Using @@IDENTITY Instead of SCOPE_IDENTITY
**Check Id:** [NONE YET]

The generation of an IDENTITY value is not transactional, so in some circumstances, @@IDENTITY returns the wrong value and not the value from the row you just inserted. This is especially true when using triggers that insert data, depending on when the triggers fire. The SCOPE_IDENTITY function is safer because it always relates to the current batch (within the same scope). Also consider using the IDENT_CURRENT function, which returns the last IDENTITY value regardless of session or scope. The OUTPUT clause is a better and safer way of capturing identity values.
The generation of an identity value is not transactional, so in some circumstances, ```@@IDENTITY``` returns the wrong value and not the value from the row you just inserted. This is especially true when using triggers that insert data, depending on when the triggers fire. The ```SCOPE_IDENTITY``` function is safer because it always relates to the current batch (within the same scope). Also consider using the ```IDENT_CURRENT``` function, which returns the last identity value regardless of session or scope. The OUTPUT clause is a better and safer way of capturing identity values.


## Using BETWEEN for DATETIME Ranges
Expand Down Expand Up @@ -723,13 +723,13 @@ Try running EXEC sp_refreshsqlmodule or sp_refreshview.

# Running Issues

These are some issues you might run into when running sp_Develop.
These are some issues you might run into when running [sp_Develop](https://github.com/EmergentSoftware/SQL-Server-Assess/blob/master/sp_Develop.sql).


## Some Checks Skipped
**Check Id:** 26

We skipped some checks that are not currently possible, relevant, or practical for the SQL Server sp_Develop is running against. This could be due to the SQL Server version/edition or the database compatibility level.
We skipped some checks that are not currently possible, relevant, or practical for the SQL Server [sp_Develop](https://github.com/EmergentSoftware/SQL-Server-Assess/blob/master/sp_Develop.sql) is running against. This could be due to the SQL Server version/edition or the database compatibility level.



Expand All @@ -748,13 +748,13 @@ There most likely been some new checks and fixes performed within the last 6 mon
## Ran on a Non-Readable Availability Group Secondary Databases
**Check Id:** 17

You are running this on an AG secondary, and some of your databases are configured as non-readable when this is a secondary node. To analyze those databases, run sp_Develop on the primary, or on a readable secondary.
You are running this on an AG secondary, and some of your databases are configured as non-readable when this is a secondary node. To analyze those databases, run [sp_Develop](https://github.com/EmergentSoftware/SQL-Server-Assess/blob/master/sp_Develop.sql) on the primary, or on a readable secondary.


## Ran Against 50+ Databases Without @BringThePain = 1
**Check Id:** 18

Running sp_Develop on a server with 50+ databases may cause temporary insanity for the server and/or user. If you're sure you want to do this, run again with the parameter @BringThePain = 1.
Running [sp_Develop](https://github.com/EmergentSoftware/SQL-Server-Assess/blob/master/sp_Develop.sql) on a server with 50+ databases may cause temporary insanity for the server and/or user. If you're sure you want to do this, run again with the parameter @BringThePain = 1.



Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CREATE SCHEMA [Schema_Including_$pecial_Characters_in_Name]
AUTHORIZATION [dbo]
GO