Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Scripts by Chris Morton

SQLServerCentral.com profile

   Items 1 to 15 of 15   
 

DROP all stored procedures

This code will drop all stored procedures made with splog. With minor modification it will also drop all functions and sp not made with splog.   Read more...
By Chris Morton 2009/03/13 | Source: SQLServerCentral.com | Category: stored procedures
Rating: |  Discuss |   Briefcase | 970 reads

Loop Through every table in a DB

This Script has been build to list all the tables in a database without using a cursor.   Read more...
By Chris Morton 2009/01/20 | Source: SQLServerCentral.com | Category: metadata
Rating: |  Discuss |   Briefcase | 1,994 reads

Truncate Referenced Table

Often during the development phase one is required to truncate a table. often the task of removing foreign key references is necessary to truncate. this sp takes the pain out of it.  Read more...
By Chris Morton 2009/01/19 | Source: SQLServerCentral.com | Category: foreign keys (fk)
Rating: |  Discuss |   Briefcase | 1,241 reads

AUTOGENERATE Stored procedures example

This is related to my other autogenerate code. this is just an example of how to use it.   Read more...
By Chris Morton 2008/11/21 | Source: SQLServerCentral.com | Category: autogenerate
Rating: |  Discuss |   Briefcase | 667 reads

Encrypt All Stored procedures at once

this code encrypts all stored procedures that meet a certain format. this code is easy to change to suit your particular needs, but be sure to back up your stored procs first.   Read more...
By Chris Morton 2009/09/10 | Source: SQLServerCentral.com | Category: with encryption
Rating: |  Discuss |   Briefcase | 3,176 reads

random randomise randomize data query

this is a MUCH simpler method of random randomize randomise rand data from a table  Read more...
By Chris Morton 2008/11/19 | Source: SQLServerCentral.com | Category: randomise randomize
Rating: |  Discuss |   Briefcase | 248 reads

random integer number scalar function

this produces a random integer between a certain range  Read more...
By Chris Morton 2008/12/12 | Source: SQLServerCentral.com | Category: random numbers
Rating: |  Discuss |   Briefcase | 805 reads

search every database on server from a single sp

i have recently had the need to search the every database on the server for a particular string. i came up with this... it has lots of room for improvement but it works  Read more...
By Chris Morton 2008/12/19 | Source: SQLServerCentral.com | Category: search
Rating: |  Discuss |   Briefcase | 948 reads

AUTOGENERATE INSERT UPDATE SELECT STATEMENTS UPDATED

I have made an update of this script http://www.sqlservercentral.com/scripts/Metadata/64603/. the new version includes can generate 4 stored procedures for every table in a database  Read more...
By Chris Morton 2013/01/08 | Source: SQLServerCentral.com | Category: autogenerate parameters
Rating: |  Discuss |   Briefcase | 3,007 reads

How to Drop Unused Empty Redundant columns

Often during the development lifecycle columns are added to tables that become redundant or remain unused. this script removes unused (empty) columns  Read more...
By Chris Morton 2008/11/27 | Source: SQLServerCentral.com | Category: alter table
Rating: |  Discuss |   Briefcase | 1,134 reads

Demonstration on how to pivot data using temp tables

This script was designed to 'pivot' data that couldnt easily be pivoted in any other way. i used temporary tables to eventually achieve the result i was looking for :)  Read more...
By Chris Morton 2008/10/10 | Source: SQLServerCentral.com | Category: dynamic sql
Rating: |  Discuss |   Briefcase | 870 reads

Create Sample Data Script

in this scripts there are two methods of creating sample data for a gambling application. i have used both cursors and loops.  Read more...
By Chris Morton 2008/10/10 | Source: SQLServerCentral.com | Category: cursors
Rating: |  Discuss |   Briefcase | 569 reads

AUTOGENERATE INSERT UPDATE SELECT STATEMENTS

use metadata to generate basic create procedure statements for insert update and select  Read more...
By Chris Morton 2008/11/21 | Source: SQLServerCentral.com | Category: metadata
Rating: |  Discuss |   Briefcase | 3,548 reads

How to Test Connectivity for a Linked Server

Just one way of testing for a linked server based on data within your database.  Read more...
By Chris Morton 2011/09/16 | Category: miscellaneous
Rating: |  Discuss |   Briefcase | 2,539 reads

How to insert and update from remote linked server

Please read the how to use. unfortunately the orignal document i submitted was truncated :( and i dont have time to remember what i said  Read more...
By Chris Morton 2007/10/30 | Source: SQLServerCentral.com | Category: replication
Rating: |  Discuss |   Briefcase | 2,536 reads
   Items 1 to 15 of 15