Update statistics for all tables in any DB

Most of the time even after executing dbcc dbreindex script on database you won't see much improvement in application/DB performance.  Thats because dbreindex creates statistics for all tables but it executes sp_updatestats which is like sample statistics. To get the maximum performance we had to execute Update statistics with fullscan on table. This simple will […]

4.75 (8)

2006-12-22 (first published: )

7,434 reads

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)

2006-09-20 (first published: )

729 reads

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)

2006-09-19 (first published: )

217 reads

BCP OUT tables from any database

This script will help DBA's who wants to BCP out required tables form any database. This script can be run through as a job. Before running you have to create a table in any given database and store the table names in it, which you want to Bulk copy. Query in this procedure will check […]

5 (1)

2005-02-17 (first published: )

273 reads

Grant Read-only permission to user on jobs

create this SQL as a stored procedure and give user execute permissions on it store procedure. that user will be able to see all the jobs and their associated schedules but won't be able to modify, create or execute job. This is particularly a request most often aske dby developer to view jobs/schedules on production […]

2004-11-15 (first published: )

463 reads

Fix orphan users

some times after restore database, you find your logins and users mapping is lossed and no user can now logon to database using application. I faced that many times. To map all your database users with master..syslogins. save this procedure in current database and execute it. All users will be mapped with logins.

2004-11-12 (first published: )

375 reads

Blogs

Containers: Working With Volumes

By

In the previous two posts on containers I showed how use Docker commands to...

Speaking at PASS Summit 2019

By

I am delighted to announce that I have been selected to speak at the...

High Security Prices–Always Encrypted 2019 needs Datacenter Edition

By

I was recently doing some work on Always Encrypted in SQL Server 2019 and...

Read the latest Blogs

Forums

The Change Failure Rate

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Change Failure Rate

Response to Bloor article on SQL Provision

By gbritton1

I found the article https://www.sqlservercentral.com/articles/bloor-scores-sql-provision-4-5-out-of-5-for-test-data-provisioning Interesting if a little shallow.  It would be more...

Row Level Security - Enabled but not Filtering

By dempstererin

...this is a 2nd attempt to post, as I can't seem to find the...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers