<p>This should be simple. I'm trying to import data from Access into SQL Server. I don't have direct access to the SQL Server database - it's on GoDaddy and they only allow web access. So I can't use the Management Studio tools, or other third-party Access upsizing programs that require remote access to the database.</p>

<p>I wrote a query on the Access database and I'm trying to loop through and insert each record into the corresponding SQL Server table. But it keeps erroring out. I'm fairly certain it's because of the HTML and God knows what other weird characters are in one of the Access text fields. I tried using CFQUERYPARAM but that doesn't seem to help either.</p>

<p>Any ideas would be helpful. Thanks.</p>

[{'answer_id': 66324, 'author': 'David-W-Fenton', 'author_id': 9787, 'author_profile': 'https://Stackoverflow.com/users/9787', 'pm_score': -1, 'selected': False, 'text': "<p>It's never advisable to loop through records when a SQL Update can be used.</p>\n\n<p>It's not clear from your question what database interface layer you are using, but it is possible with the right interfaces to insert data from a source outside a database <em>if</em> the interface being used supports both types of databases. This can be done in the FROM clause of your SQL statement by specifying not just the table name, but the connect string for the database. Assuming that your web host has ODBC drivers for Jet data (you're not actually using Access, which is the app development part -- you're only using the Jet database engine), the connect string should be sufficient.</p>\n\n<p>EDIT: If you use the Jet database engine to do this, you should be able to specify the source table something like this (where tblSQLServer is a table in your Jet MDB that is linked via ODBC to your SQL Server):</p>\n\n<pre><code>INSERT INTO tblSQLServer (ID, OtherField ) \nSELECT ID, OtherField\nFROM [c:\\MyDBs\\Access.mdb].tblSQLServer \n</code></pre>\n\n<p>The key point is that you are leveraging the Jet db engine here to do all the heavy lifting for you.</p>\n"}, {'answer_id': 66585, 'author': 'Chase Seibert', 'author_id': 7679, 'author_profile': 'https://Stackoverflow.com/users/7679', 'pm_score': 1, 'selected': False, 'text': '<p>Try using the <a href="http://blog.godaddyhosting.com/2007/07/20/presentingdrum-roll-please-the-ms-sql-backuprestore-feature.aspx" rel="nofollow noreferrer">GoDaddy SQL backup/restore tool</a> to get a local copy of the database. At that point, use the <a href="http://www.microsoft.com/technet/prodtechnol/sql/2000/deploy/dtssql2k.mspx" rel="nofollow noreferrer">SQL Server DTS tool</a> to import the data. It\'s an easy to use, drag-and-drop graphical interface.</p>\n'}, {'answer_id': 72680, 'author': 'Ben Doom', 'author_id': 12267, 'author_profile': 'https://Stackoverflow.com/users/12267', 'pm_score': 1, 'selected': False, 'text': '<p>What error(s) get(s) thrown?  What odd characters are you using?  Are you referring to HTML markup, or extended (eg UTF-8) characters?</p>\n\n<p>If possible, turn on Robust Error Reporting.</p>\n\n<p>If the problem is the page timing out, you can either increase the timeout using the Admin, using the cfsetting tag, or rewrite your script to run a certain number of lines, and then forward to itself at the next start point.</p>\n'}, {'answer_id': 88441, 'author': 'Andy Waschick', 'author_id': 6000, 'author_profile': 'https://Stackoverflow.com/users/6000', 'pm_score': 0, 'selected': False, 'text': '<p>You should be able to execute saved DTS packages in MS SQL Server from the application server\'s command line.  Since this is the case, you can use <code>&lt;cfexecute&gt;</code> to issue a request to DTSRUNNUI.EXE. (<a href="http://www.mssqltips.com/tip.asp?tip=1007" rel="nofollow noreferrer">See example</a>) This is of course assuming you are on a server where the command is available.</p>\n'}]
['https://Stackoverflow.com/questions/65940', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']