Scripts

Technical Article

Truncating and deleting all tables in a database

Sometimes, during test stage, you may need to truncate or delete all your tables in a database, without droping constraints, truncating and recreating constraints (DRI). You can use the TRUNCATE TABLE statement to removes all rows from a table without logging the individual row deletes, but tables referenced by a FOREIGN KEY constraint can not […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

(3)

You rated this post out of 5. Change rating

2002-04-17

1,601 reads

Technical Article

Copying Data from one Database to Another

This script will be helpful to only those people who arehaving identical database with different names.This script can be used to copy single or multiple tables from one database to anotherThe parameters @tname , source database and target database are important for the script to work. In the script below I have considered two databases […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

(1)

You rated this post out of 5. Change rating

2002-04-16

1,623 reads

Technical Article

Get users permissions with mapping thru role.

This procedure is similar to sp_helpprotect except to extends a bit on the concept with roles involved. If for instance a user has right on a TableX but they are not mapped directly to the user but instead to a role then sp_helpprotect does not tell you this. This will tell you how the user […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2002-04-16

1,735 reads

Technical Article

List of triggers in a database

Give the following information, about triggers in the database.Parent_Name      Parent_Type Name                         Type               Insert Update Delete IsFirstInsertTrigger IsFirstUpdateTrigger IsFirstDeleteTrigger IsLastInsertTrigger IsLastUpdateTrigger IsLastDeleteTrigger

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

(2)

You rated this post out of 5. Change rating

2002-04-16

860 reads

Technical Article

Preventing accidental overwrites with update SPs

Say you wanted to create an SP for updating records in a database.  How would you do this in such a way as to allow your users to edit only a subset of fields in the record, without overwriting the other fields, and without requiring verbose IF blocks and CASE statements in your code?Simple.  Use […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2002-04-16

235 reads

Technical Article

Converting money to the word value.

With this script you can supply an money value such as $12525.83 and it will return the word value "Twelve Thousand Five Hundred And Twenty-Five Dollars And Eighty-Three Cents".It is comprised of a table for Number to Name and a procedure to parse into it's piecesNOTE: This only goes to billions at this point, but […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2002-04-11

449 reads

Technical Article

How to get last restore date and orginal DBName.

This script will output the Orignal DB Name, Destination DB Name and Last Restore date for the databases. You get a specific database just add a where clause against the appropriate field. It makes use of the restorehistory and backupset tables in the MSDB database.

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

(6)

You rated this post out of 5. Change rating

2002-04-11

2,597 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

Alamat BCA KCP Percetakan Negara Telp:08218520153

By layanan_Bca88

WhatsApp CS 628218520153 Jl. Percetakan Negara No.223 C, RT.3/RW.5, Rawasari, Kec. Cemp. Putih, Kota...

Alamat BCA KCP Gondangdia Lama Telp:08218520153

By R4nt4u

WhatsApp CS 628218520153 Jl. RP. Soeroso No.25, RT.9/RW.5, Cikini, Kec. Menteng, Kota Jakarta Pusat,...

Alamat Kantor BCA KCP Alaydrus Telp:08218520153

By m4rt1n4

WhatsApp CS 628218520153 Jl. Alaydrus No.47 & 47 A, RT.8/RW.2, Petojo Utara, Kecamatan Gambir,...

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