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

   Items 1 to 20 of 1144    Older >>
 

Filling In Missing Values Using the T-SQL Window Frame

Since SQL Server delivered the entire range of window functions, there has been far less justification for using the non-standard ex-Sybase 'Quirky Update' tricks to perform the many permutations of running totals in SQL Server. One of these related problems is the 'Data Smear'. Do window functions make this easier, and what is performance like? Dwain Camps investigates.  Read more...
By Additional Articles 2014/10/01 | Source: SimpleTalk | Category: t-sql
Rating:  Rate this |   Briefcase | 8,746 reads

Hierarchies on Steroids #1: Convert an Adjacency List to Nested Sets

SQL Server MVP Jeff Moden shows us a new very high performance method to convert an "Adjacency List" to “Nested Sets” on a million node hierarchy in less than a minute and 100,000 nodes in just seconds. Not surprisingly, the "steroids" come in a bottle labeled "Tally Table".  Read more...
By Jeff Moden 2014/09/19 (first published: 2012/11/13) | Source: SQLServerCentral.com | Category: hierarchy
Rating: |  Discuss |   Briefcase | 14,787 reads

Splitting Strings Based on Patterns

Splitting strings based on patterns supported by LIKE and PATINDEX can be an interesting way to address a wide variety of problems.  Read more...
By Dwain Camps 2014/09/12 (first published: 2012/11/29) | Source: SQLServerCentral.com | Category: string manipulation
Rating: |  Discuss |   Briefcase | 17,856 reads

New toys in SQL Server 2012

In this article we are going to look two new enhancements: the Insert snippet menu option and the surround with option.  Read more...
By Daniel Calbimonte 2014/09/01 (first published: 2012/05/15) | Source: SQLServerCentral.com | Category: insert
Rating: |  Discuss |   Briefcase | 18,124 reads

Questions about T-SQL Expressions You Were Too Shy to Ask

Nobody seems to ask questions about SQL Expressions in forums, even though expressions can cause all sorts of problems. It's time for some straight-forward Q&As, and who better than Robert Sheldon to give the A?  Read more...
By Additional Articles 2014/08/27 | Source: SimpleTalk | Category: expressions
Rating: (not yet rated)  Rate this |   Briefcase | 11,035 reads

Stairway to T-SQL DML Level 12: Using the MERGE Statement

The final level of this stairway looks at the MERGE statement in detail, focusing on how to perform insert, update and delete logic using the MERGE statement.  Read more...
By Gregory Larsen 2014/08/20 (first published: 2013/01/16) | Source: SQLServerCentral.com | Category: stairway series
Rating: |  Discuss |   Briefcase | 16,721 reads

Finding special characters within character strings

Special Characters can lead to many problems. Identifying and reporting on them can save a lot of headache down the road.  Read more...
By Michael Morin 2014/08/19 | Source: SQLServerCentral.com | Category: special characters
Rating: |  Discuss |   Briefcase | 9,312 reads

How to Handle Calculations Related to fiscal year and quarter

This article describes an easy way to handle calculation based on fiscal year and quarter  Read more...
By Raymond Xie 2014/07/28 | Source: SQLServerCentral.com | Category: fiscal year
Rating: |  Discuss |   Briefcase | 5,718 reads

Exploring Recursive CTEs by Example

Recursive CTEs can be confusing and scary, so examining some non-standard examples may cast light upon these shadowy demons.  Read more...
By Dwain Camps 2014/07/25 (first published: 2012/07/17) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 20,626 reads

Stairway to T-SQL: Beyond The Basics Level 9: Dynamic T-SQL Code

There times when you need to write T-SQL code that creates specific T-SQL Code and executes it. When you do this you are creating dynamic T-SQL code. When writing dynamic T-SQL you need to understand how dynamic code opens the possibilities for a SQL injection attack.  Read more...
By Gregory Larsen 2014/07/23 | Source: SQLServerCentral.com | Category: stairway series
Rating: |  Discuss |   Briefcase | 6,737 reads

Calculating and Verifying Check Digits in T-SQL

A lot of numbers that we use everyday such as Bank Card numbers, Identification numbers, and ISBN codes, have check digits. As part of the routine data cleansing of such codes we must check that the code is valid- but do we? Dwain Camps shows how it can be done in SQL in such a way that it could even be used in a constraint, and keep bad data out of the database.  Read more...
By Additional Articles 2014/07/23 | Source: SimpleTalk | Category: calculation
Rating: (not yet rated)  Rate this |   Briefcase | 11,180 reads

Convert Rows into Columns

Convert the rows of a SELECT statement into a predetermined number of columns.  Read more...
By M Patrick Dillon 2014/07/17 | Source: SQLServerCentral.com | Category: rows to columns
Rating: |  Discuss |   Briefcase | 13,901 reads

Single Quotation Marks in SQL

One of the common problems is dealing with apostrophes in T-SQL. This article examines the challenges of single quotation marks and ends with a short quiz.  Read more...
By Kenneth Fisher 2014/07/11 (first published: 2013/01/03) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 21,741 reads

The "Numbers" or "Tally" Table: What it is and how it replaces a loop

Many people have used a "Numbers" or "Tally" table without really knowing what it does. This is an introduction as to how a Tally table replaces a loop.  Read more...
By Jeff Moden 2014/07/04 (first published: 2008/05/07) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 91,149 reads

Stairway to T-SQL: Beyond The Basics Level 7: Controlling the Flow of Your T-SQL

When you are writing TSQL code there are times when you want to perform the same logic over and over again. To accomplish this you can used the WHILE keyword. There are other times when you want to perform a conditional test and depending on the results of the test you execute one code block for the TRUE condition and possibly a different code block when the condition is FALSE. When you need to conditionally execute code based on the outcome of a condition you can used the IF keyword. In this Stairway level I will be discussing how to use the WHILE and IF constructs to control the flow of your TSQL code.  Read more...
By Gregory Larsen 2014/06/25 | Source: SQLServerCentral.com | Category: stairway series
Rating: |  Discuss |   Briefcase | 6,186 reads

How to Make Scalar UDFs Run Faster (SQL Spackle)

It's a well known fact that Scalar UDFs are the stuff of performance nightmares in T-SQL. But are they really as bad as they say? SQL Server MVP Jeff Moden shows us that they might not really be as big a problem as you might think and what you can do when they actually are.  Read more...
By Jeff Moden 2014/06/24 (first published: 2012/08/01) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 15,088 reads

Find Customers Who Bought "A" and "B" But Not "C" (SQL Spackle)

A simple problem that can become complex in T-SQL. How do you find the rows that match 2 conditions, but not a third, in an efficient manner. MVP Jeff Moden gives us a solution.  Read more...
By Jeff Moden 2014/06/06 (first published: 2012/03/29) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 21,901 reads

T-SQL User-Defined Functions: Ten Questions You Were Too Shy To Ask

SQL Server User-Defined Functions are good to use in most circumstances, but there just a few questions that rarely get asked on the forums. It's a shame, because the answers to them tend to clear up some ingrained misconceptions about functions that can lead to problems, particularly with locking and performance  Read more...
By Additional Articles 2014/06/04 | Source: SimpleTalk | Category: t-sql
Rating: (not yet rated)  Rate this |   Briefcase | 6,175 reads

Cursor-Killing: Retrieving Recently Modified Data

Cursors are considered by many to be the bane of good T-SQL. What are the best ways to avoid iterative T-SQL and to write queries that look and perform beautifully? In the next part of an ongoing series, we look at ways to efficiently retrieve recently modified data.  Read more...
By Edward Pollack 2014/06/02 | Source: SQLServerCentral.com | Category: cursor
Rating: |  Discuss |   Briefcase | 6,262 reads

Cursor-Killing: Accessing Data in the Next Row

Cursors are considered by many to be the bane of good T-SQL. What are the best ways to avoid iterative T-SQL and to write queries that look and perform beautifully? This first part in an ongoing series of cursor-killing handles inter-row analysis.  Read more...
By Edward Pollack 2014/05/27 | Source: SQLServerCentral.com | Category: cte
Rating: |  Discuss |   Briefcase | 11,914 reads
   Items 1 to 20 of 1144    Older >>