I am using a following statement in a sproc
insert into destination_table
select col1,col2,col3,col4 from source_table
For a certain row in the source_table the above insert
fails.
But its out of some 350 total records in source_table
How can I find which specific row/s is failing the
insert ?
ThanxPlease post the DDL of both tables plus the error message.
--
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com
"Anup B" <anonymous@.discussions.microsoft.com> wrote in message
news:0e7301c4e38a$f40be9f0$a601280a@.phx.gbl...
I am using a following statement in a sproc
insert into destination_table
select col1,col2,col3,col4 from source_table
For a certain row in the source_table the above insert
fails.
But its out of some 350 total records in source_table
How can I find which specific row/s is failing the
insert ?
Thanx|||Thanks for your help.
INSERT t_pick_detail ( order_number, line_number, type,
uom, work_type, status,item_number, lot_number,
unplanned_quantity,planned_quantity, pick_location,
picking_flow, staging_location,zone, wave_id,
load_id, load_sequence, stop_id, pick_area, wh_id)
SELECT orm.order_number, ord.line_number, 'PP', NULL,
NULL, 'UNPLANNED',item_number, lot_number, (qty - ISNULL
(pkd_planned,0)),0, NULL, 0 , NULL,NULL,
ord.host_wave_id, orm.load_id, orm.load_seq,
NULL, NULL, ord.wh_id
FROM t_order orm
JOIN t_order_detail ord
ON (orm.order_number = ord.order_number AND
orm.wh_id = ord.wh_id)
AND orm.status like @.in_status
AND ord.wh_id = @.in_WHID
t_order definition
--
wh_id varchar no 10
order_number varchar no 30
store_order_number varchar no 40
type_id int no 4
customer_id char no 15
cust_po_number varchar no 30
customer_name varchar no 100
customer_phone varchar no 30
customer_fax varchar no 30
customer_email varchar no 50
department char no 10
load_id varchar no 30
load_seq int no 4
bol_number char no 10
pro_number varchar no 20
master_bol_number char no 10
carrier varchar no 30
carrier_scac varchar no 4
freight_terms varchar no 10
rush char no 5
priority varchar no 3
order_date datetime no 8
arrive_date datetime no 8
actual_arrival_date datetime no 8
date_picked datetime no 8
date_expected datetime no 8
promised_date datetime no 8
weight float no 8
cubic_volume float no 8
containers int no 4
backorder char no 1
pre_paid char no 10
cod_amount float no 8
insurance_amount float no 8
pip_amount float no 8
freight_cost float no 8
region varchar no 5
bill_to_code char no 15
bill_to_name varchar no 30
bill_to_addr1 varchar no 30
bill_to_addr2 varchar no 30
bill_to_addr3 varchar no 30
bill_to_city varchar no 30
bill_to_state varchar no 3
bill_to_zip varchar no 12
bill_to_country_code char no 5
bill_to_country_name varchar no 30
bill_to_phone varchar no 30
ship_to_code char no 15
ship_to_name varchar no 30
ship_to_addr1 varchar no 30
ship_to_addr2 varchar no 30
ship_to_addr3 varchar no 30
ship_to_city varchar no 30
ship_to_state varchar no 3
ship_to_zip varchar no 12
ship_to_country_code char no 5
ship_to_country_name varchar no 30
ship_to_phone varchar no 30
delivery_name varchar no 30
delivery_addr1 varchar no 30
delivery_addr2 varchar no 30
delivery_addr3 varchar no 30
delivery_city varchar no 30
delivery_state varchar no 3
delivery_zip varchar no 12
delivery_country_code char no 5
delivery_country_name varchar no 30
delivery_phone varchar no 30
bill_frght_to_code char no 15
bill_frght_to_name varchar no 30
bill_frght_to_addr1 varchar no 30
bill_frght_to_addr2 varchar no 30
bill_frght_to_addr3 varchar no 30
bill_frght_to_city varchar no 30
bill_frght_to_state varchar no 3
bill_frght_to_zip varchar no 12
bill_frght_to_country_code char no 5
bill_frght_to_country_name varchar no 30
bill_frght_to_phone varchar no 30
return_to_code char no 30
return_to_name varchar no 30
return_to_addr1 varchar no 30
return_to_addr2 varchar no 30
return_to_addr3 varchar no 30
return_to_city varchar no 30
return_to_state varchar no 3
return_to_zip varchar no 12
return_to_country_code char no 5
return_to_country_name varchar no 30
return_to_phone varchar no 30
rma_number varchar no 40
rma_expiration_date datetime no 8
carton_label varchar no 10
ver_flag char no 4
full_pallets int no 4
haz_flag char no 10
order_wgt float no 8
status varchar no 20
zone varchar no 10
drop_ship char no 1
lock_flag varchar no 10
partial_order_flag char no 1
earliest_ship_date datetime no 8
latest_ship_date datetime no 8
actual_ship_date datetime no 8
earliest_delivery_date datetime no 8
latest_delivery_date datetime no 8
actual_delivery_date datetime no 8
route varchar no 30
order_amount float no 8
pick_type char no 1
invoiced_amount float no 8
t_pick_detail definition
--
pick_id int no 4
order_number varchar no 20
line_number varchar no 5
type char no 2
uom varchar no 10
work_q_id varchar no 30
work_type varchar no 2
label_number varchar no 22
status varchar no 10
item_number varchar no 30
lot_number varchar no 15
serial_number varchar no 30
unplanned_quantity float no 8
planned_quantity float no 8
picked_quantity float no 8
staged_quantity float no 8
loaded_quantity float no 8
pick_location varchar no 10
picking_flow varchar no 10
staging_location varchar no 10
zone varchar no 20
wave_id varchar no 20
load_id varchar no 30
load_sequence int no 4
stop_id varchar no 20
container_id varchar no 22
pick_category varchar no 10
user_assigned varchar no 10
bulk_pick_flag char no 1
stacking_sequence int no 4
pick_area varchar no 10
wh_id varchar no 10
requested_quantity float no 8
request_returned_qty float no 8
>--Original Message--
>Please post the DDL of both tables plus the error
message.
>--
>Tom
>----
--
>Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>SQL Server MVP
>Columnist, SQL Server Professional
>Toronto, ON Canada
>www.pinnaclepublishing.com
>
>"Anup B" <anonymous@.discussions.microsoft.com> wrote in
message
>news:0e7301c4e38a$f40be9f0$a601280a@.phx.gbl...
>I am using a following statement in a sproc
>insert into destination_table
>select col1,col2,col3,col4 from source_table
>For a certain row in the source_table the above insert
>fails.
>But its out of some 350 total records in source_table
>How can I find which specific row/s is failing the
>insert ?
>Thanx
>.
>|||1) You left out the definition for t_order_detail.
2) You did not give actual DDL - i.e. CREATE TABLE statements.
3) You did not post the error message.
4) Of the tables you did present, you have mismatched datatypes, which
may be the source of your problem.
--
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com
"Anup B" <anonymous@.discussions.microsoft.com> wrote in message
news:0e8401c4e38e$f1bad130$a601280a@.phx.gbl...
Thanks for your help.
INSERT t_pick_detail ( order_number, line_number, type,
uom, work_type, status,item_number, lot_number,
unplanned_quantity,planned_quantity, pick_location,
picking_flow, staging_location,zone, wave_id,
load_id, load_sequence, stop_id, pick_area, wh_id)
SELECT orm.order_number, ord.line_number, 'PP', NULL,
NULL, 'UNPLANNED',item_number, lot_number, (qty - ISNULL
(pkd_planned,0)),0, NULL, 0 , NULL,NULL,
ord.host_wave_id, orm.load_id, orm.load_seq,
NULL, NULL, ord.wh_id
FROM t_order orm
JOIN t_order_detail ord
ON (orm.order_number = ord.order_number AND
orm.wh_id = ord.wh_id)
AND orm.status like @.in_status
AND ord.wh_id = @.in_WHID
t_order definition
--
wh_id varchar no 10
order_number varchar no 30
store_order_number varchar no 40
type_id int no 4
customer_id char no 15
cust_po_number varchar no 30
customer_name varchar no 100
customer_phone varchar no 30
customer_fax varchar no 30
customer_email varchar no 50
department char no 10
load_id varchar no 30
load_seq int no 4
bol_number char no 10
pro_number varchar no 20
master_bol_number char no 10
carrier varchar no 30
carrier_scac varchar no 4
freight_terms varchar no 10
rush char no 5
priority varchar no 3
order_date datetime no 8
arrive_date datetime no 8
actual_arrival_date datetime no 8
date_picked datetime no 8
date_expected datetime no 8
promised_date datetime no 8
weight float no 8
cubic_volume float no 8
containers int no 4
backorder char no 1
pre_paid char no 10
cod_amount float no 8
insurance_amount float no 8
pip_amount float no 8
freight_cost float no 8
region varchar no 5
bill_to_code char no 15
bill_to_name varchar no 30
bill_to_addr1 varchar no 30
bill_to_addr2 varchar no 30
bill_to_addr3 varchar no 30
bill_to_city varchar no 30
bill_to_state varchar no 3
bill_to_zip varchar no 12
bill_to_country_code char no 5
bill_to_country_name varchar no 30
bill_to_phone varchar no 30
ship_to_code char no 15
ship_to_name varchar no 30
ship_to_addr1 varchar no 30
ship_to_addr2 varchar no 30
ship_to_addr3 varchar no 30
ship_to_city varchar no 30
ship_to_state varchar no 3
ship_to_zip varchar no 12
ship_to_country_code char no 5
ship_to_country_name varchar no 30
ship_to_phone varchar no 30
delivery_name varchar no 30
delivery_addr1 varchar no 30
delivery_addr2 varchar no 30
delivery_addr3 varchar no 30
delivery_city varchar no 30
delivery_state varchar no 3
delivery_zip varchar no 12
delivery_country_code char no 5
delivery_country_name varchar no 30
delivery_phone varchar no 30
bill_frght_to_code char no 15
bill_frght_to_name varchar no 30
bill_frght_to_addr1 varchar no 30
bill_frght_to_addr2 varchar no 30
bill_frght_to_addr3 varchar no 30
bill_frght_to_city varchar no 30
bill_frght_to_state varchar no 3
bill_frght_to_zip varchar no 12
bill_frght_to_country_code char no 5
bill_frght_to_country_name varchar no 30
bill_frght_to_phone varchar no 30
return_to_code char no 30
return_to_name varchar no 30
return_to_addr1 varchar no 30
return_to_addr2 varchar no 30
return_to_addr3 varchar no 30
return_to_city varchar no 30
return_to_state varchar no 3
return_to_zip varchar no 12
return_to_country_code char no 5
return_to_country_name varchar no 30
return_to_phone varchar no 30
rma_number varchar no 40
rma_expiration_date datetime no 8
carton_label varchar no 10
ver_flag char no 4
full_pallets int no 4
haz_flag char no 10
order_wgt float no 8
status varchar no 20
zone varchar no 10
drop_ship char no 1
lock_flag varchar no 10
partial_order_flag char no 1
earliest_ship_date datetime no 8
latest_ship_date datetime no 8
actual_ship_date datetime no 8
earliest_delivery_date datetime no 8
latest_delivery_date datetime no 8
actual_delivery_date datetime no 8
route varchar no 30
order_amount float no 8
pick_type char no 1
invoiced_amount float no 8
t_pick_detail definition
--
pick_id int no 4
order_number varchar no 20
line_number varchar no 5
type char no 2
uom varchar no 10
work_q_id varchar no 30
work_type varchar no 2
label_number varchar no 22
status varchar no 10
item_number varchar no 30
lot_number varchar no 15
serial_number varchar no 30
unplanned_quantity float no 8
planned_quantity float no 8
picked_quantity float no 8
staged_quantity float no 8
loaded_quantity float no 8
pick_location varchar no 10
picking_flow varchar no 10
staging_location varchar no 10
zone varchar no 20
wave_id varchar no 20
load_id varchar no 30
load_sequence int no 4
stop_id varchar no 20
container_id varchar no 22
pick_category varchar no 10
user_assigned varchar no 10
bulk_pick_flag char no 1
stacking_sequence int no 4
pick_area varchar no 10
wh_id varchar no 10
requested_quantity float no 8
request_returned_qty float no 8
>--Original Message--
>Please post the DDL of both tables plus the error
message.
>--
>Tom
>----
--
>Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>SQL Server MVP
>Columnist, SQL Server Professional
>Toronto, ON Canada
>www.pinnaclepublishing.com
>
>"Anup B" <anonymous@.discussions.microsoft.com> wrote in
message
>news:0e7301c4e38a$f40be9f0$a601280a@.phx.gbl...
>I am using a following statement in a sproc
>insert into destination_table
>select col1,col2,col3,col4 from source_table
>For a certain row in the source_table the above insert
>fails.
>But its out of some 350 total records in source_table
>How can I find which specific row/s is failing the
>insert ?
>Thanx
>.
>|||Thanks for looking at it , Tom
I have suggested the folks to use a loop method to insert
rather than the current method.
Thanks again.
>--Original Message--
>1) You left out the definition for t_order_detail.
>2) You did not give actual DDL - i.e. CREATE TABLE
statements.
>3) You did not post the error message.
>4) Of the tables you did present, you have mismatched
datatypes, which
>may be the source of your problem.
>--
>Tom
>----
--
>Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>SQL Server MVP
>Columnist, SQL Server Professional
>Toronto, ON Canada
>www.pinnaclepublishing.com
>
>"Anup B" <anonymous@.discussions.microsoft.com> wrote in
message
>news:0e8401c4e38e$f1bad130$a601280a@.phx.gbl...
>Thanks for your help.
>
>INSERT t_pick_detail ( order_number, line_number, type,
>uom, work_type, status,item_number, lot_number,
>unplanned_quantity,planned_quantity, pick_location,
>picking_flow, staging_location,zone, wave_id,
>load_id, load_sequence, stop_id, pick_area, wh_id)
>SELECT orm.order_number, ord.line_number, 'PP', NULL,
>NULL, 'UNPLANNED',item_number, lot_number, (qty - ISNULL
>(pkd_planned,0)),0, NULL, 0 , NULL,NULL,
>ord.host_wave_id, orm.load_id, orm.load_seq,
>NULL, NULL, ord.wh_id
>FROM t_order orm
> JOIN t_order_detail ord
> ON (orm.order_number = ord.order_number AND
> orm.wh_id = ord.wh_id)
>AND orm.status like @.in_status
>AND ord.wh_id = @.in_WHID
>t_order definition
>--
>wh_id varchar no 10
>order_number varchar no 30
>store_order_number varchar no 40
>type_id int no 4
>customer_id char no 15
>cust_po_number varchar no 30
>customer_name varchar no 100
>customer_phone varchar no 30
>customer_fax varchar no 30
>customer_email varchar no 50
>department char no 10
>load_id varchar no 30
>load_seq int no 4
>bol_number char no 10
>pro_number varchar no 20
>master_bol_number char no 10
>carrier varchar no 30
>carrier_scac varchar no 4
>freight_terms varchar no 10
>rush char no 5
>priority varchar no 3
>order_date datetime no 8
>arrive_date datetime no 8
>actual_arrival_date datetime no 8
>date_picked datetime no 8
>date_expected datetime no 8
>promised_date datetime no 8
>weight float no 8
>cubic_volume float no 8
>containers int no 4
>backorder char no 1
>pre_paid char no 10
>cod_amount float no 8
>insurance_amount float no 8
>pip_amount float no 8
>freight_cost float no 8
>region varchar no 5
>bill_to_code char no 15
>bill_to_name varchar no 30
>bill_to_addr1 varchar no 30
>bill_to_addr2 varchar no 30
>bill_to_addr3 varchar no 30
>bill_to_city varchar no 30
>bill_to_state varchar no 3
>bill_to_zip varchar no 12
>bill_to_country_code char no 5
>bill_to_country_name varchar no 30
>bill_to_phone varchar no 30
>ship_to_code char no 15
>ship_to_name varchar no 30
>ship_to_addr1 varchar no 30
>ship_to_addr2 varchar no 30
>ship_to_addr3 varchar no 30
>ship_to_city varchar no 30
>ship_to_state varchar no 3
>ship_to_zip varchar no 12
>ship_to_country_code char no 5
>ship_to_country_name varchar no 30
>ship_to_phone varchar no 30
>delivery_name varchar no 30
>delivery_addr1 varchar no 30
>delivery_addr2 varchar no 30
>delivery_addr3 varchar no 30
>delivery_city varchar no 30
>delivery_state varchar no 3
>delivery_zip varchar no 12
>delivery_country_code char no 5
>delivery_country_name varchar no 30
>delivery_phone varchar no 30
>bill_frght_to_code char no 15
>bill_frght_to_name varchar no 30
>bill_frght_to_addr1 varchar no 30
>bill_frght_to_addr2 varchar no 30
>bill_frght_to_addr3 varchar no 30
>bill_frght_to_city varchar no 30
>bill_frght_to_state varchar no 3
>bill_frght_to_zip varchar no 12
>bill_frght_to_country_code char no 5
>bill_frght_to_country_name varchar no 30
>bill_frght_to_phone varchar no 30
>return_to_code char no 30
>return_to_name varchar no 30
>return_to_addr1 varchar no 30
>return_to_addr2 varchar no 30
>return_to_addr3 varchar no 30
>return_to_city varchar no 30
>return_to_state varchar no 3
>return_to_zip varchar no 12
>return_to_country_code char no 5
>return_to_country_name varchar no 30
>return_to_phone varchar no 30
>rma_number varchar no 40
>rma_expiration_date datetime no 8
>carton_label varchar no 10
>ver_flag char no 4
>full_pallets int no 4
>haz_flag char no 10
>order_wgt float no 8
>status varchar no 20
>zone varchar no 10
>drop_ship char no 1
>lock_flag varchar no 10
>partial_order_flag char no 1
>earliest_ship_date datetime no 8
>latest_ship_date datetime no 8
>actual_ship_date datetime no 8
>earliest_delivery_date datetime no 8
>latest_delivery_date datetime no 8
>actual_delivery_date datetime no 8
>route varchar no 30
>order_amount float no 8
>pick_type char no 1
>invoiced_amount float no 8
>
>t_pick_detail definition
>--
>
>pick_id int no 4
>order_number varchar no 20
>line_number varchar no 5
>type char no 2
>uom varchar no 10
>work_q_id varchar no 30
>work_type varchar no 2
>label_number varchar no 22
>status varchar no 10
>item_number varchar no 30
>lot_number varchar no 15
>serial_number varchar no 30
>unplanned_quantity float no 8
>planned_quantity float no 8
>picked_quantity float no 8
>staged_quantity float no 8
>loaded_quantity float no 8
>pick_location varchar no 10
>picking_flow varchar no 10
>staging_location varchar no 10
>zone varchar no 20
>wave_id varchar no 20
>load_id varchar no 30
>load_sequence int no 4
>stop_id varchar no 20
>container_id varchar no 22
>pick_category varchar no 10
>user_assigned varchar no 10
>bulk_pick_flag char no 1
>stacking_sequence int no 4
>pick_area varchar no 10
>wh_id varchar no 10
>requested_quantity float no 8
>request_returned_qty float no 8
>>--Original Message--
>>Please post the DDL of both tables plus the error
>message.
>>--
>>Tom
>>---
-
>--
>>Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>>SQL Server MVP
>>Columnist, SQL Server Professional
>>Toronto, ON Canada
>>www.pinnaclepublishing.com
>>
>>"Anup B" <anonymous@.discussions.microsoft.com> wrote in
>message
>>news:0e7301c4e38a$f40be9f0$a601280a@.phx.gbl...
>>I am using a following statement in a sproc
>>insert into destination_table
>>select col1,col2,col3,col4 from source_table
>>For a certain row in the source_table the above insert
>>fails.
>>But its out of some 350 total records in source_table
>>How can I find which specific row/s is failing the
>>insert ?
>>Thanx
>>.
>.
>|||Reconsider your approach. It will take _much_ longer. It will be much
faster if you simply post the DDL and the error message.
--
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com
<anonymous@.discussions.microsoft.com> wrote in message
news:0a5501c4e39e$f909e650$a401280a@.phx.gbl...
Thanks for looking at it , Tom
I have suggested the folks to use a loop method to insert
rather than the current method.
Thanks again.
>--Original Message--
>1) You left out the definition for t_order_detail.
>2) You did not give actual DDL - i.e. CREATE TABLE
statements.
>3) You did not post the error message.
>4) Of the tables you did present, you have mismatched
datatypes, which
>may be the source of your problem.
>--
>Tom
>----
--
>Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>SQL Server MVP
>Columnist, SQL Server Professional
>Toronto, ON Canada
>www.pinnaclepublishing.com
>
>"Anup B" <anonymous@.discussions.microsoft.com> wrote in
message
>news:0e8401c4e38e$f1bad130$a601280a@.phx.gbl...
>Thanks for your help.
>
>INSERT t_pick_detail ( order_number, line_number, type,
>uom, work_type, status,item_number, lot_number,
>unplanned_quantity,planned_quantity, pick_location,
>picking_flow, staging_location,zone, wave_id,
>load_id, load_sequence, stop_id, pick_area, wh_id)
>SELECT orm.order_number, ord.line_number, 'PP', NULL,
>NULL, 'UNPLANNED',item_number, lot_number, (qty - ISNULL
>(pkd_planned,0)),0, NULL, 0 , NULL,NULL,
>ord.host_wave_id, orm.load_id, orm.load_seq,
>NULL, NULL, ord.wh_id
>FROM t_order orm
> JOIN t_order_detail ord
> ON (orm.order_number = ord.order_number AND
> orm.wh_id = ord.wh_id)
>AND orm.status like @.in_status
>AND ord.wh_id = @.in_WHID
>t_order definition
>--
>wh_id varchar no 10
>order_number varchar no 30
>store_order_number varchar no 40
>type_id int no 4
>customer_id char no 15
>cust_po_number varchar no 30
>customer_name varchar no 100
>customer_phone varchar no 30
>customer_fax varchar no 30
>customer_email varchar no 50
>department char no 10
>load_id varchar no 30
>load_seq int no 4
>bol_number char no 10
>pro_number varchar no 20
>master_bol_number char no 10
>carrier varchar no 30
>carrier_scac varchar no 4
>freight_terms varchar no 10
>rush char no 5
>priority varchar no 3
>order_date datetime no 8
>arrive_date datetime no 8
>actual_arrival_date datetime no 8
>date_picked datetime no 8
>date_expected datetime no 8
>promised_date datetime no 8
>weight float no 8
>cubic_volume float no 8
>containers int no 4
>backorder char no 1
>pre_paid char no 10
>cod_amount float no 8
>insurance_amount float no 8
>pip_amount float no 8
>freight_cost float no 8
>region varchar no 5
>bill_to_code char no 15
>bill_to_name varchar no 30
>bill_to_addr1 varchar no 30
>bill_to_addr2 varchar no 30
>bill_to_addr3 varchar no 30
>bill_to_city varchar no 30
>bill_to_state varchar no 3
>bill_to_zip varchar no 12
>bill_to_country_code char no 5
>bill_to_country_name varchar no 30
>bill_to_phone varchar no 30
>ship_to_code char no 15
>ship_to_name varchar no 30
>ship_to_addr1 varchar no 30
>ship_to_addr2 varchar no 30
>ship_to_addr3 varchar no 30
>ship_to_city varchar no 30
>ship_to_state varchar no 3
>ship_to_zip varchar no 12
>ship_to_country_code char no 5
>ship_to_country_name varchar no 30
>ship_to_phone varchar no 30
>delivery_name varchar no 30
>delivery_addr1 varchar no 30
>delivery_addr2 varchar no 30
>delivery_addr3 varchar no 30
>delivery_city varchar no 30
>delivery_state varchar no 3
>delivery_zip varchar no 12
>delivery_country_code char no 5
>delivery_country_name varchar no 30
>delivery_phone varchar no 30
>bill_frght_to_code char no 15
>bill_frght_to_name varchar no 30
>bill_frght_to_addr1 varchar no 30
>bill_frght_to_addr2 varchar no 30
>bill_frght_to_addr3 varchar no 30
>bill_frght_to_city varchar no 30
>bill_frght_to_state varchar no 3
>bill_frght_to_zip varchar no 12
>bill_frght_to_country_code char no 5
>bill_frght_to_country_name varchar no 30
>bill_frght_to_phone varchar no 30
>return_to_code char no 30
>return_to_name varchar no 30
>return_to_addr1 varchar no 30
>return_to_addr2 varchar no 30
>return_to_addr3 varchar no 30
>return_to_city varchar no 30
>return_to_state varchar no 3
>return_to_zip varchar no 12
>return_to_country_code char no 5
>return_to_country_name varchar no 30
>return_to_phone varchar no 30
>rma_number varchar no 40
>rma_expiration_date datetime no 8
>carton_label varchar no 10
>ver_flag char no 4
>full_pallets int no 4
>haz_flag char no 10
>order_wgt float no 8
>status varchar no 20
>zone varchar no 10
>drop_ship char no 1
>lock_flag varchar no 10
>partial_order_flag char no 1
>earliest_ship_date datetime no 8
>latest_ship_date datetime no 8
>actual_ship_date datetime no 8
>earliest_delivery_date datetime no 8
>latest_delivery_date datetime no 8
>actual_delivery_date datetime no 8
>route varchar no 30
>order_amount float no 8
>pick_type char no 1
>invoiced_amount float no 8
>
>t_pick_detail definition
>--
>
>pick_id int no 4
>order_number varchar no 20
>line_number varchar no 5
>type char no 2
>uom varchar no 10
>work_q_id varchar no 30
>work_type varchar no 2
>label_number varchar no 22
>status varchar no 10
>item_number varchar no 30
>lot_number varchar no 15
>serial_number varchar no 30
>unplanned_quantity float no 8
>planned_quantity float no 8
>picked_quantity float no 8
>staged_quantity float no 8
>loaded_quantity float no 8
>pick_location varchar no 10
>picking_flow varchar no 10
>staging_location varchar no 10
>zone varchar no 20
>wave_id varchar no 20
>load_id varchar no 30
>load_sequence int no 4
>stop_id varchar no 20
>container_id varchar no 22
>pick_category varchar no 10
>user_assigned varchar no 10
>bulk_pick_flag char no 1
>stacking_sequence int no 4
>pick_area varchar no 10
>wh_id varchar no 10
>requested_quantity float no 8
>request_returned_qty float no 8
>>--Original Message--
>>Please post the DDL of both tables plus the error
>message.
>>--
>>Tom
>>---
-
>--
>>Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>>SQL Server MVP
>>Columnist, SQL Server Professional
>>Toronto, ON Canada
>>www.pinnaclepublishing.com
>>
>>"Anup B" <anonymous@.discussions.microsoft.com> wrote in
>message
>>news:0e7301c4e38a$f40be9f0$a601280a@.phx.gbl...
>>I am using a following statement in a sproc
>>insert into destination_table
>>select col1,col2,col3,col4 from source_table
>>For a certain row in the source_table the above insert
>>fails.
>>But its out of some 350 total records in source_table
>>How can I find which specific row/s is failing the
>>insert ?
>>Thanx
>>.
>.
>|||anonymous@.discussions.microsoft.com wrote:
> Thanks for looking at it , Tom
> I have suggested the folks to use a loop method to insert
> rather than the current method.
> Thanks again.
>
Are you the OP? If so, are you suggesting that a looping construct
inserting a row at a time will be faster than a single insert statement?
Before commiting to that design, some testing is in order.
--
David Gugick
Imceda Software
www.imceda.com
没有评论:
发表评论