Clinton Herring


Technical Article

Format a DOS date as yyyymmdd

Do you run jobs that call BAT files where you wish you could include a formatted date stamp in the output name of an OSQL file? Well, you can using the DOS 'FOR' command. I named a variable FILEDATE and use it as: path\Filename_%FILEDATE%.txt (Note: A BAT file requires double %% in the 'FOR' command […]

4.5 (2)

You rated this post out of 5. Change rating

2002-10-21

1,093 reads

Technical Article

sp_CompareTblCnts

This stored procedure does a quick table comparison between 2 databases that are supposed to be the same. Tables found on either db but missing from the other are reported as are record count differences for matching tables. Establish a linked-server with appropriate permissions to compare across servers. Compile in master.

You rated this post out of 5. Change rating

2002-10-09

120 reads

Technical Article

sp_GetUserInfo

Returns database user information as a runnable script for the specified database. The default is master. Great for restoring user access and permissions after a restore to a development server. Run prior to the restore and save the output to an sql file.

You rated this post out of 5. Change rating

2002-10-09

1,038 reads

Technical Article

Find and replace column constraints

I submit this script as an example of how one might go about generating 'Alter Table' statements that find and replace specific column constraints. In my case I had to find all occurrences in a production db of suser_name() as a column constraint and replace it with suser_sname(). This script is only an example and […]

You rated this post out of 5. Change rating

2002-10-08

247 reads

Technical Article

sp_spaceused2

An update to sp_spaceused2. This update fixes some problems related to dbs that are non-accessible such being offline. This stored proc can be run from any database when compiled in master and can report information on all databases at once. Get information on all dbs, one db, one db and all its tables or one […]

You rated this post out of 5. Change rating

2002-02-19

307 reads

Blogs

A New Word: Incidental Contact High

By

incidental contact high – n. an innocuous touch by someone just doing their job...

Azure PostgreSQL Flexible Server and Entra Groups

By

My company is moving from an Azure PostgreSQL single server to a flexible server....

Take the 2025 State of Database Landscape Survey

By

The survey is out now and you can share your experiences for a chance...

Read the latest Blogs

Forums

GIT Configuration and Automated Release for Azure Data Factory

By Sucharita Das

Comments posted to this topic are about the item GIT Configuration and Automated Release...

How to Add a New Shared Disk to a WSFC as a SQL Resource

By muhkam

Comments posted to this topic are about the item How to Add a New...

Knowing What You Don't Know

By Louis Davidson (@drsql)

Comments posted to this topic are about the item Knowing What You Don't Know

Visit the forum

Question of the Day

Am I on Synapse?

How can I tell from T-SQL if I'm connected to SQL Server or Synapse Analyics?

See possible answers