<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: SQLFilter: Simple Data Import Question</title>
	<link>http://ask.metafilter.com/60776/SQLFilter-Simple-Data-Import-Question/</link>
	<description>Comments on Ask MetaFilter post SQLFilter: Simple Data Import Question</description>
	<pubDate>Tue, 17 Apr 2007 09:56:50 -0800</pubDate>
	<lastBuildDate>Tue, 17 Apr 2007 09:56:50 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: SQLFilter: Simple Data Import Question</title>
		<link>http://ask.metafilter.com/60776/SQLFilter-Simple-Data-Import-Question</link>	
		<description>How do I merge an external text file into a SQL table (MS SQL Server)? &lt;br /&gt;&lt;br /&gt; Let&apos;s say I have a table (in MS SQL Server 2000 (or in general, I suppose)) with columns ID, FirstName and LastName, all filled up.  I got this sweet new .csv file with ID and MiddleInitial.  I want to get the MiddleInitial data in my table, so I add the MiddleInitial column to my table.&lt;br&gt;
&lt;br&gt;
(Say I have 20,000 users in this database.)&lt;br&gt;
&lt;br&gt;
What&apos;s the easiest way to import my data?  I&apos;ve poked around with the wizards, to no avail.  It seems like something I shouldn&apos;t need to write code to do, so that&apos;s sort of what I&apos;m looking for...</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2007:site.60776</guid>
		<pubDate>Tue, 17 Apr 2007 09:53:48 -0800</pubDate>
		<dc:creator>joshjs</dc:creator>
		
			<category>sql</category>
		
	</item> <item>
		<title>By: joshjs</title>
		<link>http://ask.metafilter.com/60776/SQLFilter-Simple-Data-Import-Question#915285</link>	
		<description>To clarify: By &quot;users,&quot; I meant &quot;records.&quot;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.60776-915285</guid>
		<pubDate>Tue, 17 Apr 2007 09:56:50 -0800</pubDate>
		<dc:creator>joshjs</dc:creator>
	</item><item>
		<title>By: majick</title>
		<link>http://ask.metafilter.com/60776/SQLFilter-Simple-Data-Import-Question#915291</link>	
		<description>&lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/ms190312.aspx&quot;&gt;OPENROWSET&lt;/a&gt; with the text driver.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.60776-915291</guid>
		<pubDate>Tue, 17 Apr 2007 10:01:43 -0800</pubDate>
		<dc:creator>majick</dc:creator>
	</item><item>
		<title>By: twiggy</title>
		<link>http://ask.metafilter.com/60776/SQLFilter-Simple-Data-Import-Question#915292</link>	
		<description>You have 2 options here that I can think of:&lt;br&gt;
&lt;br&gt;
1) (No code required, but kludgy) Export a CSV from your current SQL table with the rest of the data, pop it in Excel and sort it by ID, sort your ID/MiddleInitial CSV by ID as well, and paste it in...  Reimport the completed dataset as one table.&lt;br&gt;
&lt;br&gt;
2) (Sorry, code required) Write a script that goes through each line of the CSV and basically does:  UPDATE users SET MiddleInitial=&apos;$middleinitial&apos; WHERE ID=&apos;$ID&apos;; ....</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.60776-915292</guid>
		<pubDate>Tue, 17 Apr 2007 10:05:55 -0800</pubDate>
		<dc:creator>twiggy</dc:creator>
	</item><item>
		<title>By: alkupe</title>
		<link>http://ask.metafilter.com/60776/SQLFilter-Simple-Data-Import-Question#915296</link>	
		<description>1. import the text file using DTS. Its pretty easy to do this using Enterprise manager....you just right click on the DB and select import data. &lt;br&gt;
2. use the following sql query.&lt;br&gt;
update table oldtablename&lt;br&gt;
from newtablename&lt;br&gt;
set oldtablename.middleinitial = newtablename.middleinitial&lt;br&gt;
where oldtablename.id = newtablename.id</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.60776-915296</guid>
		<pubDate>Tue, 17 Apr 2007 10:12:28 -0800</pubDate>
		<dc:creator>alkupe</dc:creator>
	</item><item>
		<title>By: joshjs</title>
		<link>http://ask.metafilter.com/60776/SQLFilter-Simple-Data-Import-Question#915299</link>	
		<description>Thank you, sirs.  Shoulda thought of that last one.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.60776-915299</guid>
		<pubDate>Tue, 17 Apr 2007 10:14:06 -0800</pubDate>
		<dc:creator>joshjs</dc:creator>
	</item><item>
		<title>By: joshjs</title>
		<link>http://ask.metafilter.com/60776/SQLFilter-Simple-Data-Import-Question#915301</link>	
		<description>(Sirs or ma&apos;ams.)</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.60776-915301</guid>
		<pubDate>Tue, 17 Apr 2007 10:14:27 -0800</pubDate>
		<dc:creator>joshjs</dc:creator>
	</item>
	</channel>
</rss>
