Scripts

Technical Article

T-SQL to Export Table Structure to a script

When you want to export a table structure to T-SQL, everyone always points you to Enterprise Manager, or a script that calls BCP.Sometimes, a developer either doesn't have access to those tools, or just doesn't want to use them (like me) out of spite.I made this T-SQL because it was educational, and noone else seems […]

3 (2)

You rated this post out of 5. Change rating

2003-03-26

4,007 reads

Technical Article

DB Reindex all Databases

This script reindexes all tables in all databases.  Execute the script with the desired fill factor and it will do the rest.  There is an option to exclude databases from the reindex. This makes it easy to reindex all newly created databases. Great for the Development environment when Developers are creating database all the time.

You rated this post out of 5. Change rating

2003-03-23

1,946 reads

Technical Article

Jscript to obscure emails from robots in HTML

This script will obscure email addresses from robots even ones that ignore the tags to not snoop. Usually robots that ignore the tags, and the robots.txt file are used by spammers. They pull down the SOURCE of your page and scrape the email addresses from them. This script breaks the mail href into its base […]

You rated this post out of 5. Change rating

2003-03-23

95 reads

Technical Article

Convert Interger to Binary String for Bit Masks

The three functions here can be used to store Bit Masks as Integers.These are functions to convert an integer into a binary string. This can be useful if you store Bit Masks in your database as integers.For example .. '00000000000011111001001001110011' to 1020531Each Bit could represent an ON or OFF value. One integer columncould be equivalent […]

5 (1)

You rated this post out of 5. Change rating

2003-03-21

3,860 reads

Technical Article

Statistic of SQL-Server - Daily Version

A Procedure gather Server Statistic per day or per run this Procedure.Output: Table TBL_SERVERSTATISTICS. You can use the results to analyze SQL-Server performance problems. You can analyze what changed after install new hardware or software, add or remove Application/DB/File/Index/Table etc.Recommendations: Run a Procedure once every day.Warning: If sql-server restarted after last run a Procedurecurrent running […]

You rated this post out of 5. Change rating

2003-03-13

1,046 reads

Technical Article

Weekly Reports Made Easy

Each week you are required to run various reports based on table entries made during the week preceding latest Sunday. Use this SQL7/2000 procedure (can be a UDF in SQL2K) to retrieve the latest midnight of a specified day of the week as illustrated below: Declare @StartDate datetime, @EndDate datetime Exec DBAservice.dbo.uspGetLatestWkDayMidnight @pDate = '1998-05-06', […]

You rated this post out of 5. Change rating

2003-03-13

307 reads

Technical Article

Load Backup History from Backup File

This script creates a stored proc to verify all backups in a media set and load their history into MSDB.  I use this frequently when I get backup files from clients and want to use Enterprise Manager's intelligent restore selection to quickly get the database restored on a test machine. 

You rated this post out of 5. Change rating

2003-03-11

301 reads

Blogs

Using Flyway Prepare for State-Based Deployments

By

One of the neat enhancements made to Flyway was the addition of state-based workflows...

How I Migrated to Azure PostgreSQL Flex from Single Server

By

I did a couple of posts previously on dumping/restoring Azure PostgreSQL databases and also...

Have a Plan for Your Personal Downtime

By

Most of us know that spending a lot of time on social media and...

Read the latest Blogs

Forums

SQL Monitoring tools

By mathewspsimon

our client wants to implement Third Party SQL Monitoring tool to monitor SQL server...

PowerQuery.... don't meet SSIS

By pietlinden

I have a powerQuery that reads and transforms a table in a PDF.  Works...

Count of Total Appointments within 30 days of each Appointment Date

By Reh23

Good Afternoon. I have a Table where each Record: 1) Represents an Appointment. 2)...

Visit the forum

Question of the Day

Hash Joins IV

What is a hash bailout?

See possible answers