A Simple SQL DELETE in a Stored Proc in my Pipeline, but isn't deleting rows from the DB

Mike Kiser 1,536 Reputation points
2021-03-18T03:31:01.943+00:00

Hi! @Nasreen Akter @HimanshuSinha-msft

This is so simple it's almost embarrassing to post. I have a DELETE SQL Statement, but it is NOT deleting the rows where phoneIsPrimary = 'False' and I have tried several things. I use this in a Stored Procedure Activity in my Pipeline.

DELETE
FROM
[MercerStagingDev].[MILKY-WAYTEST\AppSQLVST4DotNetDev-R].[SSFCeridianMappedFileV5]
WHERE
phoneIsPrimary= 'False';

Please see
78948-image.png

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,623 questions
Developer technologies Transact-SQL
{count} votes

Accepted answer
  1. MelissaMa-MSFT 24,221 Reputation points
    2021-03-18T04:53:31.87+00:00

    HI @Mike Kiser ,

    Welcome to Microsoft Q&A!

    As mentioned by Nandan, please provide the output of below query via SSMS.

    Select * FROM  
    [MercerStagingDev].[MILKY-WAYTEST\AppSQLVST4DotNetDev-R].[SSFCeridianMappedFileV5]  
    WHERE phoneIsPrimary= 'False';  
    

    Besides, what is the data type of phoneIsPrimary? If it is bit, you could also have a try with below:

    DELETE FROM  
    [MercerStagingDev].[MILKY-WAYTEST\AppSQLVST4DotNetDev-R].[SSFCeridianMappedFileV5]  
    WHERE phoneIsPrimary= 0;  
    

    If above is not working, we recommend that you post CREATE TABLE statements for your tables together with INSERT statements with sample data, enough to illustrate all angles of the problem. We also need to see the expected result of the sample.

    Best regards
    Melissa


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.