Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in

Articles with tag T-SQL Rss

Search for any content tagged t-sql

<< Newer    Items 21 to 40 of 1202    Older >>

Using the T-SQL PERCENTILE Analytic Functions in SQL Server 2000, 2005 and 2008

Percentiles give meaning to measurements by telling you the percentage of the population being measured who get higher or lower values. They are now easier to calculate in SQL, and are useful for reporting; but are the new analytic functions faster and more efficient than the older methods? Dwain Camps demonstrates, and investigates their relative performance.   Read more...
By Additional Articles 2015/05/27 | Source: SimpleTalk | Category: percent_rank
Rating: (not yet rated)  Rate this |   Briefcase | 6,930 reads

The Cascading (CROSS) APPLY

An old trick nowadays but one which is still underused here on SSC is the cascading CROSS APPLY – where output from one CROSS APPLY is used as input for another.  Read more...
By Chris Morris 2015/05/25 (first published: 2013/04/16) | Source: | Category: t-sql
Rating: |  Discuss |   Briefcase | 20,278 reads

T-SQL Programming Part 14 - Using the TOP Clause with UPDATE, INSERT and DELETE Statements

Learn how to use the TOP clause in conjunction with the UPDATE, INSERT and DELETE statements.  Read more...
By Additional Articles 2015/05/14 | Source: Database Journal | Category: t-sql
Rating: (not yet rated)  Rate this |   Briefcase | 10,716 reads

The Case for Scalar-valued, User-defined Functions in T-SQL

Did you know that scalar-valued, user-defined functions can be used in DEFAULT/CHECK CONSTRAINTs and computed columns? Learn about it...  Read more...
By Dwain Camps 2015/05/12 | Source: | Category: scalar udf
Rating: |  Discuss |   Briefcase | 6,089 reads

Generating A Password in SQL Server with T-SQL from Random Characters

Dallas Snider explains how to use T-SQL to generate a random password that meets an organization's password requirements.  Read more...
By Additional Articles 2015/05/06 | Source: | Category: password
Rating:  Rate this |   Briefcase | 7,231 reads

Time Slots - An Essential Extension to Calendar Tables

After answering many forum entries from developers asking for help with dealing with SQL that involved time intervals and ranges, Dwain dreamed of a generalized tool that sets up time slots of various sorts without the need to experiment; that could do the heavy lifting, so that developers could do aggregations and reports based on time intervals without the hard graft. Here is Dwain's dream made reality.  Read more...
By Additional Articles 2015/05/05 | Source: SimpleTalk | Category: calendar table
Rating:  Rate this |   Briefcase | 7,033 reads

The Elusive Conditional WHERE Clause

What's this, a conditional WHERE clause that doesn't use dynamic SQL?  Read more...
By John Hick 2015/04/17 (first published: 2013/04/18) | Source: | Category: t-sql
Rating: |  Discuss |   Briefcase | 35,329 reads


When I began using LAST_VALUE, the results were not what I expected at all. Read on to learn the secret!  Read more...
By Kathi Kellenberger 2015/04/14 | Source: | Category: t-sql
Rating: |  Discuss |   Briefcase | 16,714 reads

A Hazard of Using the SQL Update Statement

If you've never encountered this quirk of the SQL UPDATE statement, you should take a look and find a simple way around it.  Read more...
By Dwain Camps 2015/04/06 (first published: 2013/09/09) | Source: | Category: t-sql
Rating: |  Discuss |   Briefcase | 26,427 reads

Calculating Duration Using DATETIME Start and End Dates (SQL Spackle)

It's an old problem with a solution that's nearly as old. SQL Server MVP Jeff Moden shows us the old trick mixed with a slick trick to format the duration as extended hours, minutes, seconds, and milliseconds.   Read more...
By Jeff Moden 2015/04/03 (first published: 2014/01/16) | Source: | Category: t-sql
Rating: |  Discuss |   Briefcase | 20,249 reads

Using APPLY to make your queries DRYer

Using the APPLY operator to reduce repetition and make queries DRYer.  Read more...
By Gerald Britton 2015/04/02 | Source: | Category: queries
Rating: |  Discuss |   Briefcase | 14,949 reads

Cumulative sum of previous rows

I had an update statement that took 3 minutes to run after this code change it took 6 seconds.  Read more...
By Ben Kubicek 2015/03/27 (first published: 2014/05/08) | Source: | Category: cumulative
Rating: |  Discuss |   Briefcase | 14,653 reads

Unit Testing with SQL Server

Learn how to begin unit testing with tSQLt and SQL Server.   Read more...
By Alessandro Alpi 2015/03/26 | Source: | Category: unit testing
Rating: |  Discuss |   Briefcase | 6,332 reads

Identifying Start Dates not Aligned with End Dates on a Prior Row

When effective end dates don't align properly with effective start dates for subsequent rows, what are you to do?  Read more...
By Dwain Camps 2015/03/24 | Source: | Category: t-sql
Rating: |  Discuss |   Briefcase | 6,191 reads

Common Mistakes

This week Steve Jones is wondering what the common mistakes that T-SQL developers make are.  Read more...
By Steve Jones 2015/03/20 | Source: | Category: editorial
Rating: (not yet rated) |  Discuss |   Briefcase | 395 reads

The Right and Wrong of T-SQL DML TRIGGERs (SQL Spackle)

Triggers in T-SQL have many uses. There are right and wrong ways to write triggers. To learn the difference, read on...  Read more...
By Dwain Camps 2015/03/17 | Source: | Category: t-sql
Rating: |  Discuss |   Briefcase | 6,611 reads

SQL Server Random Sorted Result Set

In this tip Dallas Snider illustrates how to write a T-SQL query that will return rows sorted randomly.  Read more...
By Additional Articles 2015/03/10 | Source: | Category: t-sql
Rating:  Rate this |   Briefcase | 7,459 reads

How to Design, Build and Test a Dynamic Search Stored Procedure

Learn how to design, build and test a dynamic search SP in just a few simple but methodical steps.  Read more...
By Dwain Camps 2015/03/06 (first published: 2013/11/05) | Source: | Category: t-sql
Rating: |  Discuss |   Briefcase | 19,624 reads

Outer Join – What am I missing (SQL Spackle)

This article shows how to find missing rows in a table using a outer join.   Read more...
By Patrick Cahill 2015/02/27 (first published: 2013/11/12) | Source: | Category: outer joins
Rating: |  Discuss |   Briefcase | 21,282 reads

The Potential of Joins

An article about how we underestimate the power of joins and degrade our query performance by not using proper joins  Read more...
By Ashutosh Pandey 2015/02/26 | Source: | Category: t-sql
Rating: |  Discuss |   Briefcase | 10,197 reads
<< Newer    Items 21 to 40 of 1202    Older >>