Forum Replies Created

Viewing 15 posts - 22,261 through 22,275 (of 59,072 total)

  • RE: Best way for dynamic partitioning of table sql server

    BI_NewBie (12/3/2014)


    Hey Jeff!!

    Thanks for your reply.

    In my database, there is a transaction table whose row count is 117690142. There are index created on column but still when we fire any...

    --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: Best way for dynamic partitioning of table sql server

    BI_NewBie (12/3/2014)


    Hello all,

    Greetings!

    I need suggestion on Dynamic Partition of SQL Table. I have done my homework on this topic but still below questions are still stuck in my mind.

    1. ...

    --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: Convert Integer to Time

    Jeff Moden (12/3/2014)


    craig.bobchin (12/3/2014)


    Got it!!!

    declare @MaxRowdateTime datetime

    select @MaxRowdateTime = max(DATEADD(day, DATEDIFF(day,'19000101',row_date), CAST(CONVERT( TIME, STUFF( RIGHT( '0000' + CONVERT( VARCHAR(5), starttime), 4), 3, 0, ':')) AS DATETIME2(7)))) from [avaya].[dbo].[hSplit]

    select

    DATEADD(day,...

    --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: Convert Integer to Time

    craig.bobchin (12/3/2014)


    Got it!!!

    declare @MaxRowdateTime datetime

    select @MaxRowdateTime = max(DATEADD(day, DATEDIFF(day,'19000101',row_date), CAST(CONVERT( TIME, STUFF( RIGHT( '0000' + CONVERT( VARCHAR(5), starttime), 4), 3, 0, ':')) AS DATETIME2(7)))) from [avaya].[dbo].[hSplit]

    select

    DATEADD(day, DATEDIFF(day,'19000101',row_date), CAST(CONVERT(...

    --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: Convert Integer to Time

    craig.bobchin (12/3/2014)


    Thanks that worked. How can I concatenate this with a date field. neither '&' nor '+' seem to work.

    Is the date "field" an Integer, as well? If...

    --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: Please vote for the "built in Tally Table" function.

    CELKO (12/3/2014)


    But SQL also has the goal of orthogonality and that means re-use of existing syntax constructs when possible. This table is not a function; it is a set, not...

    --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: Select rows with AFTER INSERT trigger?

    simflex-897410 (12/3/2014)


    We have a vendor app that can't be modified.

    However, we are allowed to manipulated what they call custom fields.

    These custom fields are literally called field1, field2... up to filed5.

    Right...

    --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: Convert Integer to Time

    craig.bobchin (12/3/2014)


    Hi all,

    I've got a column that holds a time value in Integer form as a number from midnight (IE military time) with no leading 0s or colons.

    0 = 00:00

    30...

    --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: Last 30 days aggregate query

    clayman (12/3/2014)


    Thanks, figured it out. The second solution seems to run ~6-7 times faster.

    Do you have the index that I recommended?

    --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: xp_cmdshell issues

    IO got lucky... or maybe my Yabingooglewho has gotten a lot better and I found it on the first shot.

    http://www.sommarskog.se/grantperm.html

    --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: xp_cmdshell issues

    schleep (12/3/2014)


    djj provided the link above. I'm looking into it now...

    That's not one of Erland Sommarskogs articles, which I highly recommend.

    I'm looking for his stuff on the subject now.

    --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: xp_cmdshell issues

    Emil Bialobrzeski (12/3/2014)


    schleep (12/3/2014)


    If you give someone ability to impersonate sa he would be able to execute any piece of scrip as sa

    Exec 'drop table x' as login = 'sa'

    Which...

    --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: Please vote for the "built in Tally Table" function.

    Probably not, Joe. There are already a whole bunch of workarounds that are as fast as or faster and certainly easier to use than a SEQUENCE, if I understand...

    --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: xp_cmdshell issues

    schleep (12/3/2014)


    So, set the sa account to Disabled, but change db owner to sa (or is "SA" referring to something else?)? Counter-intuitive is right!

    Yes. The owner of the database...

    --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: How to get DATETIME number?

    CELKO (12/2/2014)


    It has nothing to do with the physical storage like your silly IDENTITY. A file needs a unique physical storage locator, like a record number.

    In SQL Server, an...

    --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 - 22,261 through 22,275 (of 59,072 total)