dbTalk Databases Forums  

importing from spreadsheet

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss importing from spreadsheet in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Janice
 
Posts: n/a

Default importing from spreadsheet - 08-26-2004 , 07:33 AM






I need to copy the data in two spreadsheets into two
tables in "SQL Server 2000". Below are the details:


One spreadsheet contains the data that needs to be added
to an existing table in SQL server. All field names in the
spreadsheet match the DB table column names.
Another spreadsheet contains the data that needs to be
copied to a new DB table. The table currently does NOT
exist in the DB.

I'm not sure how to accomplish this. ANy help would be
appreciated.

Reply With Quote
  #2  
Old   
sqlguy
 
Posts: n/a

Default Re: importing from spreadsheet - 08-26-2004 , 03:44 PM






Answer is the name of the group you posted the question in. Use dts
(data transformation services).
If you want further help with it let me know.
"Janice" <Janice.potucek (AT) nextiraone (DOT) com> wrote

Quote:
I need to copy the data in two spreadsheets into two
tables in "SQL Server 2000". Below are the details:


One spreadsheet contains the data that needs to be added
to an existing table in SQL server. All field names in the
spreadsheet match the DB table column names.
Another spreadsheet contains the data that needs to be
copied to a new DB table. The table currently does NOT
exist in the DB.

I'm not sure how to accomplish this. ANy help would be
appreciated.

Reply With Quote
  #3  
Old   
Janice Potucek
 
Posts: n/a

Default Re: importing from spreadsheet - 08-26-2004 , 07:42 PM





Thank you much!!!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
  #4  
Old   
Janice Potucek
 
Posts: n/a

Default Re: importing from spreadsheet - 08-30-2004 , 06:43 AM





SQLGUY.. you said if I needed more help!!!

The spreadsheet I was given to import has 24 columns and 76 rows. all
column names are the same in the source and destination - in other
words, the first row in the spreadsheet match the column headings in the
sql server table i'm importing to.

Maybe this is an easy thing and i'm just missing something.. but I get
this error trying to import:

first, on the 'select sources tables and views' it is giving me THREE
source tables to select from. I choose all three and then change my
destination to the destination SQL Table.

When I run it, I get errors stating somrthing like NULL not allowed.

any ideas?



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
  #5  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: importing from spreadsheet - 08-30-2004 , 08:42 AM



You may need to open up a little and tell us more about your situation but
if I read that you are having problems with NULL and Excel spreadsheets then
maybe you are experiencing this

Excel Inserts Null Values
(http://www.sqldts.com/default.aspx?254)

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know


"Janice Potucek" <janice.potucek (AT) nextiraone (DOT) com> wrote

Quote:

SQLGUY.. you said if I needed more help!!!

The spreadsheet I was given to import has 24 columns and 76 rows. all
column names are the same in the source and destination - in other
words, the first row in the spreadsheet match the column headings in the
sql server table i'm importing to.

Maybe this is an easy thing and i'm just missing something.. but I get
this error trying to import:

first, on the 'select sources tables and views' it is giving me THREE
source tables to select from. I choose all three and then change my
destination to the destination SQL Table.

When I run it, I get errors stating somrthing like NULL not allowed.

any ideas?



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Reply With Quote
  #6  
Old   
Janice Potucek
 
Posts: n/a

Default Re: importing from spreadsheet - 08-30-2004 , 09:14 AM





I changed one of the rows in the table on the SQL server side to accept
a NULL Value so I fixed that problem. I guess what I'm confused about
it the fact that I CHOOSE THE ONE SPREADSHEETAS THE SOURCE and then on
the 'select sources tables and views' AND IT IS GIVING ME THREE
source tables to select from !!!!! AND THEN When I go ahead and select
all three and choose my SQL table to import them into, I'm not getting
this error:

Violation of Primary Key constraint 'PK_Faultresolutions' cannot insert
duplicate Key in FaultResolutions

I'm thinking maybe my spreadsheet is formatted incorrectly?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
  #7  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: importing from spreadsheet - 08-30-2004 , 09:31 AM



You select _ALL_ three ? How?

Excel will expose Named ranges and tables to you so you may see

Sheet1 and Sheet1$

What exactly do you see?

On a new Spreadsheet I see

Sheet1$
Sheet2$
Sheet3$

These correcpond to the Worksheets inside my Spreadsheet.

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know


"Janice Potucek" <janice.potucek (AT) nextiraone (DOT) com> wrote

Quote:

I changed one of the rows in the table on the SQL server side to accept
a NULL Value so I fixed that problem. I guess what I'm confused about
it the fact that I CHOOSE THE ONE SPREADSHEETAS THE SOURCE and then on
the 'select sources tables and views' AND IT IS GIVING ME THREE
source tables to select from !!!!! AND THEN When I go ahead and select
all three and choose my SQL table to import them into, I'm not getting
this error:

Violation of Primary Key constraint 'PK_Faultresolutions' cannot insert
duplicate Key in FaultResolutions

I'm thinking maybe my spreadsheet is formatted incorrectly?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Reply With Quote
  #8  
Old   
Janice Potucek
 
Posts: n/a

Default Re: importing from spreadsheet - 08-30-2004 , 09:53 AM





On a NEW spreadsheet, I also see sheet
Sheet1$
Sheet2$
Sheet3$

The spreadsheet I'm trying to import has ONE worksheet called Voice.
Yet when I do the Import, it shows THREE worksheets to import:

Voice$
Voice$Print_Area
Voice$Print_Titles

???

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
  #9  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: importing from spreadsheet - 08-30-2004 , 10:00 AM



Ahhhhhh

Now i see

These are named ranges which appear as tables to DTS


In Excel look at the top left corner below the save button. You will see a
dropdown box. In there you should see the things about which we are talking.

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know


"Janice Potucek" <janice.potucek (AT) nextiraone (DOT) com> wrote

Quote:

On a NEW spreadsheet, I also see sheet
Sheet1$
Sheet2$
Sheet3$

The spreadsheet I'm trying to import has ONE worksheet called Voice.
Yet when I do the Import, it shows THREE worksheets to import:

Voice$
Voice$Print_Area
Voice$Print_Titles

???

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Reply With Quote
  #10  
Old   
Janice Potucek
 
Posts: n/a

Default Re: importing from spreadsheet - 08-30-2004 , 11:12 AM





Now I feel dumb!! I did the import and chose ONLY the Voice$ worksheet
and it worked. However, I have one more question. The only way I
can get it to work is to the query builder in DTS and 'deselect' columns
called:

F25
F26
F27
F28
F29

??

I don't know where these came from as I don't see them in my
worksheet.??? Any idea where they came from? and am I losing Data
doing it this way???

Thank you for your patience with me and ALL THE HELP!!!!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.