Scripts

Technical Article

Resize data file manually to prevent downtime

This script will resize the data file of a passed in database name and filename by 10%. It can run in 3 modes.Resize, INFO, HELP. RESIZE is passed into parameter @Mode when we know the database name and file we wish to resize. INFO is passed in when we only know the database name and […]

You rated this post out of 5. Change rating

2003-06-19

648 reads

Technical Article

Height Format Function

This function takes a decimal representation of a height value and returns a properly formatted string value.                     For example, a height of 5 feet 9 inches, which would be passed in as the decimal 5.90, would be returned as 5'9".                     Similarly, a height of 4 […]

You rated this post out of 5. Change rating

2003-06-18

1,642 reads

Technical Article

SPLIT function

This is a port of the SPLIT function from Perl (or VBScript). It works the same way: pass a string anda separator, up to 4 characters long (you can change this),and the function returns a table with the elements.This version trims leading and trailling spaces of the elements, just for convenience.Example:SELECT    strvalFROM    master.dbo.SPLIT('a and b', […]

5 (1)

You rated this post out of 5. Change rating

2003-06-13

215 reads

Technical Article

Search all objects in all DBs for code fragments

This procedure allows you to search through all objects in all databases on your server for words/phrases in your object code.  Very handy for cases in which, for example, a column name on a table has been changed and you need to search your entire server for any sprocs/views/etc. that might reference it.Syntax: [EXEC] sp_FindCodeStr […]

You rated this post out of 5. Change rating

2003-06-10

258 reads

Technical Article

detect different datatypes

-  a simple and handy script that finds what differences might exists between the fields in your database that have the same name.I was wondering why my execution plans where different  for tables with the same  field names and the same indexes,statistics etc... because the syetem was converting my fields in the WHERE statement. -  […]

You rated this post out of 5. Change rating

2003-06-08

105 reads

Blogs

Friday Flyway Tips: Chaining Commands for State-based Deployments

By

One of the cool things I’ve seen with the new Flyway CLI is that...

A New Word: Querinous

By

querinous – adj. longing for a sense of certainty in a relationship; wishing there...

How to clear the SSMS cache?

By

How to clear the SSMS cache? If you are reading this,...

Read the latest Blogs

Forums

I need help accessing my local SQLExpress

By Rod at work

My PC has been causing me problems for months. I've told my desktop support...

MDX SSAS Calculated measure for last totals + turnovers

By IvanMarkevich

I have a measure with totals for specific dates with the LastNonEmpty aggregation, and...

display bytea image

By Bruin

I moved a table from MsSql to Postgresql that had a field defined as...

Visit the forum

Question of the Day

SQL in an Azure VM Backup

If I use the Azure Backup service for automated backups of my SQL Servers in Azure VMs, how often can I configure log backups? (as of Dec 2024)

See possible answers