Run it against the msdb database
The blog has moved to http://jessehouse.com/ ... Many google searches point here so I am leaving it operational, but there will be no new posts.
Showing posts with label sql. Show all posts
Showing posts with label sql. Show all posts
Tuesday, August 4, 2009
Get list of MSSQL jobs that are currently running
The following sql statement will return information about the currently executing MSSQL jobs.
Labels:
sql
Thursday, March 26, 2009
Get Filenames and Database names from MSSQL
I was doing some clean up on one of our database servers; we have many databases created with backup/restore for testing purposes I was checking for the largest ldf files and making sure those databases were in simple mode and then shirking the data files, there were a few files I could not match to the databases because the mdf and ldf file names were different from the actual database file name - found the following queries using a few google searches
Sunday, May 18, 2008
MSSQL drop and re-add constraints
One of the guys at work hooked me up with this code - quite useful if you want to do a bunch of data inserts but don't want to worry about the order you apply the inserts because of foreign key constraints
Before performing data actions:
After performing data actions:
Thanks to ET for this code bit!
Before performing data actions:
-- generate these and run SELECT 'ALTER TABLE ' + so.NAME + ' NOCHECK CONSTRAINT ALL' FROM sysobjects so WHERE xtype = 'u'
After performing data actions:
-- generate these and run SELECT 'ALTER TABLE ' + so.NAME + ' CHECK CONSTRAINT ALL' FROM sysobjects so WHERE xtype = 'u'
Thanks to ET for this code bit!
Subscribe to:
Posts (Atom)