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 1192    Older >>
 

Is It Worth Writing Unit Tests?

What's the overhead for writing unit tests? Ed Elliot breaks it down, looking at the ways in which unit tests both take more time and save time.  Read more...
By Ed Elliott 2015/07/23 | Source: SQLServerCentral.com | Category: unit testing
Rating: |  Discuss |   Briefcase | 5,327 reads

How to Get NULLs Horribly Wrong in SQL Server

NULLs in SQL are a mixed blessing. The Three-Valued Logic of SQL has its uses but can cause difficulties to anyone who assumes that NULL has a 'value'. It can make reports go horribly wrong in a number of alarming ways, as Robert Sheldon explains.  Read more...
By Additional Articles 2015/07/14 | Source: SimpleTalk | Category: t-sql
Rating:  Rate this |   Briefcase | 8,068 reads

A simple trick for “Block Comment” syntax in SSMS

Make your comment blocks much more useful, in a surprising number of ways  Read more...
By Peter Zerk 2015/07/10 (first published: 2013/07/08) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 19,915 reads

Using a Recursive CTE to Generate a List

Learn how to generate lists of column values from multiple rows by grouping and using a recursive CTE. This is a very flexible and easy implementation, compared to using cursors or PIVOT operators.  Read more...
By Svetlana Marinova 2015/06/26 (first published: 2013/07/09) | Source: SQLServerCentral.com | Category: recursive cte
Rating: |  Discuss |   Briefcase | 20,968 reads

Writing Better T-SQL: Top-Down Design May Not be the Best Choice – Part II

A second part to the series by Mickey Stuewe on writing better T-SQL looks at some of the issues of using views in a complex query.  Read more...
By Mickey Stuewe 2015/06/23 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 7,871 reads

Reusing T-SQL Code

Alex Kuznetsov, in an article taken from his book 'Defensive Database Programming with SQL Server', shows how DRY principles can be put in practice with constraints, stored procedures, triggers, UDFs and indexes.  Read more...
By Additional Articles 2015/06/10 | Source: SimpleTalk | Category: t-sql
Rating: (not yet rated)  Rate this |   Briefcase | 5,229 reads

Query Performance Tuning – A Methodical Approach

Learn how to approach performance tuning in this piece from SQL Server MCM and MVP, Gail Shaw.  Read more...
By Gail Shaw 2015/06/08 | Source: SQLServerCentral.com | Category: performance and tuning
Rating: |  Discuss |   Briefcase | 10,169 reads

Demystifying the use of CASE in an ORDER BY statement

Chuck Hoffman exposes the mysteries of getting CASE statements to work in dynamic ORDER BY statements.  Read more...
By Chuck Hoffman 2015/06/05 (first published: 2012/04/26) | Source: SQLServerCentral.com | Category: case
Rating: |  Discuss |   Briefcase | 25,223 reads

Writing Better T-SQL: Top-Down Design May Not be the Best Choice

One of the best ways in which you can build better applications is by learning to write better T-SQL. Mickey Stuewe begins a new series showing how you might start to think about writing queries.  Read more...
By Mickey Stuewe 2015/06/02 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 11,530 reads

A Case FOR Cursors...

We've all heard that definitive statement: "Avoid using cursors." But, in my opinion, what really should be conveyed is: "Avoid using row-by-row operations when possible."  Read more...
By Chris Jones 2015/06/01 | Source: SQLServerCentral.com | Category: cursors
Rating: |  Discuss |   Briefcase | 9,189 reads

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,722 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: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 19,593 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,496 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: SQLServerCentral.com | Category: scalar udf
Rating: |  Discuss |   Briefcase | 5,935 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: MSSQLTips.com | Category: password
Rating:  Rate this |   Briefcase | 7,023 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 | 6,940 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: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 35,043 reads

Using LAST_VALUE

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: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 15,913 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: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 26,361 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: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 20,083 reads
   Items 1 to 20 of 1192    Older >>