Scripts

Technical Article

sp_dba_spacealert_dmo.vbs

This vbscript is used to alert and email receipients on Filegroup space usageOuput:  '% Space Avail. , Space Avail. Filesize, MaxSize, FileName, DBname, FileGroupThe process takes three arguments - SqlserverName , Threshold for percentage of available space to check ,Mininum MaxFileSize to checkExecute the script either from the command line or schedule the script via […]

You rated this post out of 5. Change rating

2003-08-01

339 reads

Technical Article

Display Database, File, Free and Total Disk Space

This script displays the size of each SQL Server database and database file plus the size of the next extension that will be added to each file. It also displays on each line the total and remaining free disk space for whichever disk each database file is stored on.The output is nothing fancy, and could […]

1 (1)

You rated this post out of 5. Change rating

2003-07-30

1,310 reads

Technical Article

Pad Number

A simple UDF for padding out numbers with a specific character (eg: pad 3 to show as 003).Usefull when you can only sort as a text item or for formatting purposes.Script is similar to the SPACE() function but allow the padding character to be defined.Usage:dbo.padNumber('string to pad', padsize, padchar)eg:SELECT dbo.padNumber('53', 4, '0') as testNumReturns:testNum-------0053

You rated this post out of 5. Change rating

2003-07-25

200 reads

Technical Article

Zip Code Radius Search

Enter the starting zip code and the number of miles for a radius search and the SP will return all the zip codes within the number of miles specified.The data file can be found at http://www.census.gov/tiger/tms/gazetteer/zips.txtThe record layout van be found at http://www.census.gov/tiger/tms/gazetteer/zip90r.txt

You rated this post out of 5. Change rating

2003-07-24

2,414 reads

Technical Article

Generic paged data like MySQL LIMIT

This works, however code is creating a live temp_1 table in the database instead of using a #temp_1 temporary table because is just would not work.The next idea I had was to use a unique table name per connection for temp_1, but I would really rather use temporary tables.I am hoping some SQL guru's can […]

You rated this post out of 5. Change rating

2003-07-22

122 reads

Technical Article

An alternative to self-joins

Oftentimes there is a need to retrieve different types of the same object (e.g. contacts).  For example, in a Contacts database, you might have a Contact table containing many different types of contacts (employees, customers, suppliers, etc).  Typically, a user might need to see a report of all different types of contacts for an order […]

You rated this post out of 5. Change rating

2003-07-18

745 reads

Technical Article

Check if someone use a database or not

I manage quite a few hundred databases across the company. Time to time I get a question if I can check wheather a database is beeing used or not, and if it is, by whom?There are probably a 1000 ways to do this, but I've created a script for creating a scheduled job that runs […]

You rated this post out of 5. Change rating

2003-07-15

2,652 reads

Technical Article

Group numbering

An easy way to organize the data by groups of sequential numbers. This is very helpful for splitting up a large file into numerous smaller files. You can then create the smaller files by filtering for the row number per file.

You rated this post out of 5. Change rating

2003-07-09

220 reads

Blogs

Azure SQL offerings

By

There are three Azure SQL products with so many different deployment options, service tiers,...

T-SQL Tuesday #183 Roundup

By

I hosted this month’s T-SQL Tuesday party with my invitation asking about tracking permissions....

A Little Brainstorming with an AI

By

I was asked to do some a little thinking and brainstorming recently. Rather than...

Read the latest Blogs

Forums

MEMORYBROKER_FOR_RESERVE experience

By tony28

Hi, Does anyone have experience with MEMORYBROKER_FOR_RESERVE ? when suddenly there is somehow constantly...

Moving Database Files

By Ahr Aitch

I just learned that my database was created on my C:\ drive in the...

Migrate MSSQL to MYSQL - Different Servers

By cajun_sql

I am needing to migrate a MSSQL db to MySQL, on a different server...

Visit the forum

Question of the Day

Mixed Backups

I have a complex database with a few filegroups and files. Can I run a backup command like this? (assume file/filegroup names are valid).

BACKUP DATABASE [complex]
    FILE = N'thirdone'
 ,  FILE = N'thirdtwo'
 ,  FILEGROUP = N'second' 
 TO  DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL16.SQL2022\MSSQL\Backup\complex.bak' 
 WITH NOFORMAT, NOINIT,  NAME = N'complex-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
GO

See possible answers