Scripts

Technical Article

Get Foreign Key of all the tables for Sqlserver DB

This script will create two views and select the data from the TableReferences view. This view will give list of all the foreignkeys of the selected database with its constraint name, the table name and column name(s) on which the constraint is created and the referencing table name and column name(s).

5 (2)

You rated this post out of 5. Change rating

2006-09-25 (first published: )

595 reads

Technical Article

Get SQL job status for all servers.

Below script will Get SQL job status for all servers running on the same network. All you have to do is create a linked server with msdb on local machine. Executing this script will give you all job status on any number of servers. Good for an environment where a DBA had to see job […]

5 (1)

You rated this post out of 5. Change rating

2006-09-20 (first published: )

744 reads

Technical Article

Disable and enable constraints and triggers

Often in development environment you want to truncate all the tables to insert new data from production, but you cannot do easily as there were a bumch of Foreign Keys and triggers. Dropping all triggers and FK's and then recreating them again is a tedious job. That to dropping and recreating FK's in a particular […]

5 (1)

You rated this post out of 5. Change rating

2006-09-19 (first published: )

243 reads

Technical Article

Random Number Generator

Often the RAND() function is predictable based on the seed. This stored procedure generates a pretty good random integer because the seed itself is quite unpredictable. You can’t put this in a UDF since it is indeterminate due to the RAND and GETDATE() functions used.

You rated this post out of 5. Change rating

2006-09-15 (first published: )

603 reads

Technical Article

Enterprise Manager Configuration Import/Export

For those that do not have SQL 2005 Management Studio, this utility reads from or writes to the SQL Enterprise Manager configuration. It can handle a Server Group hierarchy up to 5 levels deep. Usage instructions are included in the script.Run with cscript.exe.NOTE: Server registrations using SQL (not Windows) authentication write out the password in […]

You rated this post out of 5. Change rating

2006-09-13 (first published: )

213 reads

Technical Article

SQLPing.vbs

Troubleshooting intermitten connectivity issues can be difficult. One approach is to repeatedly test connecting to SQL Server outside of an existing application in order to verify if a server-wide intermitten issue is occurring. This script is used to test remote connectivity to a SQL Server. The script loops in one minute intervals (adjust as needed). […]

You rated this post out of 5. Change rating

2006-09-04 (first published: )

1,426 reads

Technical Article

get rich schema details of all or some tables

to get information about tables+columns+primarykeys+foreignkeys+identity, i firstly used SQL server built-in INFORMATION_SCHEMA.xxx. however, my company have various DBAs and each of them owns objects. when using INFORMATION_SCHEMA.xxx, it retrieves data based on current login (version 2005 resolves this schema v.s. object owner problem already... yeah) , which bring me a great trouble. if you want […]

3 (2)

You rated this post out of 5. Change rating

2006-08-30 (first published: )

564 reads

Technical Article

Reset Identity Seeds

This Script is used to reset the Identity coloumn to whatever the value we required. We need to compile this procedure in the database where we required to ressed the Identity coloumns of every table. After compiling we need to execute this procedure with a parameter of integer value. Then it will reseed the Identity […]

You rated this post out of 5. Change rating

2006-08-29 (first published: )

204 reads

Blogs

Webcast Tomorrow on SQL Server Disaster Recovery

By

Tomorrow, November 19, 2024, at 1 PM EST, I'm giving a webcast on SQL...

SQL Server Quickie #48 – Azure SQL Managed Instance

By

Today I have uploaded SQL Server Quickie #48 to YouTube. This time I’m talking...

Spark Connect Dotnet November 2024 Where are we?

By

All Spark Connect Posts Introduction There have been quite a few changes in the last...

Read the latest Blogs

Forums

Generating (semi-)fake purchase data

By pietlinden

I know how to generate fake data (thanks to Jeff Moden's articles!)... the problem...

Export database and tables no table data

By HeftSteady

Trying to move a database from one sql server instance to another on separate...

Package to Project model conversion

By blom0344

Hi All, With previous customer range we were always required to work in the...

Visit the forum

Question of the Day

What's the Ceiling?

What do I get as the results from this code?

SELECT CEILING (999.999), CEILING (-999.999);

See possible answers