| |

VerySource

 Forgot password?
 Register
Search
View: 621|Reply: 4

bcp transfer data, different table order

[Copy link]

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 United States

Post time: 2020-2-5 00:30:02
| Show all posts |Read mode
I have table (id int, name varchar, date2 datetime)
table 2 (date2 datetime, name varchar, id int)


The column datatypes are the same, but in a different order.
Now want to use bcp to transfer data from table to table 2
How to do?
I will report an error directly,

Msg 257, Level 16, State 3, Line 1
Implicit conversion from data type datetime to int is not allowed. Use the CONVERT function to run this query.
Reply

Use magic Report

0

Threads

66

Posts

27.00

Credits

Newbie

Rank: 1

Credits
27.00

 China

Post time: 2020-3-22 22:45:01
| Show all posts
Output in queryout
Reply

Use magic Report

0

Threads

66

Posts

27.00

Credits

Newbie

Rank: 1

Credits
27.00

 China

Post time: 2020-3-22 23:45:01
| Show all posts
Specify field order
Reply

Use magic Report

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 United States

 Author| Post time: 2020-3-25 14:30:02
| Show all posts
Because there are many tables to bcp, such as specifying the order of the fields is definitely not flexible
Reply

Use magic Report

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 United States

 Author| Post time: 2020-3-26 20:00:01
| Show all posts
Output in queryout mode, very strong Ah! Can it support input parameters? variable?
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list