<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SQL Archive - Pixelfriedhof</title>
	<atom:link href="https://pixelfriedhof.com/en/tag/sql-en/feed/" rel="self" type="application/rss+xml" />
	<link>https://pixelfriedhof.com/en/tag/sql-en/</link>
	<description>IT-Blog, Fotoblog, Travelblog, Nerdstuff</description>
	<lastBuildDate>Tue, 04 Feb 2020 12:47:59 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.3</generator>

<image>
	<url>https://pixelfriedhof.com/wp-content/uploads/2022/02/cropped-My-project-3-32x32.png</url>
	<title>SQL Archive - Pixelfriedhof</title>
	<link>https://pixelfriedhof.com/en/tag/sql-en/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Creating SQL Statements with Excel (Quick and Dirty)</title>
		<link>https://pixelfriedhof.com/en/creating-sql-statements-with-excel-quick-and-dirty/</link>
					<comments>https://pixelfriedhof.com/en/creating-sql-statements-with-excel-quick-and-dirty/#respond</comments>
		
		<dc:creator><![CDATA[megaadmin]]></dc:creator>
		<pubDate>Wed, 20 Mar 2019 18:24:14 +0000</pubDate>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Datenbanken]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">http://pixelfriedhof.com/?p=203</guid>

					<description><![CDATA[<p>Sometimes, you have to import predefined data supplied as a list, such as personnel numbers, into a database and at the same time provide it with additional (default) values. Creating each statement manually would be very time-consuming, especially for large amounts of data. The function "concatenate" in Excel helps a lot.</p>
<p> </p>
<p>Der Beitrag <a href="https://pixelfriedhof.com/en/creating-sql-statements-with-excel-quick-and-dirty/">Creating SQL Statements with Excel (Quick and Dirty)</a> erschien zuerst auf <a href="https://pixelfriedhof.com/en">Pixelfriedhof</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Sometimes, you have to import predefined data supplied as a list, such as personnel numbers, into a database and at the same time provide it with additional (default) values. Creating each statement manually would be very time-consuming, especially for large amounts of data. The function &#8220;concatenate&#8221; in Excel helps a lot.</p>
<p>First, we pack all the values delivered as a list, in this simplified case personnel numbers, into the column one below the other.</p>
<p>In an adjacent column we add the function &#8220;concatenate&#8221; to create a character string:</p>
<p>=CONCATENATE(&#8220;<span style="color: #ff0000;">INSERT INTO personal VALUES(</span>&#8220;<span style="color: #3366ff;">;A3;</span>&#8220;<span style="color: #ff0000;">,Value1,Value2,&#8217;01.01.2015&#8242;,Porta Westfalica, NULL)</span>&#8220;)</p>
<p>The text written in red is taken over statically and the blue block automatically references the preceding column with the personnel number.</p>
<p>The result then looks like this and can be imported directly into the SQL management studio as a text copy:</p>
<p><img fetchpriority="high" decoding="async" src="https://pixelfriedhof.com/wp-content/images/computer/sql_statement_Erstellung.png" width="600" height="190"></p>
<p>Der Beitrag <a href="https://pixelfriedhof.com/en/creating-sql-statements-with-excel-quick-and-dirty/">Creating SQL Statements with Excel (Quick and Dirty)</a> erschien zuerst auf <a href="https://pixelfriedhof.com/en">Pixelfriedhof</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://pixelfriedhof.com/en/creating-sql-statements-with-excel-quick-and-dirty/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Import contents of a CSV file into an existing table via SQL (Bulk Operation)</title>
		<link>https://pixelfriedhof.com/en/import-contents-of-a-csv-file-into-an-existing-table-via-sql-bulk-operation/</link>
					<comments>https://pixelfriedhof.com/en/import-contents-of-a-csv-file-into-an-existing-table-via-sql-bulk-operation/#respond</comments>
		
		<dc:creator><![CDATA[megaadmin]]></dc:creator>
		<pubDate>Wed, 20 Mar 2019 18:23:14 +0000</pubDate>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Datenbanken]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">http://pixelfriedhof.com/?p=202</guid>

					<description><![CDATA[<p>Script to import data from a CSV file into an existing MS-SQL table via bulk operation. Creation of a temporary table, import, transfer to productive table. The assignment of the data to the correct keys takes place via an inner join.</p>
<p> </p>
<p>Der Beitrag <a href="https://pixelfriedhof.com/en/import-contents-of-a-csv-file-into-an-existing-table-via-sql-bulk-operation/">Import contents of a CSV file into an existing table via SQL (Bulk Operation)</a> erschien zuerst auf <a href="https://pixelfriedhof.com/en">Pixelfriedhof</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Script to import data from a CSV file into an existing MS-SQL table via bulk operation. Creation of a temporary table, import, transfer to productive table. The assignment of the data to the correct keys takes place via an inner join.</p>
<p>The only important thing to note here is that the database user performing the operation has the right for &#8220;bulk operations&#8221;.</p>

<div class="aawp">

            
            
<div class="aawp-product aawp-product--horizontal aawp-product--ribbon aawp-product--sale"  data-aawp-product-asin="0470929960" data-aawp-product-id="10760" data-aawp-tracking-id="daniel-net-21" data-aawp-product-title="SQL All-in-One For Dummies 2e">

    <span class="aawp-product__ribbon aawp-product__ribbon--sale">Special offer</span>
    <div class="aawp-product__thumb">
        <a class="aawp-product__image-link"
           href="https://www.amazon.de/dp/0470929960?tag=daniel-net-21&linkCode=ogi&th=1&psc=1" title="SQL All-in-One For Dummies 2e" rel="nofollow noopener sponsored" target="_blank">
            <img decoding="async" class="aawp-product__image" src="https://pixelfriedhof.com/wp-content/plugins/aawp/public/image.php?url=YUhSMGNITTZMeTl0TG0xbFpHbGhMV0Z0WVhwdmJpNWpiMjB2YVcxaFoyVnpMMGt2TlRGTk5USXdUblZ5V1V3dVgxTk1NVFl3WHk1cWNHYz18MTc2Mzk4MjY4OA=" alt="SQL All-in-One For Dummies 2e"  />
        </a>

            </div>

    <div class="aawp-product__content">
        <a class="aawp-product__title" href="https://www.amazon.de/dp/0470929960?tag=daniel-net-21&linkCode=ogi&th=1&psc=1" title="SQL All-in-One For Dummies 2e" rel="nofollow noopener sponsored" target="_blank">
            SQL All-in-One For Dummies 2e*        </a>
        <div class="aawp-product__description">
            <ul><li>Taylor, Allen G. (Author)</li></ul>        </div>
    </div>

    <div class="aawp-product__footer">

        <div class="aawp-product__pricing">
                                                                <span class="aawp-product__price aawp-product__price--saved">&#8722;16,54 EUR</span>
                            
                            <span class="aawp-product__price aawp-product__price--current">17,93 EUR</span>
            
                    </div>

                <a class="aawp-button aawp-button--buy aawp-button aawp-button--amazon aawp-button--icon aawp-button--icon-black" href="https://www.amazon.de/dp/0470929960?tag=daniel-net-21&#038;linkCode=ogi&#038;th=1&#038;psc=1" title="Amazon" target="_blank" rel="nofollow noopener sponsored">Amazon</a>
            </div>

</div>

    
</div>

<p style="margin: 0px; font-size: 9.5px; font-family: Consolas; color: #0433ff;">
<p style="margin: 0px; font-size: 9.5px; font-family: Consolas; color: #0433ff;">
<p style="margin: 0px; font-size: 9.5px; font-family: Consolas; color: #0433ff; text-align: left;">CREATE TABLE&nbsp;<span style="color: #009193;">TEMP</span> <span style="color: #929292;">(</span></p>
<p style="margin: 0px; font-size: 9.5px; font-family: Consolas; color: #009193; text-align: left;"><span style="color: #000000;">&nbsp; </span>[personalnr]&nbsp;<span style="color: #0433ff;">varchar</span><span style="color: #929292;">(</span><span style="color: #000000;">15</span><span style="color: #929292;">),</span></p>
<p style="margin: 0px; font-size: 9.5px; font-family: Consolas; color: #009193; text-align: left;"><span style="color: #000000;">&nbsp; </span>[Emailadresse]&nbsp;<span style="color: #0433ff;">varchar</span><span style="color: #929292;">(</span><span style="color: #000000;">200</span><span style="color: #929292;">),</span></p>
<p style="margin: 0px; font-size: 9.5px; font-family: Consolas; color: #0433ff; text-align: left;"><span style="color: #000000;">&nbsp; </span><span style="color: #009193;">[Ort]&nbsp;</span>varchar<span style="color: #929292;">(</span><span style="color: #000000;">40</span><span style="color: #929292;">)</span></p>
<p>&#8212; Here we create a temporary table to accept and store the data of the CSV file for the first time.</p>
<p>&#8212; The order of the column names must also be kept in the CSV file.</p>
<p style="margin: 0px; font-size: 9.5px; font-family: Consolas; color: #929292; text-align: left;">)</p>
<p style="margin: 0px; font-size: 9.5px; font-family: Consolas; color: #0433ff; text-align: left;">GO</p>
<p style="margin: 0px; font-size: 9.5px; font-family: Consolas; color: #008f00; text-align: left;"><span style="color: #0433ff;">BULK&nbsp;</span><span style="color: #0433ff;">INSERT&nbsp;</span><span style="color: #009193;">TEMP&#8211; Fill temporary table with CSV data</span></p>
<p style="margin: 0px; font-size: 9.5px; font-family: Consolas; color: #008f00; text-align: left;"><span style="color: #0433ff;">FROM&nbsp;</span><span style="color: #ff2600;">&#8216;J:\WORK\import\mail.csv&#8217;&#8211; This is the path to the file being imported. IMPORTANT: The path refers to the path in the server, not to the machine running the management studio.</span></p>
<p style="margin: 0px; font-size: 9.5px; font-family: Consolas; color: #0433ff; text-align: left;">WITH</p>
<p style="margin: 0px; font-size: 9.5px; font-family: Consolas; color: #0433ff; text-align: left;">&nbsp;<span style="color: #929292;">(</span></p>
<p style="margin: 0px; font-size: 9.5px; font-family: Consolas; color: #008f00; text-align: left;"><span style="color: #000000;">&nbsp; &nbsp; </span><span style="color: #0433ff;">FIELDTERMINATOR</span><span style="color: #929292;">=</span><span style="color: #ff2600;">&#8216;,&#8217;</span><span style="color: #929292;">,</span><span style="color: #000000;">&nbsp; &nbsp; &#8212; Make sure that the CSV file really separates the columns with a comma and not with a semicolon.</span></p>
<p style="margin: 0px; font-size: 9.5px; font-family: Consolas; color: #008f00; text-align: left;"><span style="color: #000000;">&nbsp; &nbsp; </span><span style="color: #0433ff;">rowterminator</span><span style="color: #929292;">=</span><span style="color: #ff2600;">&#8216;\n&#8217;</span><span style="color: #000000;"> &nbsp; &nbsp;&nbsp;&#8212; In most cases &#8211;\n is correct, at least if the file was created from a German Excel version as CSV and if necessary was edited again with the editor.</span></p>
<p style="margin: 0px; font-size: 9.5px; font-family: Consolas; text-align: left;">&nbsp; <span style="color: #929292;">)</span> &nbsp; &nbsp;</p>
<p style="margin: 0px; font-size: 9.5px; font-family: Consolas; color: #0433ff; text-align: left;">GO</p>
<p style="margin: 0px; font-size: 9.5px; font-family: Consolas; color: #008f00; text-align: left;"><span style="color: #ff40ff;">UPDATE&nbsp;</span><span style="color: #009193;">mitarbeiter&#8211; The contents of the temporary table are copied to the productive table. The personnel number, which we &#8220;join&#8221; in the temporary table, functions as the assignment characteristic.</span></p>
<p style="margin: 0px; font-size: 9.5px; font-family: Consolas; color: #009193; text-align: left;"><span style="color: #0433ff;">SET&nbsp;</span>Emailadresse<span style="color: #929292;">=</span>temp<span style="color: #929292;">.</span>Emailadresse<span style="color: #929292;">,</span>Ort<span style="color: #929292;">=</span>temp<span style="color: #929292;">.</span>Ort</p>
<p style="margin: 0px; font-size: 9.5px; font-family: Consolas; color: #009193; text-align: left;"><span style="color: #0433ff;">FROM&nbsp;</span>mitarbeiter</p>
<p style="margin: 0px; font-size: 9.5px; font-family: Consolas; color: #929292; text-align: left;">INNERJOIN&nbsp;<span style="color: #009193;">temp</span></p>
<p style="margin: 0px; font-size: 9.5px; font-family: Consolas; color: #009193; text-align: left;"><span style="color: #0433ff;">ON&nbsp;</span>mitarbeiter<span style="color: #929292;">.</span>personalnr<span style="color: #929292;">=</span>temp<span style="color: #929292;">.</span>personalnr</p>
<p style="margin: 0px; font-size: 9.5px; font-family: Consolas; color: #0433ff; text-align: left;">GO</p>
<p style="margin: 0px; font-size: 9.5px; font-family: Consolas; color: #008f00; text-align: left;"><span style="color: #0433ff;">DROP&nbsp;</span><span style="color: #0433ff;">TABLE&nbsp;</span><span style="color: #009193;">TEMP</span><span style="color: #000000;">&nbsp; &#8212; After all previous operations have been completed, we can delete the temporary table.</span></p>
<p style="margin: 0px; font-size: 9.5px; font-family: Consolas; color: #0433ff; text-align: left;">GO</p>
<p style="margin: 0px; font-size: 9.5px; font-family: Consolas; color: #0433ff; text-align: left;">
<p style="margin: 0px; font-size: 9.5px; font-family: Consolas; color: #0433ff; text-align: left;">
<p>All the links in this text are Amazon Affiliate Links, and by clicking on an affiliate link I will earn a percentage of your subsequent Amazon purchases. However, this circumstance does not influence the background of my product recommendation. This product recommendation is independent, honest and sincere.</p>
<p>Bei allen genannten Links handelt es sich um Amazon-Affiliate-Links. Durch einen Klick auf einen Affiliate-Link werde ich prozentual an Euren darauf folgenden Amazon-Einkäufen beteiligt. Dieser Umstand beeinflusst aber nicht die Hintergründe meiner Produktempfehlung. Diese Produktempfehlung erfolgt unabhängig, ehrlich und aufrichtig.</p>
<p>Der Beitrag <a href="https://pixelfriedhof.com/en/import-contents-of-a-csv-file-into-an-existing-table-via-sql-bulk-operation/">Import contents of a CSV file into an existing table via SQL (Bulk Operation)</a> erschien zuerst auf <a href="https://pixelfriedhof.com/en">Pixelfriedhof</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://pixelfriedhof.com/en/import-contents-of-a-csv-file-into-an-existing-table-via-sql-bulk-operation/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
