You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Development Application Settings/Red Gate/SQL Prompt/Snippets/cu-c9cc9091-91d1-4966-b4ba-655a34678f4a.json
Copy file name to clipboardExpand all lines: Development Application Settings/Red Gate/SQL Prompt/Styles/Team Expanded-6d4cd025-b548-497f-bf21-3d5c64111b1f.json
Copy file name to clipboardExpand all lines: docs/findings/SQLCodeDevelopment.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -1590,7 +1590,7 @@ This error catching and trowing methodology is the newest. [```THROW```](https:/
1590
1590
### Return Code Methodology (dbo.TestReturnCode)
1591
1591
The return code methodology utilizes [```RETURN```](https://docs.microsoft.com/en-us/sql/t-sql/language-elements/return-transact-sql). ```RETURN```, exits unconditionally from a query or procedure. ```RETURN``` is immediate and complete and can be used at any point to exit from a procedure, batch, or statement block. Statements that follow RETURN are not executed.
1592
1592
1593
-
When ```THROW``` is utilized, a return code is not assigned. ```RETURN``` was commonly utilized with [```RAISERROR```](https://docs.microsoft.com/en-us/sql/t-sql/language-elements/raiserror-transact-sql) which never aborts execution, so ```RETURN``` could be used afterwards. (See [Using RAISERROR Instead of THROW](/SQL-Server-Development-Assessment/best-practices-and-potential-findings/sql-code-conventions#using-raiserror-instead-of-throw)). Utilizing ```RAISERROR``` with the return code would provide context to the error that occured to present to the user and log the error.
1593
+
When ```THROW``` is utilized, a return code is not assigned. ```RETURN``` was commonly utilized with [```RAISERROR```](https://docs.microsoft.com/en-us/sql/t-sql/language-elements/raiserror-transact-sql) which never aborts execution, so ```RETURN``` could be used afterwards. (See [Using RAISERROR Instead of THROW](/SQL-Server-Development-Assessment/best-practices-and-potential-findings/sql-code-conventions#using-raiserror-instead-of-throw)). Utilizing ```RAISERROR``` with the return code would provide context to the error that occurred to present to the user and log the error.
This methodology utilizes stored procedure ```OUTPUT``` parameters. Here you can set a return code and a return message that is passed back to the software code to present to the user and log the error
Copy file name to clipboardExpand all lines: docs/findings/TableConventions.md
+3-1
Original file line number
Diff line number
Diff line change
@@ -543,7 +543,9 @@ These are a 400 level tasks and please feel free to reach out to a DBA for assis
543
543
## Missing Index for Foreign Key
544
544
**Check Id:** 21
545
545
546
-
Each foreign key in your table should be included in an index. Start off with an index on just the foreign key column if you have no workload to tune a multi-column index. There is a real good chance the indexes will be used when queries join on the parent table.
546
+
Each foreign key in your table should be included in an index in the primary key position. If you have a `UNIQUE NONCLUSTERED` index with multiple keys, ensure foreign key columns not in the primary key location also get their own `NONCLUSTERED` index in the primary key position.
547
+
548
+
Start off with an index on just the foreign key column if you have no workload to tune a multi-column index. There is a real good chance the indexes will be used when queries join on the parent table.
0 commit comments