Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 [sql2005 express] Import a table from sql2000

Author  Topic 

47273
Starting Member

2 Posts

Posted - 2007-07-13 : 10:28:24
Is there a possibility to import a table from sql 2000 into sql 2005 express?
I have a table exportet from sql2000 to csv, adjusted "FALSE" and "TRUE" into 0 and 1 and saved it to csv. Now I want to replace a table in the sql2005 DB by the csv. (The first row contains the header, each row contains a record.

I'm a n00b, as you can see ;)

Thanks for your help ;)

Peter

cas_o
Posting Yak Master

154 Posts

Posted - 2007-07-13 : 12:23:43
In the Sql Server 2005 Program Group (from start > Programs> Microsoft Sql Server 2005) open 'Sql Server Management Studio'

Connect to your Sql Server 2005 server,
Expand your server in the left hand pane,
Expand the Databases node,
Right click the database into which you wish to import the data,
Choose Tasks > Import Data ...
Read the blurb, Click next,
Choose FlatFileSource in the Data Source drop Down list,
Browse to your csv file (You may need to change the files of type drop down in the open file dialogue from *.txt to *.csv),
If the first row has column headings tick the box,
Click on 'Columns' in the left pane of the wizard dialogue check how the data looks in the preview,
Click next, you shouldn't need to change anything here if you followed my steps precisely so far, click next,
You can choose to have the csv inserted to a new table (I recommend this you can select them into another table using TSQL later if you want)
Click Next,
Execute immediately should be checked, click next,
Click finish

That's it job done.

Having done that, in the same proram group I mentioned earlier is documentation, something you will see commonly referred to as BOL (Books On-Line) this is Sql Servers manual. Search the index for bcp utility and Bulk Insert these are the more powerful ways of moving data into and between servers.

Look into linked servers in BOL, if both your servers are on the same private network you can move the data directly between them.

There are thousands of ways to do it. look up DTS in BOL that's another possiblity.

I have given you the easiest as this seams to be a one off and you state that you are new to SQL Server.

Good Luck. If you get stuck just post back here. Be as descriptive as possible and post any error messages in as much detail as possible and we will try our best to help.




;-]... Quack Waddle
Go to Top of Page

47273
Starting Member

2 Posts

Posted - 2007-08-15 : 04:47:06
Thanks for your help so far!

Unfortunately your first solution doesn't work.
You write "Choose Tasks > Import Data..."
When I look in the "Tasks"-menu I get the following options:
Detach...
Shrink >
Back-up...
Restore >
Generate scripts...

The whole "Import data"-option isn't there...

Is it because we work with MS SQL Server Management Studio Express?
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-08-15 : 21:55:09
I think so. Did you try with bcp or bulk insert?
Go to Top of Page
   

- Advertisement -