Giter Club home page Giter Club logo

emergentsoftware / sql-server-development-assessment Goto Github PK

View Code? Open in Web Editor NEW
30.0 4.0 7.0 4.44 MB

sp_Develop can be used by database developers, software developers and for performing database code (smell) reviews.

Home Page: https://emergentsoftware.github.io/SQL-Server-Development-Assessment/

License: Other

TSQL 99.46% Vim Snippet 0.54%
sp-develop sql-servers database-development stored-procedures microsoft-sql microsoft-sql-server health-check sql-server-assess ms-sql-server sql-query

sql-server-development-assessment's Introduction

SQL Server Development Assessment Overview

The open source SQL Server Development Assessment project contains the sp_Develop stored procedure. It can be used by database developers, software developers and for performing database code (smell) assessments to adhere to best practices.

Visit the sp_Develop documentation website at https://emergentsoftware.github.io/SQL-Server-Development-Assessment/

There you will find the check findings with database development best practices. Install & usage instructions. Results & parameter explanations, How to skip checks. Develop app settings. Install the test database.

Please connect with me (Kevin Martin) if you need assistance with sp_Develop or any of our SQL Server consulting services:

sql-server-development-assessment's People

Contributors

isaacheathes avatar kevinmartintech avatar mbajema avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sql-server-development-assessment's Issues

Update the version number by .1

Is your feature request related to a problem? Please describe.
No problem, just think it should be .1 higher.

Describe the solution you'd like
Increment the version number by .1.

Describe alternatives you've considered
No alternatives.

Are you ready to build the code for the feature?
Yes, I've forked the repo and will do the work.

Disabled Trigger Check

This could be a check just to let the developer know there are disabled triggers. They might not be aware of it from testing their code.

SELECT DISTINCT parent_id
FROM sys.triggers
WHERE is_disabled = 1 AND parent_id > 0

Disabled Constraint Check

Need to check if #59 is the same check.

SELECT DISTINCT parent_object_id
FROM sys.check_constraints
WHERE is_disabled = 1

Unrelated to Any Other Table Check

This could be just a sanity check to let the developer know there is a table that doesn't have any foreign keys.

SELECT object_id
FROM sys.tables
WHERE ObjectPropertyEx(object_id, 'TableHasForeignKey') = 0
    AND ObjectPropertyEx(object_id, 'TableHasForeignRef') = 0

Using NOCHECK on Constraint Check

  • Enabling NOCHECK on referential integrity constraints
  • Some scripting engines disable referential integrity during updates. You must ensure that WITH CHECK is enabled or else the constraint is marked as untrusted and therefore won’t be used by the optimizer.

Using ORDER BY in a VIEW Check

You cannot use the ORDER BY clause without the TOP clause or the OFFSET … FETCH clause in views (or inline functions, derived tables, or subqueries). Even if you resort to using the TOP 100% trick, the resulting order isn’t guaranteed. Specify the ORDER BY clause in the query that calls the view.

Disabled Foreign Key Check

This can be a sanity check to notify the developer they might have left a foreign key disabled.

SELECT DISTINCT parent_object_id
FROM sys.foreign_keys
WHERE is_disabled = 1

Untrusted Constraint Check

Need to check if #59 is the same check.

SELECT DISTINCT parent_object_id
FROM sys.check_constraints
WHERE is_not_trusted = 1

Undocumented Table Check

This would help with running a documentation tool like Redgate SQL Doc. This check might need to be tied to a parameter passed in for sp_Develop. Reason being, in most databases tables and object are not documented like this as a standard practice. The findings would be every table in most situations.

SELECT s.object_id, 'Undocumented table'
FROM sys.objects AS s /* it has no extended properties */
LEFT OUTER JOIN sys.extended_properties AS ep ON s.object_id = ep.major_id AND minor_id = 0
WHERE type_desc = 'USER_TABLE' AND ep.value IS NULL

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.