SQL Clone
SQLServerCentral is supported by Redgate
 
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 1325    Older >>
 

Using T-SQL to Detect Stock Price Reversals with the RSI

Rick Dobson explains the Relative Strength Index (RSI), and shows how to create a TSQL script that computes the RSI for a stock closing price series.  Read more...
By Additional Articles 2018/04/16 | Source: MSSQLTips.com | Category: t-sql
Rating: (not yet rated)  Rate this |   Briefcase | 2,997 reads

TRIM() in T-SQL

The T-SQL language expanded in SQL Server 2017 with the TRIM() function.  Read more...
By Steve Jones 2018/04/10 | Source: SQLServerCentral.com | Category: trim()
Rating: |  Discuss |   Briefcase | 1,886 reads

Avoiding Unexpected Results with DATEDIFF in Year Comparisons

Learn how to avoid unexpected results when using the DATEDIFF function to find the difference between two dates in years.  Read more...
By David Strack 2018/04/09 | Source: SQLServerCentral.com | Category: sql server
Rating: |  Discuss |   Briefcase | 1,341 reads

Storing a variable with a SELECT, and why it didn't work.

Using SELECT to store values into variables is an important technique, but you need to know some of the gotchas as well.  Read more...
By Kenneth Fisher 2018/04/02 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 1,811 reads

When to use the SELECT…INTO statement

SELECT…INTO is a good way of making a table-source temporarily persistent as part of a process, if you don’t care about constraints, indexes or special columns.  Read more...
By 2018/03/30 | Source: Redgate | Category: t-sql
Rating: (not yet rated)  Rate this |   Briefcase | 5,579 reads

Get Set For Speed

Loops are common in application code, but set-based solutions are the way to go with SQL.  Read more...
By Tom Staab 2018/02/23 (first published: 2015/12/29) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 6,147 reads

The COUNT Function in T-SQL

The COUNT function is among the most used functions in the T-SQL codes. Even though COUNT is easy to use, it should be used carefully because it could often not return the desired result. For the big tables, the counting of the rows could cause blocking as well as take some more time.  Read more...
By Igor Micev 2018/02/09 (first published: 2016/07/12) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 7,175 reads

Sending table form HTML emails from a SQL Server database engine

The solution which helps to smiplify delivery of a table content in the HTML form using Database mail  Read more...
By Evgeny Garaev 2018/01/29 | Source: SQLServerCentral.com | Category: database mail
Rating: |  Discuss |   Briefcase | 1,586 reads

Nasty Fast PERCENT_RANK

Alan Burstein discusses a better performning alternative to PERCENT_RANK that works on SQL Server versions 2005+  Read more...
By Alan Burstein 2018/01/05 (first published: 2016/06/07) | Source: SQLServerCentral.com | Category: percent_rank
Rating: |  Discuss |   Briefcase | 5,189 reads

Securing Reporting Services Reports

Learn how you can get the userid of someone connected to Reporting Services and use that information to determine if they can view the report.  Read more...
By Mohamed Idttalbe 2017/12/22 (first published: 2010/05/18) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 7,938 reads

Holidays and Calendar Generation

Create the definition of your holidays and have them available for any year. Create a Calendar including holidays and business/work dates.  Read more...
By Paul Hunter 2017/12/15 (first published: 2016/02/16) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 4,683 reads

Bones of SQL – Grouping By User-Defined Calendar Periods

Although it is common to group by periods such as Week, Month, or Quarter, sometimes alternative periods are needed. This simple technique lets you split a year into periods with any number of days.  Read more...
By Bob Hovious 2017/12/08 (first published: 2016/09/26) | Source: SQLServerCentral.com | Category: date manipulation
Rating: |  Discuss |   Briefcase | 2,470 reads

Bones of SQL - Practical Calendar Queries

After the first article created a Calendar table, learn how to use this in a practical sense with some common queries.  Read more...
By Bob Hovious 2017/12/01 (first published: 2016/10/13) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 3,384 reads

The Difference Between Rollup and Cube

Learn about the fundamental differences between the ROLLUP and CUBE operators.  Read more...
By Ben Richardson 2017/11/30 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 1,567 reads

Name Value Pairs Table Handling

While Name Value Pairs Tables are anathema to Relational Database professionals, it is sometimes useful to consider such a structure in a production application. This article illustrates the use of User-defined Table Type to improve such handling.  Read more...
By Jerome Boyer 2017/11/06 | Source: SQLServerCentral.com | Category: user-defined table type
Rating: |  Discuss |   Briefcase | 1,377 reads

Core T-SQL

Steve Jones thinks there is a list of core skills that any database developer or DBA needs. This week he asks you for a list of those things you think should be included.  Read more...
By Steve Jones 2017/11/03 | Source: SQLServerCentral.com | Category: editorial
Rating: |  Discuss |   Briefcase | 737 reads

Parse Data from a Field Containing Multiple Values using CROSS APPLY

It is possible for a field in a character-delimited text file to contain a list of further-delimited values instead of the customary single value. This article demonstrates how to load such a file into a staging table, then use a CROSS APPLY query to parse the list of values into a related table.  Read more...
By Stan Kulp 2017/10/30 | Source: SQLServerCentral.com | Category: integration services (ssis)
Rating: |  Discuss |   Briefcase | 1,719 reads

Simple SQL: Random Thoughts

How does one get a truly random sample of data of a certain size from a SQL Server database table. Well, there are simple non-portable tricks one can use, such as the NewID() function, but then refining those can be tricky. Take the Rand() function for a start. Can it really provide you with a truly random number? Why doesn't the TABLESAMPLE clause give you a set number of rows? Joe Celko scratches his head a bit, explains some of the issues and invites some suggestions and tricks from readers.  Read more...
By Additional Articles 2017/10/19 | Source: SimpleTalk | Category: t-sql
Rating: (not yet rated)  Rate this |   Briefcase | 3,565 reads

The Basics of Good T-SQL Coding Style – Part 4: Performance

There are several obvious problems with poor SQL Coding habits. It can make code difficult to maintain, or can confuse your team colleagues. It can make refactoring a chore or make testing difficult. The most serious problem is poor performance. You can write SQL that looks beautiful but performs sluggishly, or interferes with other threads. A busy database developer adopts good habits so as to avoid staring at execution plans. Rob Sheldon gives some examples.  Read more...
By Additional Articles 2017/10/05 | Source: SimpleTalk | Category: t-sql
Rating: (not yet rated)  Rate this |   Briefcase | 5,949 reads

When sp_HelpText is not so helpful!

A note of caution on the use of sp_helptext to script out objects.  Read more...
By Andy Robertson 2017/09/25 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 1,166 reads
<< Newer    Items 21 to 40 of 1325    Older >>