<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>cogent free knowledge - Sql Server</title>
    <link>http://blog.edogg.com/</link>
    <description>An online compendium of all things that interest me.</description>
    <dc:language>en</dc:language>
    
    <generator>Serendipity 0.9.1 - http://www.s9y.org/</generator>
    <pubDate>Tue, 16 Oct 2007 18:15:07 GMT</pubDate>

    <image>
        <url>http://blog.edogg.com/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: cogent free knowledge - Sql Server - An online compendium of all things that interest me.</title>
        <link>http://blog.edogg.com/</link>
        <width>100</width>
        <height>21</height>
    </image>
<item>
    <title>Export data from SQL Server 2005 Express to Microsoft Access</title>
    <link>http://blog.edogg.com/index.php?/archives/39-Export-data-from-SQL-Server-2005-Express-to-Microsoft-Access.html</link>
<category>Sql Server</category>    <comments>http://blog.edogg.com/index.php?/archives/39-Export-data-from-SQL-Server-2005-Express-to-Microsoft-Access.html#comments</comments>
    <wfw:comment>http://blog.edogg.com/wfwcomment.php?cid=39</wfw:comment>
    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.edogg.com/rss.php?version=2.0&amp;type=comments&amp;cid=39</wfw:commentRss>
    <author>nospam@example.com (JClermont)</author>
    <content:encoded>
SQL Server 2005 Express is the best free edition of SQL that Microsoft has ever released. That being said, the few features it omits from the Standard version can be a source of frustration. For example, I wanted to setup an automated task to dump a SQL table into a MS Access database table every night. I realize that Express doesn't have a job agent, no big deal. We can use Task Scheduler for that. But how to move the data?&lt;br /&gt;
&lt;br /&gt;
After experimenting, I found a great solution. I created a new &quot;Linked Server&quot; pointing to the Access database, then did a simple INSERT INTO / SELECT FROM statement in a stored procedure. Here are the basic steps:&lt;br /&gt;
&lt;br /&gt;
1. Create a new Linked Server&lt;br /&gt;
&lt;br /&gt;
Open Management Studio Express. Expand &quot;Server Objects&quot;, then &quot;Linked Servers&quot;. Right-click &quot;Linked Servers&quot; and pick &quot;New Linked Server&quot;. Give it any name you want at the top, let's say TEST_MDB for sake of example. Provider should be &quot;Microsoft Jet 4.0 OLE DB Provider&quot;. Product name is &quot;Access&quot;. Data source should be the full path to the .mdb file. Leave Provider String empty. (Note: i think that's where you'd set user name and password if your mdb file is protected). Click Ok. If you refresh your Linked Server list, it should be there now.&lt;br /&gt;
&lt;br /&gt;
2. The query syntax . . . &lt;br /&gt;
&lt;br /&gt;
When referring to a table in your Access database, use the following syntax. Assuming a linked server name of TEST_MDB and a table name of Customers it would be:&lt;br /&gt;
&lt;br /&gt;
TEST_MDB...Customers&lt;br /&gt;
&lt;br /&gt;
Those three dots are very important. &lt;br /&gt;
&lt;br /&gt;
You should now be able to write any query you want against that database. INSERT, SELECT, UPDATE, DELETE, whatever. Joins work as you would expect with a local table.&lt;br /&gt;
&lt;br /&gt;
Posted under the influence of [[Ulver :: Untitled II]]    </content:encoded>
                
    <pubDate>Tue, 16 Oct 2007 13:06:18 -0500</pubDate>
    <guid isPermaLink="false">http://blog.edogg.com/index.php?/archives/39-guid.html</guid>
    </item>
<item>
    <title>Fix orphaned users after a database restore</title>
    <link>http://blog.edogg.com/index.php?/archives/37-Fix-orphaned-users-after-a-database-restore.html</link>
<category>Sql Server</category>    <comments>http://blog.edogg.com/index.php?/archives/37-Fix-orphaned-users-after-a-database-restore.html#comments</comments>
    <wfw:comment>http://blog.edogg.com/wfwcomment.php?cid=37</wfw:comment>
    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.edogg.com/rss.php?version=2.0&amp;type=comments&amp;cid=37</wfw:commentRss>
    <author>nospam@example.com (JClermont)</author>
    <content:encoded>
Often, when restoring a database from a remote machine on my local development machine, my user logins no longer work for that database. The problem lies with the fact that while the user name is the same from machine to machine, the underlying GUID that SQL uses to identify users is different. Thankfully, there is a very easy one line command that fixes these &quot;orphaned&quot; users.&lt;br /&gt;
&lt;br /&gt;
In the context of the database with the orphaned user, run:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;EXEC sp_change_users_login 'Auto_Fix, '&lt;i&gt;username&lt;/i&gt;'&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Of course, substitute the actual user name for the &lt;i&gt;placeholder&lt;/i&gt; in the above script.&lt;br /&gt;
&lt;br /&gt;
Posted under the influence of [[Pennywise::Victim of Reality]]    </content:encoded>
                
    <pubDate>Sat, 17 Mar 2007 11:17:22 -0500</pubDate>
    <guid isPermaLink="false">http://blog.edogg.com/index.php?/archives/37-guid.html</guid>
    </item>
</channel>
</rss>
