THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | |
in Search

Browse by Tags

All Tags » t-sql » Utility   (RSS)
  • Utility to script a FOREIGN KEY Constraint

    Note: Amended to cascading and NOT FOR REPLICATION. As noted in my previous post, I am in the middle of building a utility (for work, and for my next SQLBLOG post), that will help when you need to drop the foreign key constraints on a table, but then replace them without having to save off the script manually. In that post, I showed how to ...
    Posted to Louis Davidson (Weblog) by drsql on May 24, 2017
  • Utility Queries–Structure of Tables with Identity Column

    Edit: At the suggestion of a much knowledgable commenter who shall remain named Aaron, I changed from using schema_name() function to using sys.tables. When writing code that is expected to have reuse, it can be safer to use the tables rather than functions because the tables will work in the context of the database that is in the from ...
    Posted to Louis Davidson (Weblog) by drsql on September 2, 2012
  • Utility Queries–Column Metadata

    Very often, I find myself wanting to query system metadata for columns. Some of the metadata is fairly easy to deal with, like if you want to find column names, just simply querying sys.columns is very straightforward.  But if you want to query data types, it gets stickier.  There are type types listed, one that is the declared type, and ...
    Posted to Louis Davidson (Weblog) by drsql on April 22, 2012
Privacy Statement