Scripts

Technical Article

Server Backup History Report (updated 2006-04-11)

Server Backup History Report (Full DB Backups only) 1. lists all databases with no backup history 2. lists last backup for other databases includes Date, User, Size, Duration, Age, Finish Date & Location Includes system databases Excludes TempDB Excludes backup history data where backupmediafamily.device_type = 7 these are typically created by Veritas BackupExec Tested on […]

4.67 (3)

You rated this post out of 5. Change rating

2006-04-28 (first published: )

4,583 reads

Technical Article

Update a table column with a sequence number v3

Both Sachinvaishnav and Mark Chad have submitted scripts to populate a column with a sequence number. The first solution uses a cursor; the second uses the SQL 2005 ROW_NUMBER() function.v1:http://www.sqlservercentral.com/scripts/viewscript.asp?scriptid=1643v2:http://www.sqlservercentral.com/scripts/viewscript.asp?scriptid=1664Since neither script requires a specific order for the sequence number, the same result can be achieved with a single UPDATE statement.

You rated this post out of 5. Change rating

2006-04-26 (first published: )

383 reads

Technical Article

Determine Distance Between Any Two Locations

This function allows you to calculate the distance in miles or kilometers between any two points on the earth. I created to calculate the distance between two zip codes but is can be used for any two coordinates for which latitude and longitude is known.NOTE: A database for the coordinates of any US postal code […]

5 (4)

You rated this post out of 5. Change rating

2006-04-25 (first published: )

1,257 reads

Technical Article

script to create default stored procs

The following script will write basic update insert and delete stored procedures for a given table.It will add comments to the sp's with the autyhors name and also script a single grant statement for a given database user.I find this script extremely useful for both rad development and keeping consistency in my naming and structure […]

5 (2)

You rated this post out of 5. Change rating

2006-04-21 (first published: )

543 reads

Technical Article

All Object Security Grant

-- PROCEDURE GRANTS PERMISSION TO A GIVEN SQL USER-- TO ALL OBJECTS WITHIN A GIVEN CATALOG CONTEXT-- STORED PROCEDURES, VIEWS, TABLES, SELECT FUNCTIONS, EXECUTE FUNCTIONS-- MODIFY AS REQUESTED-- SAMPLE EXECUTE -- EXECUTE sp_All_Object_Security_Grant 'WUA'

You rated this post out of 5. Change rating

2006-04-20 (first published: )

206 reads

Technical Article

Script to split a comma seperated string to table

Requirement:Multiple Customers were selected from a interface created in VB. A stored procedure was created which accepts the customer codes as a parameter in the form of 100,200,300,400. Wanted to fetch the information for only those customers selected. Ideally we will have to create a dynamic SQL which would be somewhat like this Set @StrSQL […]

You rated this post out of 5. Change rating

2006-04-19 (first published: )

380 reads

Technical Article

Script to find a particular string in procs/func.

Requirement:I added a parameter to an existing user defined function. This user-defined function was used in many procedures across system. Whenever a parameter is added to a user defined function, then we will have to change the calling of the function and pass the value for the new parameter added. Even though the parameter is […]

You rated this post out of 5. Change rating

2006-04-18 (first published: )

92 reads

Blogs

SQL Server Quickie #48 – Azure SQL Managed Instance

By

Today I have uploaded SQL Server Quickie #48 to YouTube. This time I’m talking...

Spark Connect Dotnet November 2024 Where are we?

By

All Spark Connect Posts Introduction There have been quite a few changes in the last...

A New Word: Ochisia

By

ochisia – n. the fear that the role you once occupied in someone’s life...

Read the latest Blogs

Forums

Export database and tables no table data

By HeftSteady

Trying to move a database from one sql server instance to another on separate...

Package to Project model conversion

By blom0344

Hi All, With previous customer range we were always required to work in the...

Issue with DBMail

By richardmgreen1

Hi all   We've got 3 servers with the same setup for dbmail. They...

Visit the forum

Question of the Day

What's the Ceiling?

What do I get as the results from this code?

SELECT CEILING (999.999), CEILING (-999.999);

See possible answers