Forum Replies Created

Viewing 15 posts - 1 through 15 (of 33 total)

  • RE: COUNTING TIME DIFFERENCE IN YEAR, MONTH, DAYS

    Dear all,

    thank you so much for the explaining and the syntax.
    Now i have  options to choose..

  • RE: COUNTING TIME DIFFERENCE IN YEAR, MONTH, DAYS

    Dear all, 

    I made the Stored procedure to search Years, Months, days by looping
    @EXP_DATE --> Expired_Date


    SELECT @@DIFF = DATEDIFF(DAY, GETDATE(),@EXP_DATE)
    SELECT @@DIFF1 = DATEDIFF(DAY,@EXP_DATE,GETDATE())

  • RE: COUNTING TIME DIFFERENCE IN YEAR, MONTH, DAYS

    thank you Jhon and Kingston for the link

  • RE: COUNTING TIME DIFFERENCE IN YEAR, MONTH, DAYS

    John Mitchell-245523 - Monday, January 16, 2017 2:13 AM

    Use the DATEDIFF function to get the number of years, then use DATEADD to add...

  • RE: Update Table Left Join Linkserver

    whenriksen (11/30/2016)


    On an unrelated note, you've created these objects in the master database. That is a very bad idea. If at all possible, you should move those to...

  • RE: using output statement from merge to populatet an audit table

    azdeji (11/28/2016)


    Hi

    Iā€™m attempting use the output statement to populate the audit table for scd1 columns that are overwritten from a merge into a secondary history table ā€“

    That shows the...

  • RE: Which connection-driver are used

    info 58414 (11/23/2016)


    Hi,

    How can i get the information from all dtsx packages

    which driver is used (maybe with dll-file and path)

    Thanks

    Regards

    Nicole

    šŸ˜‰

    hii,,

    Try using dtexec Utility (SSIS Tool)

  • RE: different table content

    WhiteLotus (11/23/2016)


    Hi all ,

    I have to compare all tables in 2 databases . these 2 databases have the same table structure but different content

    If the content in table A...

  • RE: Using Merge to insert data but failed

    DesNorton (11/18/2016)


    Deny Christian (11/18/2016)


    So, it will take only 1 data if there are 3 data at the Source ?

    The MERGE statement will take all of the data that you provide...

  • RE: Using Merge to insert data but failed

    DesNorton (11/18/2016)


    OK. So it seems that your TEMP_SUPPLIER has duplicate values for SUPPLIER_CODE.

    To prove this, let's create a simple data set that will cause the PK error

    CREATE TABLE #M_SUPPLIER...

  • RE: Using Merge to insert data but failed

    DesNorton (11/17/2016)


    Please supply table structures for M_SUPPLIER and TEMP_SUPPLIER, as well as sample data that will consistantly cause the error that you are getting.

    --M_SUPPLIER

    Column_nameTypeComputedLengthPrecScaleNullableTrimTrailingBlanksFixedLenNullInSourceCollation

    SUPPLIER_CODE(PK) varcharno6 ...

  • RE: Using Merge to insert data but failed

    DesNorton (11/17/2016)


    MERGE M_SUPPLIER A --- TARGET

    USING TEMP_SUPPLIER B --- SOURCE DUMMY

    ON A.SUPPLIER_CODE = B.SUPPLIER_CODE

    -- You are matching on A.SUPPLIER_CODE = B.SUPPLIER_CODE

    -- Then you say WHEN A.SUPPLIER_CODE <> B.SUPPLIER_CODE

    WHEN MATCHED --AND...

  • RE: Update Table Left Join Linkserver

    John Mitchell-245523 (11/17/2016)


    Not if there's no row to update, no. But say, for example, you were testing for rows that have a match on m_id but have different values...

  • RE: Update Table Left Join Linkserver

    John Mitchell-245523 (11/17/2016)


    But if the data doesn't exist at the destination server, there's nothing to update. You need to do an INSERT instead. In the absence of the...

  • RE: Update Table Left Join Linkserver

    John Mitchell-245523 (11/17/2016)


    You are using SQL Server, aren't you? What version?

    Your update statement doesn't make sense, either. You're updating to set m_id in the outer table to be...

Viewing 15 posts - 1 through 15 (of 33 total)