Forum Replies Created

Viewing 15 posts - 24,781 through 24,795 (of 59,099 total)

  • RE: Convert UTC datetime to LocalTime Zone.

    Sean Lange (9/6/2011)


    That will work if all the users are in the same timezone as the server. Otherwise you will have to determine which timezone they are in.

    Good point...

    --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: SQL Server Troubleshooting

    TheSQLGuru (1/10/2014)


    It has been my experience in 15 years of consulting on SQL Server that the vast majority of stuff you need to deal with, fix, improve, etc. with SQL...

    --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: Deployment accounts and best practice

    I agree with Grant. If you're responsible only for given databases, you should have only dbo privs as a max. I would also strongly recommend that all code...

    --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 differentiate between two tables sharing the same name but belonging to different databases

    GilaMonster (1/12/2014)


    Use three-part naming for your queries

    SELECT <column list> FROM Sims.dbo.Students

    SELECT <column list> FROM SimsCopy.dbo.Students

    I agree that works great for ad hoc queries (and you already know this... just saying...

    --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: Inline table valued function, translation from book

    Lynn Pettis (1/12/2014)


    rho_pooka (1/11/2014)


    Jeff Moden (1/11/2014)

    Although it may seem so, I'm not being sarcastic at all when I ask you, do you know what "Books Online" is? People who...

    --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: Inline table valued function, translation from book

    rho_pooka (1/11/2014)


    Jeff Moden (1/11/2014)

    Although it may seem so, I'm not being sarcastic at all when I ask you, do you know what "Books Online" is? People who ask the...

    --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: Date Range

    Terry300577 (3/28/2013)


    Is this what your looking for:

    select distinct @@servername, a.database_name 'DB Name',

    convert(decimal(7,2),round(sum(compressed_backup_size/1024/1024/1024),3)) as 'Compressed Database Size in(GB)',

    convert(decimal(7,2),round(sum(compressed_backup_size/1024/1024),3)) as 'Compressed Database Size in(MB)'

    from msdb..backupset a

    inner join msdb..backupfile b on a.backup_set_id...

    --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: Date Range

    suryam (1/11/2014)


    Hi folks,

    The script is fine but as per performance concern we should not use any function in where condition. My script is

    Convert(varchar(10),id_updt,101) >=Convert(varchar(10),getdate()-3,101)

    data retrieving from trigger 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: Date Range

    Damian Widera-396333 (1/12/2014)


    Hi, two things (in where clause)

    1.

    select name from sys.databases where database_id not in(1,2,3,4)

    should be

    select name from sys.databases where database_id >4

    To add to that, they could automate exclusion...

    --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: SQL 2008 R2 - Update a table using VIEW?

    This is a duplicate post. No replies on this thread, please. It just splits the answers up. Please refer to the following URL to get to the...

    --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: Splitting DBs into multiple files for IO spread

    A lot of people also forget about the "striping" that SANs do for things like RAID 5 or Raid 10. There are usually 5 sets of spindles and 5...

    --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: No Bosses

    I guess I don't understand why anyone would think this is a recent innovation. It's been known for a very long time that the best "managers" are the ones...

    --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: Inline table valued function, translation from book

    rho_pooka (1/11/2014)


    Greetings! On chapter four looking at inline table valued functions. Can someone translate this code into English? I see this at the beginning of a lot...

    --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: Keeping at table lean and highly available

    Michael Valentine Jones (6/21/2012)


    In conjunction with this, they could have the web application query the table using the snapshot isolation level (or set the database to read committed snapshot) so...

    --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: Shrinking data files

    Aatish Patel (1/11/2014)


    I have SQL 2008 database and have configured mirroring on that database. Now a huge tables with billions rows needs to be truncated and then need to...

    --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 - 24,781 through 24,795 (of 59,099 total)