Scripts

Technical Article

Log DISK IO statistics per Database file!!!

Well, ever wanted to know what was happening on disk....You could with FN_vitrualfilestats....Here is a NICE SPROC that samples all databases and puts it in a table. You can choose if you want to Retain values in the table or that it must be cleaned every time the sproc runs.( Put this data in a […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2003-01-31

944 reads

Technical Article

Delete record efficiently. (sp_CheckAndDelete )

The sp_CheckAndDelete stored procedure specially created for handling process of data deleting efficiently in MS SQL Server 2000 tables, as it is too difficult to handle this process when dependants exist for record to be deleted. When the deleting process is done with sp_CheckAndDelete stored procedure, you will be informed the status of the process […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2003-01-30

211 reads

Technical Article

List all the associated tables for a view

I had recent request for a script to list all the views for a database along with the associated tables the columns depend on. It is a rather simple script but as I have not seen a similar one, I thought I would share it with my fellow dbas. It returns information about views specific […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2003-01-23

493 reads

Technical Article

Build a script for CREATE DATABASE/FOR ATTACH

It is easy enough to detach and reattach databases in SQL 2000 providing you have less than 16 files to attach.I manage some very large databases and these sometimes need to be detached and reattached (i.e. for moving a database file from one volume to another).I have more than 16 files to contend with on […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

(3)

You rated this post out of 5. Change rating

2003-01-22

2,903 reads

Technical Article

Build Restore Scripts for All User Databases

Something I really hate is typing something repetitive.  To prepare for our Disaster Recovery plan, I wrote this script.It is a bit strange in that it requires 2 run iterations to generate the desired result.I use a naming standard for backup files of the form:D_DBName.Bakand a naming standard for database files of the form:DBName_Dx.Mdf for […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2003-01-22

616 reads

Technical Article

Generate script to tidy up DB Logical File Names

You may be a tidy person who likes to keep naming standards for everything in SQL Server.  It is a good practice since it makes generating scripts for everyday DBA tasks a lot simpler.  I make all database files follow the following standard:DBName_D1.mdf     for primary filegroup dataDBName_I1.ndf     for index filegroupDBName_L1.ldf     for transaction […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2003-01-22

321 reads

Technical Article

The case against using single-line comments

This isn't a "script" per se - but rather an observation about a common issue in writing scripts.I want to alert SQL programmers to the issues surrounding the use of single-line comments.  I try to avoid these whenever possible, and use block comments instead (except, of course, when commenting out the keyword GO).The reason is […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

(3)

You rated this post out of 5. Change rating

2003-01-21

301 reads

Technical Article

#sp_shrinkdata

Unlike shrinking transaction log, shrinking a data file seems to be tough. A lot of people complained about the "shrink database" option in EM not working, or DBCC SHRINKDATABASE not working, or DBCC SHRINKFILE not working. I have found that a data file will eventually shrink given enough try, time and patience. I've put everything […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2003-01-14

422 reads

Blogs

The Book of Redgate:A Prehistory

By

I’ve covered the values in a number of previous posts on the Book of...

Evidence-bound: what AgentDBA will and won’t link

By

When the evidence names the database, it says so. When it doesn’t, it stops....

Prep data for AI vs. Fabric Data Agent Instructions: What Goes Where?

By

Making Data AI-Ready, Part 3 (This is the final article in a three-part series...

Read the latest Blogs

Forums

DanDan Jl Panjang Cidodol | WA:083121526888

By Layanan BCA 24 JAM

Jl. Cidodol Raya No.46, RT.6/RW.6, Grogol Sel., Kec. Kebayoran Lama, Kota Jakarta Selatan, Daerah...

DanDan Kavling Polri | WA:083121526888

By Layanan Bank BCA

Kavling Polri, Jl No.1601 Blok F 8, RT.8/RW.02, Jelambar, Grogol petamburan, West Jakarta City,...

Toko Kosmetik Sumber Ayu | WA:083121526888

By Layanan Bank BCA

Pasar Tomang Barat (Pasar Kopro) Lt Dasar Blok B-48, RT.14/RW.5 (depan parkiran motor), Tanjung...

Visit the forum

Question of the Day

Hyperscale Replicas III

In an Azure SQL Database Hyperscale Edition, how many named replicas can be configured?

See possible answers