Scripts

Technical Article

Load data from text file with variable columns

This script loads from a formatted text file (E.g. tab delimited) with variable number of columns using BULK INSERT. For instance, the file may have any number of columns and next load (seconds later) the same file may have a different number of columns. This script reads the first line (column names) extracting the names […]

You rated this post out of 5. Change rating

2005-03-01 (first published: )

1,012 reads

Technical Article

Correction to parsestring

The original function fails when a mistaken split char is being snet to the function.This can easly be corrected by adding an if to check the value of the @holdpos inside the loop before sending it to the substring functionif the value is 0 then break the loop

You rated this post out of 5. Change rating

2005-02-23 (first published: )

126 reads

Technical Article

SQL Server Database File Sizes

This script creates a SQL_Statistics table in the Mater Database and then scroll through the existing databases on the server and gathers the Servers Name, logical device name, the file name and the file size and writes it to the table alond with a date time stamp.We run it once a month to gather the […]

You rated this post out of 5. Change rating

2005-02-22 (first published: )

551 reads

Technical Article

Backup All or one DTs Package(s)

The script runs using vbscript code. It requires the user to enter parameters and run the script. The script uses both trusted and standard connection. The script also generate a log file each time it runs. Copy the code below and save it with .vbs extension.

You rated this post out of 5. Change rating

2005-02-21 (first published: )

306 reads

Technical Article

Script to return datetime as just date

You can return the date as a string (varchar) in whatever date format you like by adding a 'style' to the CONVERT statement. Exmaples of style values are (two left hand columns):1 101 USA mm/dd/yy 2 102 ANSI yy.mm.dd 3 103 British/French dd/mm/yy 4 104 German dd.mm.yy 5 105 Italian dd-mm-yy 6 106 - dd […]

(3)

You rated this post out of 5. Change rating

2005-02-18 (first published: )

208 reads

Technical Article

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 […]

(1)

You rated this post out of 5. Change rating

2005-02-17 (first published: )

306 reads

Technical Article

Custom Log Shipping

There are mainly two components. One job that is managing the full database backup - restore and a second job that manage the transaction log backup - restore. At this two a new one similar with the full database backup - restore can be added for the differential backups if is the case. I will […]

You rated this post out of 5. Change rating

2005-02-15 (first published: )

1,047 reads

Technical Article

Get Data/Log File Names, Sizes, Percent Utilization--ALL DBs

This Stored Procedure Will Get: - The Data and Log File Names - The Data and Log File Sizes (MB) - The Data and Log Percent Utilization (%) for ALL Databases on a SQL Instance. Numbers Should (More Or Less) Reflect What You See on The SQL Enterprise Manager Taskpad. LIMITATIONS: For Databases With Multiple […]

You rated this post out of 5. Change rating

2005-02-14 (first published: )

1,174 reads

Technical Article

usp_import_from_mysql

Imports data from MySQL Server; works best with mysql driver 3.51.06! You'll have to create a dsn and then a linked server to that dsn. The script checks if the table exists in the mysql catalog (defined in the dsn properties). Too bad it needs administrative privileges to run (dbcc statement) - my advice: don't […]

You rated this post out of 5. Change rating

2005-02-11 (first published: )

137 reads

Blogs

T-SQL Snapshot Backups on Availability Group Secondary Replicas

By

One of my favourite features of SQL Server 2022 was the T-SQL Snapshot Backups....

The Book of Redgate: Hours

By

I have said and written this many times: Redgate Software is the type of...

How to Check TDE Progress and Elapsed Time in SQL Server

By

How to Check TDE Progress and Elapsed Time in SQL Server ...

Read the latest Blogs

Forums

Alamat BCA KCP Duta Mas Fatmawati Telp/Wa:0821-8200-233

By layanan_Bca88

Tlp/Wa:628218200233 Komplek Pertokoan Duta Mas, Jl. RS. Fatmawati Raya No.8 Blok D1 No. 6,...

Alamat BCA KCP Hasanudin Telp/Wa:0821-8200-203

By m4rt1n4

WA Cs:62 8218200203 Jl. Sultan Hasanuddin Dalam No.43/48, RT.2/RW.1, Melawai, Kec. Kby. Baru, Kota...

Alamat BCA KCP Kemang Telp/Wa:0821-8200-174

By R4nt4u

Telp/Wa:62 8218200174 Jl. Kemang Sel. No.60, RT.4/RW.2, Bangka, Kec. Mampang Prpt., Kota Jakarta Selatan,...

Visit the forum

Question of the Day

Squared Values

What happens when I run this code in SQL Server 2022?

SELECT SQUARE('12')

See possible answers