<?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/language/sql/tags/data</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Sat, 18 May 2013 20:33:22 GMT</pubDate>
<item>
<title>(SQL) Xml Element and data insert ,deletion ,updation - kashif21</title>
<link>http://snipplr.com/view/52046/xml-element-and-data-insert-deletion-updation/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 14 Apr 2011 04:03:53 GMT</pubDate>
<guid>http://snipplr.com/view/52046/xml-element-and-data-insert-deletion-updation/</guid>
</item>
<item>
<title>(SQL) Xml element insertion in XML DATA - kashif21</title>
<link>http://snipplr.com/view/52045/xml-element-insertion-in-xml-data/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 14 Apr 2011 04:00:27 GMT</pubDate>
<guid>http://snipplr.com/view/52045/xml-element-insertion-in-xml-data/</guid>
</item>
<item>
<title>(SQL) Export Data From SQL Server to Microsoft Excel Datasheet - derebus</title>
<link>http://snipplr.com/view/44838/export-data-from-sql-server-to-microsoft-excel-datasheet/</link>
<description><![CDATA[ <p>How to Export Data From SQL Server to Microsoft Excel Datasheet</p> ]]></description>
<pubDate>Thu, 25 Nov 2010 09:59:04 GMT</pubDate>
<guid>http://snipplr.com/view/44838/export-data-from-sql-server-to-microsoft-excel-datasheet/</guid>
</item>
<item>
<title>(SQL) Pasar data de una tabla a otra - derebus</title>
<link>http://snipplr.com/view/40437/pasar-data-de-una-tabla-a-otra/</link>
<description><![CDATA[ <p>Declaramos tantas variables como campos vaya a devolver la select que nos estamos currando para el cursor, en este ejemplo con dos campos vamos contentos:

    * declare @campo1 int
    * declare @campo2 int

Ahora declaramos el cursor, al cual lo nombraremos Registros.

    * DECLARE Registros CURSOR FOR
    * select campo 1, campo2 from tabla

Abrimos el cursor:
    * open Registros 

Y jugamos con él, en este caso primero le diremos que meta los datos del primer registro en las variables:

    * FETCH NEXT FROM Registros INTO @Campo1,@Campo2

Abrimos un while para recorrer el cursor hasta que no queden registros

    * while @@fetch_status>=0
    * begin

aqui hacemos lo que tengamos que hacer

    * INSERT INTO DB.dbo.Tabla (Campo1, Campo2) VALUES (@Campo1,@Campo2)

le volvemos a decir que meta los campos del siguiente registro en nuestras variables

    * fetch next from Registros  into @campo1 ,@campo2

cerramos el while

    * end

cerramos el cursor

    * close Registros
    * deallocate Registros</p> ]]></description>
<pubDate>Tue, 14 Sep 2010 03:08:11 GMT</pubDate>
<guid>http://snipplr.com/view/40437/pasar-data-de-una-tabla-a-otra/</guid>
</item>
<item>
<title>(SQL) Script table as INSERTS - CDIDevs</title>
<link>http://snipplr.com/view/25769/script-table-as-inserts/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 31 Dec 2009 10:51:27 GMT</pubDate>
<guid>http://snipplr.com/view/25769/script-table-as-inserts/</guid>
</item>
<item>
<title>(SQL) SQL Server String Split Function - rengber</title>
<link>http://snipplr.com/view/17651/sql-server-string-split-function/</link>
<description><![CDATA[ <p>From StackOverflow.  I'm still not quite happy with my understanding of it, but it looks an order of magnitude more elegant than most I've found.</p> ]]></description>
<pubDate>Wed, 29 Jul 2009 23:37:26 GMT</pubDate>
<guid>http://snipplr.com/view/17651/sql-server-string-split-function/</guid>
</item>
<item>
<title>(SQL) TSQL Function and Check Constraint to Ensure that a Parent Value is Present in the Table - rengber</title>
<link>http://snipplr.com/view/17476/tsql-function-and-check-constraint-to-ensure-that-a-parent-value-is-present-in-the-table/</link>
<description><![CDATA[ <p>If a "InReplyToID" is provided, it must be a valid MessageId</p> ]]></description>
<pubDate>Sun, 26 Jul 2009 23:57:39 GMT</pubDate>
<guid>http://snipplr.com/view/17476/tsql-function-and-check-constraint-to-ensure-that-a-parent-value-is-present-in-the-table/</guid>
</item>
<item>
<title>(SQL) Import data from tab - delimited datafile to SQL table. - RICHARDP</title>
<link>http://snipplr.com/view/9386/import-data-from-tab--delimited-datafile-to-sql-table/</link>
<description><![CDATA[ <p>Fields are tab delimited and need to match table schema. 
I've found the tab separator  ASCII(009)  preferable over using a comma.

The second version can help remove double quotation marks around character fields. 

Don't forget the keyword LOCAL.</p> ]]></description>
<pubDate>Thu, 30 Oct 2008 15:12:36 GMT</pubDate>
<guid>http://snipplr.com/view/9386/import-data-from-tab--delimited-datafile-to-sql-table/</guid>
</item>
<item>
<title>(SQL) Storing an IP address in a database table - zingo</title>
<link>http://snipplr.com/view/5761/storing-an-ip-address-in-a-database-table/</link>
<description><![CDATA[ <p>You can store an IP address in an INT UNSIGNED (4 bytes) which is of course much more efficient and faster than a CHAR(15).
MySQL has two built-in functions: INET_ATON() and INET_NTOA(). These two functions are used allover the place in any TCP/IP stack implementation or even application.
The INET_ATON() function converts Internet addresses from the numbers-and-dots notation into a 32-bit unsigned integer, and INET_NTOA() does the opposite.</p> ]]></description>
<pubDate>Wed, 09 Apr 2008 20:31:52 GMT</pubDate>
<guid>http://snipplr.com/view/5761/storing-an-ip-address-in-a-database-table/</guid>
</item>
</channel>
</rss>