December 17, 2009 at 6:22 am
I'm pretty much a newbie at SQL administration, so I apologize if this is an easy thing. Long story short, a number of records got deleted that I have to restore from backup. I don't have the space on my SQL box to mount the backup, so I restored it to another server. So I need to move these records to my primary server. The records have Chinese characters, so I can't dump it as a SQL script. How do I get those records into my primary server?
December 21, 2009 at 1:17 pm
Don't know for sure if this would work but I think it will:
select into tempdb.dbo.mytable * from table where condition (if there are many rows that will be affected create the table tempdb.dbo.mytable first and instead of a select into do a plain insert/select.
in a DOS window:
bcp tempdb.dbo.mytable out mytable.n -Usa -P<your password> -S<YOUR SOURCE SERVERNAME> -n
after the rows are exported then:
bcp mytargetdatabase.dbo.mytable in mytable.n -Usa -P<your password> -S<YOUR TARGET SERVERNAME> -n
This should work since -n switch makes the data bcp'd out native in mode.
Carlos
December 24, 2009 at 10:50 am
I tried that, but I kept getting authentication errors. Not sure what was causing them, but they wouldn't go away.
I eventually used SQL Manager Lite for SQL Server (http://sqlmanager.net/products/mssql/manager) to export the query results to an Excel spreadsheet, then I made the necessary modifications and restored the data to the correct table. All worked fine.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply