Scripts

Technical Article

Finding Procedures with a specified text

This script will give the text of all the procedures with occurences of a specifc variable. Syscomments has a limitation of 4000 characters but this script overcomes that as it uses DMO. The output is generated in a text file. If you want the name of the procedure only. replace the line where it says […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2005-03-03 (first published: )

195 reads

Technical Article

Set Extended Properties for Every Table

Extended properties are a neat feature in SQL Server 2000 that let you set meta data for an individual object. This stored procedure is a baseline sproc that lets you set the properties of every object in a DB to a given value. For example, if you baseline your database at 1.5.0, you can set […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2005-03-02 (first published: )

215 reads

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,018 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: )

136 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: )

556 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: )

315 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: )

210 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: )

308 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,052 reads

Blogs

Keeping Track of my ConEmu CLIs

By

I use ConEmu for my terminal interface. I’m still on Windows 10 at home,...

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...

Read the latest Blogs

Forums

Alamat BCA KCP Abdul Muis Telp/Wa:08218520154

By layanan_Bca88

Alamat: Gedung Graha Motor City, Jl. Abdul Muis No.24-26 Level I Suite 101, RT.2/RW.8,...

Alamat BCA KCP Sabang Telp/Wa:08218520154

By R4nt4u

Alamat: Jl. H. Agus Salim No.57 B, RT.3/RW.1, Kb. Sirih, Kec. Menteng, Kota Jakarta...

Alamat BCA KCP Kebon Sirih Telp/Wa:08218520154

By m4rt1n4

Alamat: Plaza Pupuk Kaltim, Jl. Kebon Sirih No.6A Gedung B Lantai 1, RT.14/RW.2, Gambir,...

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