SQL Recipes
A FREE cookbook for SQL queries and examples
FAQ Search Today's Posts Mark Forums Read

SQL - Repository This forum is for you to save your favorite SQL queries in a safe place so you will always know where to find them

Go Back   SQL Recipes a FREE cookbook of SQL queries and examples > SQL queries and examples > SQL - Repository

Reply
 
LinkBack Thread Tools Search this Thread
  #1 (permalink)  
Old 09-01-2009, 06:47 AM
ergen ergen is offline
Junior Member
 
Join Date: Jun 2009
Posts: 2
ergen is on a distinguished road
Default Some useful MS SQL functions

Here you can find library of useful MS SQL functions. You are allowed to use the free.

Jacek Szarapa - MS SQL Tips & Tricks - Jacek Szarapa's MS SQL Library Version 1.0.0


String Functions

StringSplitToTable Converts delimited string into a table

StringPadLeft Pads given string with a specified character from left side

StringPadRight Pads given string with a specified character from right side

StringCountOccurrence Counts the occurences of specified string inside another string

DateTime Functions

FirstDayOfTheYear Returns the first day of year for given date

LastDayOfTheYear Returns the lest day of year for given date

FirstDayOfTheMonth Returns the first day of the month for given date

LastDayOfTheMonth Returns the last day of the month for given date

GetDatePart Returns the date part of datetime variable

GetTimePart Returns the time part of datetime variable

GetDayOfWeek Returns the day of week regardless @@DATEFIRST setting

GetCalendarWeekNo Returns the calendar week number regardless @@DATEFIRST setting

EncodeDate Returns the DateTime value of specifed Year, Month and Day

EncodeTime Returns the DateTime value of specifed Hour, Minute and Second

EncodeDateTime Returns the DateTime value of specifed Year, Month, Day, Hour, Minute and Second

ReplaceDatePart Replaces the date part the DateTime variable

ReplaceTimePart Replaces the time part the DateTime variable

DaysInYear Returns the numbers of days in a year of given datetime

DaysInAYear returns the numbers of days in a year

DaysInMonth returns the numbers of days in a month of given datetime

DaysInAMonth returns the numbers of days in a month

Yesterday returns the day before given date

Tomorrow returns the day after given date

IsToday returns if given date is a today's date

IsSameDay returns if given date is the same as the second one

Data Range Functions

GetDigits Returns the table with digits 0..9

GetNumbers100 Returns the table with numbers of given range but within boundaries of 0..100

GetNumbers1000 Returns the table with numbers of given range but within boundaries of 0..1000

GetNumbers10000 Returns the table with numbers of given range but within boundaries of 0..10000

GetNumbers100000 Returns the table with numbers of given range but within boundaries of 0..100000

GetDateRange Returns the table with days of given range but within boundaries of 0..1000 days.
__________________
---------------------------------------
Jacek Szarapa
http://www.jacek-szarapa.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 03:10 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
Copyright (c) 2006-2008 SQL Recipes

1 2 3 4 5 6 7 8