Forum Replies Created

Viewing 5 posts - 16 through 20 (of 20 total)

  • RE: Inserting Where values don't Exist

    USE dba

    GO

    CREATE TABLE u_apppreferences (

    NAME VARCHAR(500)

    ,val VARCHAR(500)

    );

    DECLARE @name AS VARCHAR(500),@VAL AS VARCHAR(500);

    SET @name = 'Manual';

    SET @val = '-53';

    IF NOT EXISTS (

    SELECT 1

    FROM u_apppreferences

    WHERE NAME = @name

    AND val =...

  • RE: not able to find why/where this error is comming.

    Are you using Try-Catch for handling the errors?

    Remember the 'TRY' will immediately jump to the CATCH when there is an error.

    Then, when you're in the CATCH, and if...

  • RE: Need Help in Understanding

    I did combine your both queries using CTE. Yes, union will also work, but CTE is much faster and efficient.

  • RE: Need Help in Understanding

    ;with PurchaseCTE as (

    select

    tblP.Product_Code,

    tblC.DescriptionLanguage_1,

    sum(tblPIID.QtyReceived1

    + tblPIID.QtyReceived2

    + tblPIID.QtyReceived3

    + tblPIID.QtyReceived4

    + tblPIID.QtyReceived5

    + tblPIID.QtyReceived6

    + tblPIID.QtyReceived7

    + tblPIID.QtyReceived8

    + tblPIID.QtyReceived9

    + tblPIID.QtyReceived10

    + tblPIID.QtyReceived11

    + tblPIID.QtyReceived12

    + tblPIID.QtyReceived13

    + tblPIID.QtyReceived14

    + tblPIID.QtyReceived15

    + tblPIID.QtyReceived16

    + tblPIID.QtyReceived17

    +...

  • RE: Need Help in Understanding

    with MSCTE as (

    select

    tblP.Product_Code,

    tblC.DescriptionLanguage_1,

    sum(tblPIID.QtyReceived1

    + tblPIID.QtyReceived2

    + tblPIID.QtyReceived3

    + tblPIID.QtyReceived4

    + tblPIID.QtyReceived5

    + tblPIID.QtyReceived6

    + tblPIID.QtyReceived7

    + tblPIID.QtyReceived8

    + tblPIID.QtyReceived9

    + tblPIID.QtyReceived10

    + tblPIID.QtyReceived11

    + tblPIID.QtyReceived12

    + tblPIID.QtyReceived13

    + tblPIID.QtyReceived14

    + tblPIID.QtyReceived15

    + tblPIID.QtyReceived16

    + tblPIID.QtyReceived17

    +...

Viewing 5 posts - 16 through 20 (of 20 total)