Can use this to select , insert and update phone fields into a standard format. Select FormatPhone(phone_column) from table Update Table set phone_column=FormatPhone(phone_column)Where ...Insert Into Table ( column1, phone_primary ...) Values ( 'qwerty', FormatPhone(1455846677)And the like --
2007-01-25 (first published: 2006-12-01)
447 reads
Drops the specified column from the specified table as well as any constraints and indexes that depend on the column. By default the script will just find the corresponding column, constraints, and indexes.Comes in handy for patching databases.
2007-01-24 (first published: 2006-12-21)
2,449 reads
This script will quickly generate DML to search all the tables in the current database for a given string. It could be modified to execute the generated code if desired. If you are running this in a
2007-01-23 (first published: 2007-01-04)
2,954 reads
XSLT Stylesheet to produce developer/object oriented html report from SQL Server 2005 Upgrade Advisor xml report file. Name the script sqlupad.xsl and insert the following as the first line in the xml Upgrade Advisor report file. Place sqlupad.xsl file in same directory as the xml report. This stylesheet works against Database Server component reportonly, does […]
2007-01-17 (first published: 2007-01-03)
186 reads
For fellow Canadians and neighbours to the south, you may find useful a function to validate the formatting of a Canadian postal code. More than once I've had to work with web programmers on checking that a postal code meets the A1A1A1 style, so carry around a function that simply returns a true/false bit if […]
2007-01-15 (first published: 2007-01-05)
1,071 reads
This script will query msdb to determine the size of data and log files for all databases, along with the average sizes of full and transaction log backups. Results are averaged over the past two weeks, but this is easily changed.
2007-01-12 (first published: 2007-01-05)
1,610 reads
This VB script will attempt to make a connection to all SQL Servers enumerated in the SQLInventory table over Named Pipes and TCP\IP. If a SQL Instance is listed, it will attempt TCP\IP connections using both port and instance name. Once the connection is established to each server using each protocol, the script will query […]
2007-01-11 (first published: 2007-01-05)
1,238 reads
Really basic way to help identify tables that have 0 rows, etc. It uses the sp_MSForEachTable to crawl the database. Very simple script.
2007-01-10 (first published: 2006-12-01)
217 reads
Returns the datatype, table name and field name for all user tables in the current SQL Server 2005 database. Results are sorted by type, table and field.
2007-01-08 (first published: 2006-12-05)
105 reads
Use this script to figure out the current age of a person or object. It also takes leap year birthdates into consideration. You can also use this to find out the age of something at a particular point of time.
2007-01-04 (first published: 2006-12-19)
196 reads