Scripts

Technical Article

Script to Return Last Weeks Data

I was asked by a customer to create a scheduled weekly report detailing work that had been completed in the previous week (Monday to Friday) I figured they might lose the report or something might happen to stop the scheduler from running it, and I didn't want to have to modify my script to work […]

You rated this post out of 5. Change rating

2003-07-07

140 reads

Technical Article

SUBSTR - SUBSTRING function extension

SUBSTR returns a portion of char, beginning at character @StartPos, @Length characters long. If @StartPos is 0, it is treated as 1. If @StartPos is positive, Oracle counts from the beginning of char to find the first character. If @StartPos is negative, Oracle counts backwards from the end of char.

1 (1)

You rated this post out of 5. Change rating

2003-07-02

258 reads

Technical Article

Adds TIME portion of a DT to the DATE of another

UDF that returns a DATETIME which is the concatination of the TIME portion of one DATETIME and the DATE portion of another.EXAMPLES:DECLARE @Date DATETIME, @Time DATETIMESET @Date = '7/1/03 16:00'SET @Time = '5/16/1999 9:30 AM'PRINT dbo.FN_AddDateTime(@Date,@Time )RETURNS: Jul  1 2003  9:30AMPRINT dbo.FN_AddDateTime(@Date,0)RETURNS: Jul  1 2003 12:00AM

You rated this post out of 5. Change rating

2003-07-01

88 reads

Technical Article

Decimal2Text Measurement Function

This function is based on a script by Tim Dietrich (tim@timdietrich.us) named format_height.sql. His function took what he called a decimal representation of a measurement and formatted it as feet and inches. In reality the input value was just a measurement formatted to look like a decimal number but it was not a true decimal […]

You rated this post out of 5. Change rating

2003-06-27

78 reads

Technical Article

Manage Extended Property

     While we are exploring the possibility to build data-driven application whose GUI are all dynamically generated according to database objects' extended property, we find the system provided procedures: sp_addextendedproperty, sp_dropextendedproperty,sp_updateextendedproperty can add extended property to only one object each time, while fn_listextendedproperty can not let you search objects to display their extended property. […]

You rated this post out of 5. Change rating

2003-06-27

487 reads

Technical Article

Script to backup all databases

A proc which gets a list of all databases (Exluding "excluded" ones) and backs them up.The backup files are stored in the directory \DatabaseName\DatabaseName.bakUNC names are supported provided SQL Server has write access to the location.It deletes backups older than x (Current 3) days.This can be changed.Add a job to execute the script of proc […]

You rated this post out of 5. Change rating

2003-06-26

694 reads

Blogs

A New Word: Ochisia

By

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

Create a Numbers Table in Power Query

By

This is a quick blog post, mainly so I have the code available if...

Microsoft finally adds Tenant Switcher for Fabric / Power BI

By

Praise whatever deity you believe in, because it’s finally here, a tenant switcher for...

Read the latest Blogs

Forums

It's The People

By Grant Fritchey

Comments posted to this topic are about the item It's The People

To View or not to View, that is the question...

By pietlinden

I've read lots of the horror stories about nested views in databases where they're...

Grant user read-write permission to a single database

By PJ_SQL

Hello! How do I grant a user to read-write to a single database and...

Visit the forum

Question of the Day

The Density Vector

When building statistics, there is the concept of density that refers to the duplicates in a table. How is this calculated?

See possible answers