显示标签为“bcping”的博文。显示所有博文
显示标签为“bcping”的博文。显示所有博文

2012年3月25日星期日

BCP template using quoted text qualifiers

I'm dumping data from a table via BCP and when BCPing them back in to another table, it errors out on numeric and date fields. I'd like to place quote marks on the text fields. How do I do this using BCP?I'd say the other table does not match your structure of the first table

Where's the bcp command and the DDL of the tables.|||The tables are exactly the same. They are duplicates of one another just in different databases.
When I tried to manually import the file that that was exported using BCP I got the error stating that I was trying to put a string into a numeric field. When I exported the table manually with quotes, I had no problem importing it in to the other table.
Do you know how to export a table with the quotes around the text in the file using bcp?|||You can either:
- create a view or;
- create a procedure.

Within either you can embed any character to be part of the data you're trying to export. If it's a view, - use OUT, else - QUERYOUT.|||So there is no switch with the bcp command to put in quotes?sql

2012年2月25日星期六

BCP between two different servers

How would you go about bcp two tables from 2000 on server a and bcping it to
6.5 on server b?
New SQL Server DBA
BCP (OUT) to a file - BCP (IN) to the table on 6.5 See BCP in the SQL BOL
for more info on the syntax or run BCP /? from a CMD prompt.
HTH
Jerry
"Newbie" <Newbie@.discussions.microsoft.com> wrote in message
news:05E71CDA-B47C-4543-90E1-83EA6E084F3F@.microsoft.com...
> How would you go about bcp two tables from 2000 on server a and bcping it
> to
> 6.5 on server b?
> --
> New SQL Server DBA
|||Hi,
If both the servers are accessible in network then go for DTS from SQL 2000
machine.
Select Source as SQL 2000 and destination as SQL 6.5 in DTS.
If both the servers are not accessible each other then:-
1. BCP OUT from SQL 2000 (See to that all the data column width matches. Eg:
SQL 6.5 Varchar and Char only support 255 characters).
2. BCP IN into SQL 6.5
Thanks
hari
SQL Server MVP
"Newbie" <Newbie@.discussions.microsoft.com> wrote in message
news:05E71CDA-B47C-4543-90E1-83EA6E084F3F@.microsoft.com...
> How would you go about bcp two tables from 2000 on server a and bcping it
> to
> 6.5 on server b?
> --
> New SQL Server DBA

BCP between two different servers

How would you go about bcp two tables from 2000 on server a and bcping it to
6.5 on server b?
--
New SQL Server DBABCP (OUT) to a file - BCP (IN) to the table on 6.5 See BCP in the SQL BOL
for more info on the syntax or run BCP /? from a CMD prompt.
HTH
Jerry
"Newbie" <Newbie@.discussions.microsoft.com> wrote in message
news:05E71CDA-B47C-4543-90E1-83EA6E084F3F@.microsoft.com...
> How would you go about bcp two tables from 2000 on server a and bcping it
> to
> 6.5 on server b?
> --
> New SQL Server DBA|||Hi,
If both the servers are accessible in network then go for DTS from SQL 2000
machine.
Select Source as SQL 2000 and destination as SQL 6.5 in DTS.
If both the servers are not accessible each other then:-
1. BCP OUT from SQL 2000 (See to that all the data column width matches. Eg:
SQL 6.5 Varchar and Char only support 255 characters).
2. BCP IN into SQL 6.5
Thanks
hari
SQL Server MVP
"Newbie" <Newbie@.discussions.microsoft.com> wrote in message
news:05E71CDA-B47C-4543-90E1-83EA6E084F3F@.microsoft.com...
> How would you go about bcp two tables from 2000 on server a and bcping it
> to
> 6.5 on server b?
> --
> New SQL Server DBA

BCP between two different servers

How would you go about bcp two tables from 2000 on server a and bcping it to
6.5 on server b?
--
New SQL Server DBABCP (OUT) to a file - BCP (IN) to the table on 6.5 See BCP in the SQL BOL
for more info on the syntax or run BCP /? from a CMD prompt.
HTH
Jerry
"Newbie" <Newbie@.discussions.microsoft.com> wrote in message
news:05E71CDA-B47C-4543-90E1-83EA6E084F3F@.microsoft.com...
> How would you go about bcp two tables from 2000 on server a and bcping it
> to
> 6.5 on server b?
> --
> New SQL Server DBA|||Hi,
If both the servers are accessible in network then go for DTS from SQL 2000
machine.
Select Source as SQL 2000 and destination as SQL 6.5 in DTS.
If both the servers are not accessible each other then:-
1. BCP OUT from SQL 2000 (See to that all the data column width matches. Eg:
SQL 6.5 Varchar and Char only support 255 characters).
2. BCP IN into SQL 6.5
Thanks
hari
SQL Server MVP
"Newbie" <Newbie@.discussions.microsoft.com> wrote in message
news:05E71CDA-B47C-4543-90E1-83EA6E084F3F@.microsoft.com...
> How would you go about bcp two tables from 2000 on server a and bcping it
> to
> 6.5 on server b?
> --
> New SQL Server DBA