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

<< Previous 20    Items 41 to 60 of 1055    Next 20 >>
 

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 2012/11/13 | Source: SQLServerCentral.com | Category: hierarchy
Rating: |  Discuss |   Briefcase | 7,906 reads

Parsing Parameters in a Stored Procedure

This article shows a clean non-looping method to parse comma separated values from a parameter passed to a stored procedure.  Read more...
By Diego Buendía 2012/11/02 (first published: 2010/08/10) | Source: SQLServerCentral.com | Category: array
Rating: |  Discuss |   Briefcase | 27,999 reads

SQL Server Function to return a range of dates

A quick solution is a table function that will create a date range based on the parameters given. Then, you can just join to the results.  Read more...
By Additional Articles 2012/11/02 | Source: MSSQLTips.com | Category: date manipulation
Rating:  Rate this |   Briefcase | 4,070 reads

Stairway to T-SQL DML Level 10: Changing Data with the UPDATE Statement

Unless you are working on a reporting-only application you will probably need to update tables in your SQL Server database. To update rows in a table you use the UPDATE statement. In this level we will be discussing how to find and update records in your database, and discuss the pitfalls you might run into when using the UPDATE statement.   Read more...
By Gregory Larsen 2012/10/10 | Category: stairway series
Rating: |  Discuss |   Briefcase | 5,951 reads

Matrix Math in SQL

Relational Datbases have tables as data structures, not arrays. This makes it tricky and slow to do matrix operations, but it doesn't mean it is impossible to do. Joe gives the Celko Slant on how to go about doing Matrix Math in SQL.  Read more...
By Additional Articles 2012/10/04 | Source: SimpleTalk | Category: t-sql
Rating: (not yet rated)  Rate this |   Briefcase | 3,287 reads

A simple T-SQL statement to create a list of lookup values

In this article, we provide a simple way to get a comma delimited list from a table of entries without having to use a CURSOR or a WHILE loop to read through the table.  Read more...
By Suresh G. Kumar 2012/09/28 (first published: 2011/03/21) | Source: SQLServerCentral.com | Category: cursor
Rating: |  Discuss |   Briefcase | 32,868 reads

Stairway to T-SQL DML Level 11: How to Delete Rows from a Table

You may have data in a database that was inserted into a table by mistake, or you may have data in your tables that is no longer of value. In either case, when you have unwanted data in a table you need a way to remove it. The DELETE statement can be used to eliminate data in a table that is no longer needed. In this article you will see the different ways to use the DELETE statement to identify and remove unwanted data from your SQL Server tables.  Read more...
By Gregory Larsen 2012/09/19 | Category: stairway series
Rating: |  Discuss |   Briefcase | 9,004 reads

Fun with Outer Joins

Learn how an outer join works and how you can use it in your applications to find the results you need when matching data isn't in all your tables.  Read more...
By Kenneth Fisher 2012/09/10 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 10,679 reads

Key Word Searches

This article from Todd Fifield shows a Way to avoid the dreaded LIKE operator in your queries and dramatically speed up keyword searches.  Read more...
By Todd Fifield 2012/09/07 (first published: 2011/02/28) | Source: SQLServerCentral.com | Category: string manipulation
Rating: |  Discuss |   Briefcase | 34,539 reads

Stairway to T-SQL DML Level 9: Adding Records to a table using INSERT Statement

Not all applications are limited to only retrieving data from a database. Your application might need to insert, update or delete data as well. In this article, I will be discussing various ways to insert data into a table using an INSERT statement.  Read more...
By Gregory Larsen 2012/09/05 | Source: SQLServerCentral.com | Category: stairway series
Rating: |  Discuss |   Briefcase | 6,534 reads

The Seven Sins against T-SQL Performance

There are seven common antipatterns in T-SQL coding that make code perform badly, and three good habits which will generally ensure that your code runs fast. If you learn nothing else from this list of great advice from Grant, just keep in mind that you should 'write for the optimizer'.  Read more...
By Additional Articles 2012/08/29 | Source: SimpleTalk | Category: t-sql
Rating: (not yet rated)  Rate this |   Briefcase | 7,150 reads

Stairway to T-SQL DML Level 8: Using the ROLLUP, CUBE and GROUPING SET operator in a GROUP BY Clause

In this article I will be expanding on my discussion of the GROUP BY clause by exploring the ROLLUP, CUBE and GROUPING SETS operators. These additional GROUP BY operators make it is easy to have SQL Server create subtotals, grand totals, a superset of subtotals, as well as multiple aggregate groupings in a single SELECT statement.  Read more...
By Gregory Larsen 2012/08/22 | Category: stairway series
Rating: |  Discuss |   Briefcase | 9,530 reads

Hierarchies in SQL, Part II, the Sequel

In a followup to his first article on Hierarchies, Gus Gwynn takes a look at the performance of a few different methods of querying a hierarchy. Learn how the HierarchyID stacks up.  Read more...
By GSquared 2012/08/21 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 6,980 reads

REPLACE Multiple Spaces with One

Replacing multiple spaces with a single space is an old problem that people use loops, functions, and/or Tally tables for. Here's a set based method from MVP Jeff Moden.  Read more...
By Jeff Moden 2012/08/17 (first published: 2009/11/16) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 42,287 reads

Using DELETE CASCADE Option for Foreign Keys

Referential integrity is a very important thing to consider when designing a database. In my years as a DBA I've seen database designs that sit on both ends of the spectrum, none at all and cases where every table is linked to multiple tables. While the later certainly can be a little more difficult to work with it ensures the integrity of your data stays intact. The other end provides much more flexibility when it comes to updating and deleting data from your database, whether it's being done through the application or directly on the backend, but has the issue of possible orphan records if things are not done properly. This tip will look at the DELETE CASCADE option when creating foreign key constraints and how it helps keep the referential integrity of your database intact.  Read more...
By Additional Articles 2012/08/13 | Source: MSSQLTips.com | Category: t-sql
Rating:  Rate this |   Briefcase | 2,960 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 2012/08/01 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 11,045 reads

Set Up Grouping Intervals for Excel (SQL Spackle)

So you want to group your data for charting in Excel? Here's how, the easy way!  Read more...
By Dwain Camps 2012/07/31 | Source: SQLServerCentral.com | Category: excel
Rating: |  Discuss |   Briefcase | 5,105 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 2012/07/17 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 10,631 reads

Views and Dependencies

Be sure to understand the consequences of modifying underlying tables and the affects they can have on Views  Read more...
By John Reitter 2012/07/10 | Source: SQLServerCentral.com | Category: views
Rating: |  Discuss |   Briefcase | 5,182 reads

T-SQL Integer Data-Type Conversions

This article will show some common integer data-type conversions using T-SQL.  Read more...
By Peter Kierstead 2012/06/26 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 6,807 reads
<< Previous 20    Items 41 to 60 of 1055    Next 20 >>