The field value is connected to a string.

Source: Internet
Author: User
Set ansi_nulls on
Set quoted_identifier on
Go


Alter procedure [DBO]. [ccc_isuploadphysicaldel]

As
Begin

-- ============= Author: Connie Chen
-- ============= Create time: 16:04:00. 893
-- ============== Description: Get all fids from Table ccc_tadetail. It prepare to upload into as400.
Declare @ detailfids varchar (2000)

Select
@ Detailfids = coalesce (@ detailfids + ',', '') + Cast (ccc_del_tadetail.deletiontableprimaryid as varchar (10 ))
From
(
Select Top 100 * From ccc_deletionsync
Where
Deletiontable = 1 and isuploaded is null
) Ccc_del_tadetail

-- ============= Author: Connie Chen
-- ============= Create time: 16:04:00. 893
-- ============== Description: Get all fids from Table ccc_deliveryconfirminfo. It prepare to upload into as400.
Declare @ deliveryconfirmids varchar (2000)

Select
@ Deliveryconfirmids = coalesce (@ deliveryconfirmids + ',', '') + Cast (ccc_del_deliveryconfirm.deletiontableprimaryid as varchar (10 ))
From
(
Select Top 100 * From ccc_deletionsync
Where
Deletiontable = 2 and isuploaded is null
) Ccc_del_deliveryconfirm

-- ============= Author: Connie Chen
-- ============= Create time: 16:04:00. 893
-- ============== Description: Get all ID from Table ccc_deletionsync
Select
Len (@ detailfids) as idlens, @ detailfids as IDS, deletiontable, 'ccc _ tadetail 'As deletiontablename
From
Ccc_deletionsync
Where deletiontable = 1 and isuploaded is null
Group by deletiontable


Union
(
Select
Len (@ deliveryconfirmids) as idlens, @ deliveryconfirmids as IDS, deletiontable, 'ccc _ dliveryconfrimin 'As deletiontablename
From
Ccc_deletionsync
Where deletiontable = 2 and isuploaded is null
Group by deletiontable
)

End

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.