Scripts

Technical Article

ScriptToFindWhichTablesBelongToWhichFileGroups

If we give SP_HELP , we'll know to which File Group the table belongs.If we give SP_HELPFILEGROUP , we'll know the logical and physical file names along with other information that belong to the given File Group. But have you ever tried that, given a file group, how to find all the tables that belong […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2004-05-10

151 reads

Technical Article

Modified sp_who - more info & extra parameter

This procedure, sp_who3, is based on the system-supplied sp_who2, but is modified to return the actual text of the commands executed by each spid.  Very helpful for troubleshooting!  In addition, I have added a @hostname parameter to allow the user the option of viewing activity originating from only one computer, if desired.

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2004-05-06

683 reads

Technical Article

IsWorkday UDF without a table

While the other methods for calculating holidays ect use a table to store the holidays, this inline UDF goes the opposite route, by returning 1 if the given date is a weekday that also does not fall on a number of holidays.  Examples shown allow for easy extension to other holidays as deemed necessary.

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2004-05-02

212 reads

Technical Article

Send mail from  SQL Server using Jmail

For greater information of this tool can obtain it inhttp://www.dimac.net/Mail in format HTML or TEXT can be sent can be sent attached archives. It is a tool to send and to receive electronic mail from any PC or SERVER without the use of a program of mail or a mail server as Eudora, Exchange or […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2004-04-20

1,430 reads

Technical Article

Backup all Databases Using SQL LiteSpeed

This script backs up all databases or a specified database to a disk location. Databases can be explicitly excluded from backup as well.  Can be used for Full, Differential or Transaction Log Backups.  Can also dynamically create sub directories for each database, as well as perform DBCC and restore verify operations.  Includes LiteSpeed support for […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2004-04-15

1,514 reads

Technical Article

Get all Tables and Columns for each Database

This script will get the name of each database from master..sysdatabases, then use each database's Information Schemata to get the tables and columns in each of the databases. Several recent requests for assistance have used this to answer their needs. I ran it across 245 databases and pulled back 1.4 million results in about 30 […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

(1)

You rated this post out of 5. Change rating

2004-04-15

1,350 reads

Technical Article

Script and Export (via BCP) SQL Tables

Script via OLE Automation and Export via BCP.  Check for existance of object, checks count of table with count of exported file (reads BCP output).  Will do DBCC UPDATEUSAGE if at first the SQL record count does not match BCP count.  Full options for scripting (with w/o indexes, Referential integrity, etc).  REQUIRES ADMIN ACCESS - […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

(2)

You rated this post out of 5. Change rating

2004-04-15

2,535 reads

Blogs

10 Decisions to Make Before You Create A Fabric Workspace

By

Creating a Fabric workspace takes about 30 seconds. Restructuring workspaces after people have built...

Flyway Tips: Object History

By

It’s a small change, but a handy one. Flyway Desktop (FWD) now includes the...

Car Update September 2026

By

Software is hard. While I love our Lucid Gravity, I realize that they are...

Read the latest Blogs

Forums

Alamat BCA KCP Cempaka Putih Telp:08218520153

By layanan_Bca88

WhatsApp CS 628218520153 Jl. Letjen Suprapto No.30 EF, RT.7/RW.2, Harapan Mulya, Kec. Kemayoran, Kota...

Alamat BCA KCP Menteng Telp:08218520153

By m4rt1n4

WhatsApp CS 628218520153 Jl. HOS. Cokroaminoto No.83, RT.3/RW.5, Menteng, Kec. Menteng, Kota Jakarta Pusat,...

Alamat BCA KCP Wahid Hasyim Telp:08218520153

By R4nt4u

WhatsApp CS 628218520153 Jl. K.H. Wahid Hasyim No.82, RT.15/RW.3, Kb. Sirih, Kec. Menteng, Kota...

Visit the forum

Question of the Day

Adding new column with DEFAULT II

Which number did the two COUNT(*) return:

DROP TABLE IF EXISTS #tmp
CREATE TABLE #tmp (id INT NOT NULL)

INSERT INTO #tmp (id) 
SELECT gs.value
  FROM GENERATE_SERIES(1, 5) AS gs

ALTER TABLE #tmp ADD my_value INT NOT NULL CONSTRAINT df_tmp_my_value DEFAULT 1

SELECT COUNT(*)  FROM #tmp AS t WHERE my_value = 1

ALTER TABLE #tmp DROP CONSTRAINT df_tmp_my_value

ALTER TABLE #tmp ADD CONSTRAINT df_tmp_my_value DEFAULT 2 FOR my_value

SELECT COUNT(*)  FROM #tmp AS t WHERE my_value = 1

See possible answers