Forum Replies Created

Viewing 15 posts - 54,586 through 54,600 (of 59,072 total)

  • RE: Arranging the data??

    Just curious... why do you have the same ID for 3 different people?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: I need help with updating multiple columns in a table

    Whew! Yeah, I knew the *= and =* outer joins would sometimes cough up bad results... they actually started going bad in SQL Server 7... I'm surprised they didn't...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Unstring text field?

    Lowell (10/15/2007)


    the DBA toolkit here on SSC has regular expressions as extended stored procedures for SQL2K; i use it all the time.

    Thanks for the tip, Lowell...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: NEWID() structure

    Correct... and it's not a good idea to base things on the system clock... SQL Server only has a resolution of 3.3 milliseconds... a lot can happen in that...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: I need help with updating multiple columns in a table

    You've seen simple equi-joins go bad? Any chance you have an example of one that has gone bad?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Unstring text field?

    Heh... too bad I don't have SQL Server 2k5, yet... would be an interesting test 'cause, you're right, Regex is very fast.

    The fastest option, though, would be to have correctly...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Delete Temp Table within a Cursor

    I agree... it seems like the called proc is for a GUI. If it's not too complex (or even if it is), you might want to consider rewritting it...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Unstring text field?

    Agreed... 🙂

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Unstring text field?

    Great! Thanks for the feedback, Bob!

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Actual Reason to Use CLR

    jezemine (10/13/2007)


    this is unlikely, unless the DBA is uneducated about the CLR.

    any DBA that doesn't allow use of xp_cmdshell is likely not going to allow the import of...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Determine field names of stored proc return

    What do you mean by "client side data table", Lowell?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Table matching (tricky perhaps)

    When you get what you want, please post your solution. Thanks. 😉

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Combining Query Results

    Heh... you just need to look it in the eye... 😉

    [font="Courier New"]

    --=====&nbspThis&nbspis&nbspjust&nbspto&nbspbuild&nbspsome&nbspsample&nbspdata&nbspand&nbspis&nbspNOT&nbsppart&nbspof&nbspthe&nbspsolution

    DECLARE&nbsp@yourtable&nbspTABLE&nbsp(FromUser&nbspVARCHAR(10),&nbspToUser&nbspVARCHAR(10),&nbspDate&nbspDATETIME)

    &nbspINSERT&nbspINTO&nbsp@yourtable&nbsp(FromUser,&nbspToUser,&nbspDate)

    &nbspSELECT&nbsp'user1','user2',&nbsp'20070115'&nbspUNION&nbspALL

    &nbspSELECT&nbsp'user2','user1',&nbsp'20070116'&nbspUNION&nbspALL

    &nbspSELECT&nbsp'user1','user2',&nbsp'20070117'&nbspUNION&nbspALL

    &nbspSELECT&nbsp'user1','user3',&nbsp'20070118'&nbspUNION&nbspALL

    &nbspSELECT&nbsp'user3','user1',&nbsp'20070118'&nbspUNION&nbspALL

    &nbspSELECT&nbsp'user1','user2',&nbsp'20070201'&nbspUNION&nbspALL

    &nbspSELECT&nbsp'user2','user1',&nbsp'20070205'&nbspUNION&nbspALL

    &nbspSELECT&nbsp'user1','user2',&nbsp'20070301'&nbspUNION&nbspALL

    &nbspSELECT&nbsp'user1','user3',&nbsp'20070310'&nbspUNION&nbspALL

    &nbspSELECT&nbsp'user3','user1',&nbsp'20070311'

    --=====&nbspThis&nbspis&nbspthe&nbspsolution

    &nbspSELECT&nbspd.FromUser,&nbspd.ToUser,&nbspd.YrMon,&nbspCOUNT(*)&nbspAS&nbspTimesConnected

    &nbsp&nbsp&nbspFROM&nbsp(--====&nbspDerived&nbsptable&nbspswaps&nbspusers&nbspwhen&nbspneeded

    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspSELECT&nbspFromUser,&nbsp

    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspToUser,

    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspREPLACE(CONVERT(CHAR(7),Date,102),'.','-')&nbspAS&nbspYrMon

    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspFROM&nbsp@yourtable

    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspWHERE&nbspFromUser&nbsp<&nbspToUser

    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspUNION&nbspALL

    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspSELECT&nbspToUser&nbspAS&nbspFromUser,

    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspFromUser&nbspAS&nbspToUser,

    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspREPLACE(CONVERT(CHAR(7),Date,102),'.','-')&nbspAS&nbspYrMon

    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspFROM&nbsp@yourtable

    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspWHERE&nbspToUser&nbsp<=&nbspFromUser

    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp)&nbspd

    &nbsp&nbspGROUP&nbspBY&nbspd.FromUser,&nbspd.ToUser,&nbspd.YrMon

    [/font]

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Reading flat files from TSQL

    You really think filtering on an OPENROWSET would be faster than just importing the table?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: I need help with updating multiple columns in a table

    This isn't Oracle... no need to slow down the update with correlated subqueries like that... just do a simple join like some of the other posters have.

    Recommend you lookup UPDATE...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 15 posts - 54,586 through 54,600 (of 59,072 total)