Forum Replies Created

Viewing 15 posts - 151 through 165 (of 2,893 total)

  • RE: Help with Query

    mandrewthebarbarian (2/20/2014)


    I'm having trouble coding for a specific scenario that's occurring. This query, run over a 2008 R2 instance, uses a linked server to hit a DB2 file....

  • RE: Merge two tables into one.

    artistdedigital (2/20/2014)


    Merge means I want to get all the 6 columns(3 on each table) in to a new table...

    Select R1,R2,R3

    From Database.table1 as table.x

    Select C1,C2,C3

    From Database.table2 as table.y

    It may surprise you,...

  • RE: Merge two tables into one.

    ...I hope its kind of clear now 🙂

    ...

    Not at all. In your first piost you stated that :

    I have two totally different tables with completely different data fields.

    Which...

  • RE: Merge two tables into one.

    artistdedigital (2/18/2014)


    Hi all,

    I have two totally different tables with completely different data fields. Also, there is no common relationship between these two tables. However, I want to pick few data...

  • RE: Get number of rows successfully processed before executing a rollback

    ghanshyam.kundu (2/18/2014)


    Hi folks,

    is there any way to get the number of rows successfully processed before executing a rollback?

    suppose i am having three different SP's all three is having transaction and...

  • RE: SQL for adding flags depending on criteria

    Syntax looks right.

    Could you please post exact query you are trying to execute.

  • RE: linked server query performance degraded

    Number of columns is not linked directly to the problem, as if these additional 60 columns will contain no data, the size of moved data between servers will not change...

  • RE: Create Table Generates Msg 0

    you are using invalid sintax. Try:

    CREATE TABLE #Company(companyIDintNOT NULL IDENTITY(1,1)

    ,recnumintNOT...

  • RE: Only return id and desc for max date entry

    mattech06 (2/14/2014)


    Thanks for you're help guys. YB1D is the sql champion winner here! Eugene was also correct but as he mentioned we'd still get some multiple rows. Car, I've not...

  • RE: Only return id and desc for max date entry

    ;WITH MaxDtSchDetail

    AS

    (

    SELECT DISTINCT dbPatCnt, (SELECT MAX(dbSchDate)) AS MAXdbSchDate

    FROM dbo.SchDetail

    GROUP BY dbPatCnt

    )

    SELECT SD.dbPatCnt, SD.dbSchTypeCnt, SD.dbSchDate

    FROM MaxDtSchDetail AS MD

    JOIN dbo.SchDetail AS SD

    ON SD.dbPatCnt = MD.dbPatCnt

    AND SD.dbSchDate = MD.MAXdbSchDate

    But please note, if...

  • RE: Foreign Keys: Essential or Academic?

    venoym (2/13/2014)


    I'm going to be the lone guy here and go out on a limb...

    Don't you worry, you are not alone!

    Threre are plenty of cowboy developers around....

    😉

    Are you working...

  • RE: Self Join - Examples

    Just few examples:

    -- selecting row with maximum date:

    SELECT *

    FROM SomeTable st1

    JOIN (SELECT SomeID, MAX(SomeDateColumn) mxSomeDateColumn

    FROM SomeTable GROUP...

  • RE: Self Join - Examples

    Just few examples:

    -- selecting orw with maximum date

    SELECT *

    FROM SomeTable st1

    JOIN (SELECT SomeID, MAX(SomeDateColumn) mxSomeDateColumn

  • RE: foreign key references multiple tables

    ...

    Is there any other way which completely works like foreign key ?

    Set of properly implemented triggers will do.

    If you really want to go for complete extravaganza...

    :w00t:

  • RE: SQL for adding flags depending on criteria

    Actually, I guess I might know what you are trying to do:

    Do you want to list all customers and flag if there were any orders since some day?

    If...

Viewing 15 posts - 151 through 165 (of 2,893 total)