Wednesday, March 21, 2012

Import Excel Spreadsheet to SQL 7

Running SQL Server 7 and Excel 2002 on an Win XP Pro machine.
I created a database with two tables, ran a program that added some data to
both tables, then used the Data Transformation Services Export Wizard to
export the tables to an Excel workbook containing each table as a separate
spreadsheet. So far, so good.
I manually made a number of changes to the spreadsheets, altering some of
the values that had been exported, adding some more rows to one of the
spreadsheets and sorting the rows. Now when I go back to SQL Server and use
the Wizard to import the data back into the tables, not all of the data
comes back in. Of about 250+ rows in one of the tables, less than 200 of
them get imported. I don't see any errors when running the wizard. I did a
TRUNCATE TABLE in query analyzer before doing the import to clear all the
rows in each table.
Is there some kind of marker to put in the file that tells the import wizard
where to stop? For example, when printing a spreadsheet, you "set" the
print area. Is there a corresponding function to set the "import" area?
Thanks
John Schneider
When you export to Excel from SQL Server a named range is created on the
Excel worksheet. In Excel select Insert on the menu and then Name. You
should see a name in the dialog box. Click on it and update the range and
then the full data set should get imported to SQL server.
Rand
This posting is provided "as is" with no warranties and confers no rights.
|||Bingo! Thanks for the reply. I NEVER would have found that setting.
John
"Rand Boyd [MSFT]" <rboyd@.onlinemicrosoft.com> wrote in message
news:cP9tbKX0EHA.764@.cpmsftngxa10.phx.gbl...
> When you export to Excel from SQL Server a named range is created on the
> Excel worksheet. In Excel select Insert on the menu and then Name. You
> should see a name in the dialog box. Click on it and update the range and
> then the full data set should get imported to SQL server.
> Rand
> This posting is provided "as is" with no warranties and confers no rights.
>

No comments:

Post a Comment