Scripts

Technical Article

Schema View

Here is a simple view that is useful to pull basic data dictionary information out of your DB user tables. The description field is an extended property that I like to use for built in documentation of fields. This only works with 2000, 7 had a slightly different layout for the system tables.

You rated this post out of 5. Change rating

2004-10-27 (first published: )

336 reads

Technical Article

yet another backup script using litespeed or native backup

Updated! Now supports both SQL Litespeed and native backup commands in one script! Several new bug fixes please see the header of the script. Error messages to add are now at the bottom of the script! This stored procedure will backup a single database or all databases it will also perform ether a full, diff, […]

You rated this post out of 5. Change rating

2004-10-26 (first published: )

990 reads

Technical Article

Yet another restore script usp_restore

usp_restore - This will restore a backup performed with SQL LiteSpeed from DBAssocatesIT or by the standard backup database routines in SQL Server Please check below the declarations to find the user settable options for this script If the target database is currently in a loading status or cannot be read from this restore it […]

You rated this post out of 5. Change rating

2004-10-25 (first published: )

618 reads

Technical Article

Select from x th row next y rows

This code will show rows from 17th and then next 3 ordered by name from table authors in database pubs. Table must have primary key and of course ordered column. You can change value 'from' in line 'SET ROWCOUNT 17' and value 'next' (how many rows)in line SELECT TOP 3. It is good to show […]

You rated this post out of 5. Change rating

2004-10-21 (first published: )

198 reads

Technical Article

Modification to Automate Audit Trigger Generation

This is a modification to Automate Audit Trigger Generation at http://www.sqlservercentral.com/scripts/contributions/1073.asp by walkerjet. The changes were made to accommodate tables using different types for their primary keys, (i.e. int, smallint, char, etc.), add the ModifiedById and DTStamp columns, exclude legacy tables that do not have a primary key defined, exclude fields of type text, ntext, […]

You rated this post out of 5. Change rating

2004-10-19 (first published: )

359 reads

Technical Article

Julian and Gregorian Conversion Functions

After seeing a thread in the forums about converting a Julian date to Gregorian, I decided to write these functions. There are two functions in the script, getJulian and getGregorian. getJulian accepts a datetime parameter and returns the Julian date as an integer. getGregorian accepts an integer and returns the Gregorian date as datetime. A […]

You rated this post out of 5. Change rating

2004-10-18 (first published: )

1,096 reads

Technical Article

From a Delimited String, fetching the nth Value

This User defined Function will provide you the facility of fetching the nth Value from a Delimited string. The Parameter for the function which you have to pass is, the Delimited String, the Delimiter of the string, nth Position of the string. In this function , you can dynamically change the Delimiter as well as […]

You rated this post out of 5. Change rating

2004-10-15 (first published: )

1,436 reads

Technical Article

Automatically Sets Default on Columns

If you set up a default on a column AFTER data has been entered, then this procedure will apply    the default to all NULL values within that column. Limitations:     It only works with numeric values right now.You will also need the INSTR function, which you can also get from this site.This is my first […]

You rated this post out of 5. Change rating

2004-10-13 (first published: )

94 reads

Blogs

Advice I Like: Training Employees

By

Train employees well enough that they could get another job but treat them well...

Creating a Striped Backup Set with AI

By

I needed to test a striped backup, so I decided to ask the AI’s...

SQL Server Migration Overview

By

It’s Not Just Backup / Restore At some point every company faces it: the...

Read the latest Blogs

Forums

Create an HTML Report on the Status of SQL Server Agent Jobs

By Nisarg Upadhyay

Comments posted to this topic are about the item Create an HTML Report on...

hops from sql server to mysql to s4 hana - possible?

By stan

Hi when i think of server hops , i think of how kerberos assists...

Can/Can't Do/Don't

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Can/Can't Do/Don't

Visit the forum

Question of the Day

Strange String Splits

When I run this code, how many rows are returned?

DECLARE @meals NVARCHAR(1000) = N'夕食昼食朝食'
DECLARE @s NVARCHAR(1) = N'食'
SELECT value
FROM STRING_SPLIT(@meals, @s)
GO

See possible answers