T-SQL

Technical Article

Function to calculate Month End Date

  • Script

This function will return you the month-end date. Input parameter may be any date of that month for which you want to calculate month-end.Example:Input: '2-20-2004'      Output: '2-29-2004'Input: '2-15-2004'      Output: '2-29-2004'Input: '3-20-2004'      Output: '3-31-2004'Input: '3-30-2004'      Output: '3-31-2004'

3.2 (5)

You rated this post out of 5. Change rating

2007-05-08 (first published: )

1,314 reads

Technical Article

The NEWSEQUENTIALID Function

  • Article

The NEWSEQUENTIALID system function is an addition to SQL Server 2005. It seeks to bring together, what used to be, conflicting requirements in SQL Server 2000; namely identity-level insert performance and globally unique values.

2007-04-10

2,884 reads

Technical Article

Function Based Index in T-SQL

  • Script

To build function based index in SQL Server, you can use indexed view (materialized view) or using a computed column. In this script, I give an exmaple of how to use the computed column to implement a function based index on a table to search through a free formated telephone number column. The basic step […]

5 (3)

You rated this post out of 5. Change rating

2007-04-10 (first published: )

8,249 reads

Technical Article

Query Hierarchical data Using CTE in T-SQL 2005

  • Script

In response to Sam Stange's "An old and new way to query Hierarchical data", this script uses the new CTE feature of SQL Server 2005 to display the hierarchical data all at once. I have added a check to prevent infinite loop in case there is a loop in the data (actually, there is one […]

3.67 (3)

You rated this post out of 5. Change rating

2007-04-11 (first published: )

1,429 reads

Technical Article

Campare Case Insensitive  CampareCaseInsensitive

  • Script

Case Insensitive Camparison remains a problem for most developers since SQL Server not supports any built in function for these purpose here is one wich compares varchar strings and returns 1 is mathes and 0 other wiseselect dbo.CampareCaseInsensitive('A','a')

You rated this post out of 5. Change rating

2007-03-29 (first published: )

78 reads

Blogs

Friday Basics: the CIA Triad

By

In information security (INFOSEC), there several foundational concepts and principles. One of the ones...

A New Word: the standard blues

By

the standard blues– n. the dispiriting awareness that the twists and turns of your...

How Redgate Flyway Can Boost Your DevOps Journey

By

A brief introduction to the tool and its advantages for database migrations DevOps is...

Read the latest Blogs

Forums

client_app_name is empty in Extended Events output but present in sp_who2

By Pete Bishop

I'm tracing activity on one database and would like to include the client_app_name in...

How to compare data in customer table with other customers to find related cust

By Zond Sita

select Custno, Addr1, City, Res_Phone, Bus_Phone, Fax_Phone, Marine_Phone, Pager_Phone, Other_Phone, email1, email2 from customer...

process records in loop

By Bruin

I'm only processing 50,000 records not everything from the Table where there are 250,00...

Visit the forum

Question of the Day

The Marked Transaction

I want to mark a transaction in the log as a recovery point. How do I do this in my code if I use the transaction, myTran?

See possible answers