Scripts

Script to Search SQL Error Log For a String

This script(sproc)uses xp_cmdshell from sql and FINDSTR from DOS to search the current errorlog for a specific string such as kernel or failed login. Compile this in the master db and if you do not pass an input parameter a example usage will display for you. ex: sp_dba_sqlerrorlog kernel Edward J Pochinski III

4 (1)

2001-08-13

1,843 reads

SQL Server Current Activity SuperCheck

This gives a quick check of the current activity on a SQL Server. I developed this after getting continually frustrated with "Current Activity" in SQL/EM getting blocked by processes when I needed to see blocking issues on the server. It has been immensely valuable to me in quickly identifying production-stopping issues on the database. It […]

4.2 (5)

2001-08-13

4,825 reads

Optimize Character Field Usage

This stored procedure was designed to scan all your character based columns in a particular database and show the minimum, maximum and average data length. As well as give an efficiency rating of the data stored. Input: None Output: Table name, Column name, Defined datatype and length, Average length of data for that column, Minimum […]

2001-08-10

1,655 reads

Email using CDONTS (via smtp)

Here is a very basic example script for sending emails via CDONTS. This comes from the sqlmag web-site forum. Although fine, remember that it will use the local SMTP server to forward emails onto the destination user. If your servers smtp process can not reach an exchange/group-wise/other mail box on your network, then this code […]

2001-08-09

3,517 reads

Generate Insert Statements Easily

This script will generate insert statements for the given tables. You can pass the tables names, separated by commas, into sp_DataAsInsCommand stored procedure as in the example below: EXEC sp_DataAsInsCommand 'employee,titleauthor,pub_info' Updated on 5/25/01 to correct an issue with columns that are short like a column defined as char(1), to correct another issue with the […]

3 (9)

2001-08-09

4,581 reads

Blogs

Custom deployment parameters in Azure Data Factory - Forget Me Not

By

(2020-Sep-26) Last week one of my Azure Data Factory (ADF) deployment pipelines failed with an...

VMworld 2020 – Top 10 Database Sessions (Part 2)

By

Whether you are a SQL Server Database Administrator, Infrastructure Architect, or any other member...

Daily Coping 25 Sep 2020

By

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

Read the latest Blogs

Forums

SQL Query - SUM and JOIN multiple tables but return missing record

By glennyboy

SQL Query - SUM and JOIN multiple tables but return missing record; Good day!...

Report Server Load balanced issue with one server while accessing https:

By PJ_SQL

We have 2 servers which are load balanced, when reporting service is stopped on...

multipoint to line geometry

By lpro

Hi, Attached, I exported a CSV file from a multipoint record from sql server ...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers