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

Scripts with tag t-sql Rss

Search for any content tagged t-sql

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Add a script

   Items 1 to 20 of 890    Older >>

Dynamic Table Name on Select Into

Based upon todays date as suffix and chosen string as prefix, select data from predefined table into dynamically named new table. Script is properly error handled with most common errors  Read more...
By Jo Dacey 2015/05/04 | Source: | Category: t-sql
Rating: (not yet rated) |  Discuss |   Briefcase | 8 reads

Stupid Coding Tricks: The T-SQL Mandelbrot

The bar for entry into CodeSOD is pretty straight forward: professionally-developed code that elicits that certain What The— reaction. Though there have been a few exceptions over the years, generally speaking, student code, hobbyist code, and amateur code need not apply. That said, I'd like to try something a little different today. Today's example is not technically professionally-developed, it's a Stupid Coding Trick. "So I was bored at work one day," Graeme Job explains, "and wondered, what's the most useless thing I could do with my time without actually doing anything. Then it hit me. I could use T-SQL to generate... Mandelbrot." Graeme continued, "Following is a single T-SQL SELECT statement that generates a text-representation of a Mandelbrot Set. The results are best viewed in text-mode."  Read more...
By gogulatorul 2015/01/20 | Source: | Category: humor
Rating: |  Discuss |   Briefcase | 2,665 reads


Removes characters in the a string (@string) that matches a specific pattern (updated 12-3-14)  Read more...
By Alan Burstein 2014/12/26 | Source: | Category: t-sql
Rating: |  Discuss |   Briefcase | 1,339 reads

Get month days

Gets the number of days in a month 
By Igor Micev 2014/11/10 | Source: | Category: t-sql
Rating: |  Discuss |   Briefcase | 1,146 reads

Find only characters or only integer from alphanumeric value

Extract only integers or characters from alphanumeric : 
By Vimal Lohani 2014/10/07 | Source: | Category: t-sql
Rating: |  Discuss |   Briefcase | 1,391 reads

Sudoku Generator/Solver

TSQL Sudoku generator and solver. 
By Matthew Faye 2014/09/17 | Source: | Category: game
Rating: |  Discuss |   Briefcase | 1,879 reads

Calculate gregorian easter sunday using a table valued function

Calculate gregorian easter sunday using a table valued function.  Read more...
By Robin Langell 2014/09/03 | Source: | Category: easter sunday
Rating: |  Discuss |   Briefcase | 627 reads

Paginating a SQL query result set

How to Paginate a query result set to keep from pulling the whole result set to the client side   Read more...
By Greg Ryan 2014/06/09 | Source: | Category: t-sql
Rating: |  Discuss |   Briefcase | 2,067 reads

Count all records the tables

Count all the records from the tables that exist in a database  Read more...
Rating: |  Discuss |   Briefcase | 1,807 reads

Search objects in Database

Use this script to search objects in a Database. Also used to check a tables column types and details when no model is accessible. Replace <DATABASENAME> for database name.  Read more...
By bpimenta 2014/04/16 | Source: | Category: t-sql
Rating: |  Discuss |   Briefcase | 1,349 reads

Script to Get the Database size in GB's

Script to Get the database file size in GB  Read more...
By sathish NS 2015/03/25 | Source: | Category: t-sql
Rating: |  Discuss |   Briefcase | 1,596 reads

Use HASHBYTES to identify changes

Use a hash to identify changes and process just the changed rows.  Read more...
By Jim Youmans 2013/11/25 | Source: | Category: t-sql
Rating: |  Discuss |   Briefcase | 1,905 reads

Split and concatenate function

Function for splitting the values in string, applying logic and concatenating back to string.  Read more...
Rating: |  Discuss |   Briefcase | 1,682 reads

Display the SELECT statement for any table

Found this lovely T-SQL script to display the SELECT statement for any table.  Read more...
By Mehernosh 2013/08/22 | Source: | Category: select query
Rating: |  Discuss |   Briefcase | 3,121 reads

Simplest way to search any string in db objects

Easiest way to search for a string in any object within the database.  Read more...
By Kshitij Satpute 2013/08/08 | Source: | Category: t-sql
Rating: |  Discuss |   Briefcase | 2,201 reads

Fastest way to find DB object dependencies

One of the fastest ways to find out objects dependencies in SQL Server.  Read more...
By Kshitij Satpute 2015/04/07 | Source: | Category: dependencies
Rating: |  Discuss |   Briefcase | 3,029 reads

Fastest way to split delimited string in SQL Server

Getting rid of R-BAR to split a delimited string. This method is popular for it's simplicity, speed and zero reads.  Read more...
By Kshitij Satpute 2015/03/17 | Source: | Category: split string
Rating: |  Discuss |   Briefcase | 4,401 reads

Simple and efficient way to split string with seperator

Split a string with separator without looping. Can be efficiently used with joins if necessary.  Read more...
By Steven Rao 2013/07/12 | Source: | Category: t-sql
Rating: |  Discuss |   Briefcase | 1,529 reads

Check SQL Error Logs using Powershell

Dynamically check your SQL Error Logs and filter using Powershell.  Read more...
By Jim Breffni 2014/08/26 | Source: | Category: t-sql
Rating: |  Discuss |   Briefcase | 2,878 reads

Finding queries to tune

A query to help identify queries that need some tuning.  Read more...
By Simon Osborne 2013/06/11 | Source: | Category: t-sql
Rating: |  Discuss |   Briefcase | 3,275 reads
   Items 1 to 20 of 890    Older >>