Scripts

Technical Article

Attaching Multiple Data File

This Stored Procedure can attach multiple data File that have *.mdf or *.ldf Extention ..Example :you have multiple data file on your "c:\SQL_data directory" .. just type this on your query analyzer.. of course you have to be a member of sysadmin fixed server role exec attach_db "c:\SQL_data"

You rated this post out of 5. Change rating

2003-02-08

313 reads

Technical Article

Correction to "drop/recreate objects" script.

Regarding the recent script I submitted (dropping/recreating all procedures/views) - I made an important oversight. I neglected to add a CASE statement in order to make sure that the appropriate type of object was being referenced in the DROP statement.Below is the corrected script:

(1)

You rated this post out of 5. Change rating

2003-02-06

224 reads

Technical Article

Job Run Duration

This script gives you an idea on how long the processing time is for your SQL jobs. It will depend on how many records are being retained on the sysjobhistory table (scripts defaults to the last 30 days--may not find any history at all).One may find it useful when there are so many sql jobs […]

(10)

You rated this post out of 5. Change rating

2003-02-06

5,868 reads

Technical Article

Drop and re-create all stored procedures or views

There are times when you may need to drop and re-create all stored procedures and/or views in your database.  For example, in cases where procedures or views are causing blocked locks or other performance problems, a recent article (http://www.sswug.org/see.asp?s=1166&id=13448) suggested dropping/re-creating procedures and views after a service pack has been installed.  The installation of a […]

(3)

You rated this post out of 5. Change rating

2003-02-05

1,279 reads

Technical Article

No more orphan users!

I was fed up of manipulating sysusers after restoring a db from one server to another.Just put thgis script on QA after restoring db. It will check all db users (not tested for secure connections) and will restore orphan users. Check it out!Hope this script will help.

(1)

You rated this post out of 5. Change rating

2003-02-03

851 reads

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

940 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

208 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