Maintenance and Management

Alter Index with online rebuild - SQL 2005

  • Script

This is an Alter Index script i made up from the one found in BOL and some other scripts we had. You need to create a table to hold the fragmentation data and it has a date column so you can track historical data. You can also add a db_mail part at the end to […]

5 (1)

2007-08-10 (first published: )

2,111 reads

FULL SERVER DOCUMENTATION -- HTML  and revised

  • Script

Revise note: 1. reformat the result into HTML page.2. added script to find sql server service account, sqlserver agent account.3. added script to find sql server authentication mode.4. added script to find sql server startup parameters5. added table of contents and hyperlinks.6. add DOS batch script to run the script on all servers.     TRY […]

5 (1)

2007-02-20 (first published: )

1,424 reads

Show when all jobs were running

  • Script

This script returns a result set showing which jobs were running at what point during a given day.One column is returned for each Job, and one row for each discrete portion of the day (configured by @TimeGranuality). A value of 1 indicates that the job was running at that point in time, 0 otherwise.Particularly useful […]

4.5 (2)

2007-07-26 (first published: )

524 reads

Remove Exec Permissions To Extended Stored Procs

  • Script

I created this script to simplify the process of restricting access to high risk extended stored procedures. It will find any user or role which has execute permissions on any of the stored procedures in the "#High_Risk_Stored_Procs" temp table and will generate the relevant revoke statements to remove those permissions.The current list of stored procedures […]

5 (1)

2006-11-27 (first published: )

383 reads

LongestRunningQueries.vbs

  • Script

This SQL 2005-only VBS script will show the longest-running queries on a given server, complete with graphical .sqlplan when clicked. Results go to a web page, viewed from the local machines's temp directory.Each row of the resulting table has the session ID, the currently running statement of the batch, a link to a text file […]

5 (1)

2007-07-24 (first published: )

337 reads

User Tables with Size  all DBs (SQL 2005 Only)

  • Script

Hope this is helpful to someone.  This script will create a table and a stored procedure in the master database to gather and store table info for all datbases. The sp uses a temp table to hold the results returned by sp_spaceused, then transfers the information to the permanent table DatabaseTableSizes and adds the database […]

5 (1)

2007-07-16 (first published: )

273 reads

Disable and enable constraints and triggers

  • Script

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: )

222 reads

Blogs

Abuse, Patience, and Understanding

By

I’ve been struggling with an author for a few months. I tried to work...

Daily Coping 21 Jun 2021

By

I started to add a daily coping tip to the SQLServerCentral newsletter and to...

SSIS Logging – Linking sysssislog with custom log

By

I was working on an ETL solution, which was expected to run for hours....

Read the latest Blogs

Forums

cumulative updates in multi instance standalone server

By noobdba

For 2019, how would one go about applying CU on multiple instances in a...

Powershell String was not recognized as a valid DateTime

By webrunner

Hello experts, I'm trying to import some CSV data into a SQL database using...

connecting to SQL Database from asp application and setting CONTEXT_INFO

By skb 44459

connecting to SQL Database from asp application and setting CONTEXT_INFO. <connectionStrings> <add name="CLHN_AppConnectionString" connectionString="Data...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers