<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr</title>
<link>http://snipplr.com/tags/sqlserver</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Wed, 22 May 2013 09:27:52 GMT</pubDate>
<item>
<title>(SQL) Reset Identity - indra</title>
<link>http://snipplr.com/view/58889/reset-identity/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 21 Sep 2011 15:52:30 GMT</pubDate>
<guid>http://snipplr.com/view/58889/reset-identity/</guid>
</item>
<item>
<title>(SQL) SQL Server Restore Progress - beaknit</title>
<link>http://snipplr.com/view/56749/sql-server-restore-progress/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Mon, 18 Jul 2011 14:01:35 GMT</pubDate>
<guid>http://snipplr.com/view/56749/sql-server-restore-progress/</guid>
</item>
<item>
<title>(SQL) Lots of Table Info - michanne</title>
<link>http://snipplr.com/view/55040/lots-of-table-info/</link>
<description><![CDATA[ <p>SQL Server - everything you want to know (or not) about a table.</p> ]]></description>
<pubDate>Thu, 09 Jun 2011 03:35:08 GMT</pubDate>
<guid>http://snipplr.com/view/55040/lots-of-table-info/</guid>
</item>
<item>
<title>(SQL) Sample Table Sample - michanne</title>
<link>http://snipplr.com/view/53263/sample-table-sample/</link>
<description><![CDATA[ <p>Alternate to tablesample clause. Example from BOL

"The expression CAST(CHECKSUM(NEWID(), SalesOrderID) &amp; 0x7fffffff AS float / CAST (0x7fffffff AS int) evaluates to a random float value between 0 and 1"</p> ]]></description>
<pubDate>Tue, 10 May 2011 04:18:38 GMT</pubDate>
<guid>http://snipplr.com/view/53263/sample-table-sample/</guid>
</item>
<item>
<title>(SQL) Kill Connections to SQL Server - tclancy</title>
<link>http://snipplr.com/view/51617/kill-connections-to-sql-server/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 06 Apr 2011 01:02:50 GMT</pubDate>
<guid>http://snipplr.com/view/51617/kill-connections-to-sql-server/</guid>
</item>
<item>
<title>(SQL) SQL Server SP/FN Set Options - michanne</title>
<link>http://snipplr.com/view/50564/sql-server-spfn-set-options/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Sat, 12 Mar 2011 07:34:14 GMT</pubDate>
<guid>http://snipplr.com/view/50564/sql-server-spfn-set-options/</guid>
</item>
<item>
<title>(SQL) SQL Server - Find text in stored proc - SkyeBianca</title>
<link>http://snipplr.com/view/45332/sql-server--find-text-in-stored-proc/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Mon, 06 Dec 2010 11:48:22 GMT</pubDate>
<guid>http://snipplr.com/view/45332/sql-server--find-text-in-stored-proc/</guid>
</item>
<item>
<title>(SQL) Conditional Where Criteria - indra</title>
<link>http://snipplr.com/view/42517/conditional-where-criteria/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Tue, 19 Oct 2010 05:19:23 GMT</pubDate>
<guid>http://snipplr.com/view/42517/conditional-where-criteria/</guid>
</item>
<item>
<title>(VB.NET) SQL2KConnect - indra</title>
<link>http://snipplr.com/view/39458/sql2kconnect/</link>
<description><![CDATA[ <p>Class for access and manipulation database</p> ]]></description>
<pubDate>Tue, 24 Aug 2010 14:42:19 GMT</pubDate>
<guid>http://snipplr.com/view/39458/sql2kconnect/</guid>
</item>
<item>
<title>(SQL) Show User Table-Func-Sp - indra</title>
<link>http://snipplr.com/view/39457/show-user-tablefuncsp/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Tue, 24 Aug 2010 14:11:43 GMT</pubDate>
<guid>http://snipplr.com/view/39457/show-user-tablefuncsp/</guid>
</item>
<item>
<title>(SQL) Find First and Last Day of Current Month - indra</title>
<link>http://snipplr.com/view/39454/find-first-and-last-day-of-current-month/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Tue, 24 Aug 2010 13:37:53 GMT</pubDate>
<guid>http://snipplr.com/view/39454/find-first-and-last-day-of-current-month/</guid>
</item>
<item>
<title>(SQL) SQL Searh And Replace in ALL DataBase - Eloi</title>
<link>http://snipplr.com/view/37010/sql-searh-and-replace-in-all-database/</link>
<description><![CDATA[ <p>Stored Procedure for search and replace a string in all fields of all tables of one DataBase</p> ]]></description>
<pubDate>Fri, 09 Jul 2010 21:54:31 GMT</pubDate>
<guid>http://snipplr.com/view/37010/sql-searh-and-replace-in-all-database/</guid>
</item>
<item>
<title>(SQL) SQL Searh in ALL DataBase - Eloi</title>
<link>http://snipplr.com/view/37009/sql-searh-in-all-database/</link>
<description><![CDATA[ <p>Stored Procedure for search a string in all fields of all tables of one DataBase</p> ]]></description>
<pubDate>Fri, 09 Jul 2010 21:47:17 GMT</pubDate>
<guid>http://snipplr.com/view/37009/sql-searh-in-all-database/</guid>
</item>
<item>
<title>(SQL) Search stored procedures for string - charmcitycoder</title>
<link>http://snipplr.com/view/17527/search-stored-procedures-for-string/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Mon, 27 Jul 2009 15:37:23 GMT</pubDate>
<guid>http://snipplr.com/view/17527/search-stored-procedures-for-string/</guid>
</item>
<item>
<title>(Python) Read UTF-16 with NULL's, as received from the SQL Server "bcp" utility - Twain</title>
<link>http://snipplr.com/view/15779/read-utf16-with-nulls-as-received-from-the-sql-server-bcp-utility/</link>
<description><![CDATA[ <p>Read a windows UTF-16 file (such as a BCP dump from SQL Server) that  contains ASCII characters and occasional nulls</p> ]]></description>
<pubDate>Tue, 09 Jun 2009 09:31:07 GMT</pubDate>
<guid>http://snipplr.com/view/15779/read-utf16-with-nulls-as-received-from-the-sql-server-bcp-utility/</guid>
</item>
<item>
<title>(C#) Set the directory (connection string) for an SQL Server Database Connection - pckujawa</title>
<link>http://snipplr.com/view/10502/set-the-directory-connection-string-for-an-sql-server-database-connection/</link>
<description><![CDATA[ <p>This snippet is actually tested for SQL Server Compact Edition (CE) 3.5, but it will probably work for other SQL Server editions. Once you have an SQL CE db up and running, you can set the connection string to point to any directory and database by simply using the |DataDirectory| string in the dbConnectionString Property (created by default when you create the database connection) and then relocating the location to which |DataDirectory| points by calling AppDomain.CurrentDomain.SetData("DataDirectory", @"C:\Path\To\DB"). Since the dbConnectionString property appends \dbName.sdf, we leave that part off of the SetData argument.

The code below sets the data directory to the common application data folder (usually C:\Documents and Settings\All Users\Application Data on winXP). It seems to work fine when invoked in the Form_Load method.</p> ]]></description>
<pubDate>Mon, 15 Dec 2008 11:59:07 GMT</pubDate>
<guid>http://snipplr.com/view/10502/set-the-directory-connection-string-for-an-sql-server-database-connection/</guid>
</item>
<item>
<title>(SQL) SQL Server truncate log and shrink file - robe</title>
<link>http://snipplr.com/view/10370/sql-server-truncate-log-and-shrink-file/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 10 Dec 2008 02:55:00 GMT</pubDate>
<guid>http://snipplr.com/view/10370/sql-server-truncate-log-and-shrink-file/</guid>
</item>
<item>
<title>(SQL) SQL Server Split function - robe</title>
<link>http://snipplr.com/view/10278/sql-server-split-function/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Fri, 05 Dec 2008 01:09:54 GMT</pubDate>
<guid>http://snipplr.com/view/10278/sql-server-split-function/</guid>
</item>
<item>
<title>(DOS Batch) SQL Server Find Differences Between Two Tables - hoffstein</title>
<link>http://snipplr.com/view/10035/sql-server-find-differences-between-two-tables/</link>
<description><![CDATA[ <p>The TableDiff utility comes with SQL Server 2005 and can report differences on schema and data. The most popular feature of TableDiff is the fact that it can generate a script that you can run on the destination that will reconcile differences between the tables.

Original source was a TechNet article called [Top 10 Hidden Gems In SQL Server 2005][1].

[1]: http://www.microsoft.com/technet/prodtechnol/sql/bestpractice/gems-top-10.mspx "Top 10 Hidden Gems in SQL Server 2005"</p> ]]></description>
<pubDate>Tue, 25 Nov 2008 11:20:20 GMT</pubDate>
<guid>http://snipplr.com/view/10035/sql-server-find-differences-between-two-tables/</guid>
</item>
<item>
<title>(Other) SQL Server 2005 data types - hoffstein</title>
<link>http://snipplr.com/view/9487/sql-server-2005-data-types/</link>
<description><![CDATA[ <p>## Exact numerics


  
    
      Type 
    
    
    
      From 
    
    
    
      To 
    
  
  
  
    
      bigint 
    
    
    
      -9,223,372,036,854,775,808 
    
    
    
      9,223,372,036,854,775,807 
    
  
  
  
    
      int 
    
    
    
      -2,147,483,648 
    
    
    
      2,147,483,647 
    
  
  
  
    
      smallint 
    
    
    
      -32,768 
    
    
    
      32,767 
    
  
  
  
    
      tinyint 
    
    
    
    
    
    
      255 
    
  
  
  
    
      bit 
    
    
    
    
    
    
      1 
    
  
  
  
    
      decimal 
    
    
    
      -10^38 +1 
    
    
    
      10^38 –1 
    
  
  
  
    
      numeric 
    
    
    
      -10^38 +1 
    
    
    
      10^38 –1 
    
  
  
  
    
      money 
    
    
    
      -922,337,203,685,477.5808 
    
    
    
      +922,337,203,685,477.5807 
    
  
  
  
    
      smallmoney 
    
    
    
      -214,748.3648 
    
    
    
      +214,748.3647 
    
  


numeric and  decimal are Fixed precision and scale data types and are functionally equivalent.
## Approximate numerics


  
    
      Type
    
    
    
      From
    
    
    
      To
    
  
  
  
    
      float
    
    
    
      -1.79E + 308
    
    
    
      1.79E + 308
    
  
  
  
    
      real
    
    
    
      -3.40E + 38
    
    
    
      3.40E + 38
    
  


 

## datetime and smalldatetime


  
    
      Type
    
    
    
       From
    
    
    
      To
    
  
  
  
    
      datetime (3.33 milliseconds accuracy)
    
    
    
      Jan 1, 1753
    
    
    
      Dec 31, 9999
    
  
  
  
    
      smalldatetime (1 minute accuracy)
    
    
    
      Jan 1, 1900
    
    
    
      Jun 6, 2079
    
  


 
## Character Strings


  
    
      Type
    
    
    
      Description
    
  
  
  
    
      char
    
    
    
      Fixed-length non-Unicode character data with a maximum length of 8,000 characters.
    
  
  
  
    
      varchar
    
    
    
      Variable-length non-Unicode data with a maximum of 8,000 characters.
    
  
  
  
    
      varchar(max)
    
    
    
      Variable-length non-Unicode data with a maximum length of 231 characters (SQL Server 2005 only).
    
  
  
  
    
      text
    
    
    
      Variable-length non-Unicode data with a maximum length of 2,147,483,647 characters.
    
  


 
## Unicode Character Strings


  
    
      Type
    
    
    
      Description
    
  
  
  
    
      nchar
    
    
    
      Fixed-length Unicode data with a maximum length of 4,000 characters.
    
  
  
  
    
      nvarchar
    
    
    
      Variable-length Unicode data with a maximum length of 4,000 characters.
    
  
  
  
    
      nvarchar(max)
    
    
    
      Variable-length Unicode data with a maximum length of 230 characters (SQL Server 2005 only).
    
  
  
  
    
      ntext
    
    
    
      Variable-length Unicode data with a maximum length of 1,073,741,823 characters.
    
  


 
## Binary Strings



  
    
      Type
    
    
    
      Description
    
  
  
  
    
      binary
    
    
    
      Fixed-length binary data with a maximum length of 8,000 bytes.
    
  
  
  
    
      varbinary
    
    
    
      Variable-length binary data with a maximum length of 8,000 bytes.
    
  
  
  
    
      varbinary(max)
    
    
    
      Variable-length binary data with a maximum length of 231 bytes (SQL Server 2005 only).
    
  
  
  
    
      image
    
    
    
      Variable-length binary data with a maximum length of 2,147,483,647 bytes.
    
  
</p> ]]></description>
<pubDate>Tue, 04 Nov 2008 15:07:09 GMT</pubDate>
<guid>http://snipplr.com/view/9487/sql-server-2005-data-types/</guid>
</item>
</channel>
</rss>