Forum Replies Created

Viewing 15 posts - 18,811 through 18,825 (of 59,098 total)

  • RE: query for datetime

    charipg (12/28/2015)


    is it correct ?

    SELECT * FROM tablename(nolock) where

    startdate >= Getdate() -6

    and enddate <= Getdate()

    Maybe... it depends on what you define as "days ago". If you mean...

    --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: Where Do Staging Tables Belong

    lmarkum (12/28/2015)


    So, the question is, "Do I put the staging tables in the main database or in a separate database?" Is there a best practice and why is that 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: SQL express vs developer for MCSE:BI

    Don't limit your educational endeavors. Get the Developers Edition. It's usually less than $65USD somewhere. You'd pay almost that much for a good book.

    --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: Another XML explicit problem

    kenksoftware (12/28/2015)


    We are building an ETL project that is going to take hundreds of legacy data fields and place them into XML fields in a new SQL server database

    Have you...

    --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: Send email from T-SQL

    mw112009 (12/28/2015)


    (:-P I will run it and findout whether our server is configured correctly to send email)

    If it turns out to not be setup and no one wants 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)

  • RE: Number VS Letter

    ScottPletcher (12/28/2015)


    I'd at least compare the performance of the straightforward brute-force method:

    Agreed. You absolutely should. Please build a million row test table with demonstrable postable code, do...

    --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: Bulk Insert not working

    regrahc (12/17/2015)


    Hello!

    Please excuse the "newbie" question, but I have an issue I haven't been able to work out. Trying to do a bulk insert of a .csv into a...

    --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: The Most Common Query Blunders...

    Alan.B (12/28/2015)


    Someone beat me to it but NOLOCK table hints are the #1 mistake I have seen.

    Heh... apparently, thousands of people agree with you. Instead, they use SET...

    --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: Is BCP queryout limited?

    dwilliscp (12/28/2015)


    I am using @cmd_bcp to generate my BCP command, depending on the parameters passed into the export program. But I am getting a truncate error and the statement is...

    --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: Cursor or special select statement?

    Hyabusact (12/28/2015)


    Thank you, I even understood it

    Scott's code works a treat for what you've done but storing Boolean markers horizontally in a table doesn't lend itself well to other things...

    --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: The Most Common Query Blunders...

    TheSQLGuru (12/28/2015)


    Ooh, another thing I will chime in with. Some of the WORST things I see done on SQL Server have nothing to do with the databases/applications they run -...

    --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: The Most Common Query Blunders...

    Grant Fritchey (12/28/2015)


    Jeff Moden (12/28/2015)


    Grant Fritchey (12/28/2015)


    I have two presentations I do on best practices. Both slide decks are available on slideshare.net. That could act as a guide. Just give...

    --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: The Most Common Query Blunders...

    Grant Fritchey (12/28/2015)


    I have two presentations I do on best practices. Both slide decks are available on slideshare.net. That could act as a guide. Just give me some attribution 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: Help me about Attach database

    johnwalker10 (12/27/2015)


    As the message already says, restore the database from the backup.

    Or

    - Detach the database

    - Rename/Move the log file

    - Attach the MDF database file without the LOG file; a new...

    --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: Salary vs contract rate?

    BWAAAA-HAAA!!! To0 funny! But, Nah... a "wheelie" on a unicycle is the hop you need to do to go up the stairs.

    --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 - 18,811 through 18,825 (of 59,098 total)