Forum Replies Created

Viewing 15 posts - 1,006 through 1,020 (of 1,473 total)

  • RE: How to add multiple Dates Columns together but adding only date without times

    Bob Hovious (12/3/2008)


    When I first needed to drop time, the first solution I ever came up with was cast(left(dateCol,11) as datetime) :w00t:

    Using LEFT! UGH! THE HORROR!...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: monitoring progress of SP executuion in real time

    If you have the correct privileges, you can use Profiler to watch exactly what it's doing.

    Open up a trace, add Events such as SP:StmtCompleted and filter by an SPID. ...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Begin Tran...Execute (@Query)...Commit causing very slow query

    Whether there is any need for the transaction depends on the query. You may be able to re-write the query so that you don't need the transaction, or you...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: I need to duplicate the rows in same table , simply changing one field value

    Is this the same primary key violation you've already posted like 3 other times that we keep telling you you can't do?

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: How to add multiple Dates Columns together but adding only date without times

    Bob:

    Read this the other day on Gail's blog, think you may find it interesting. I used to do this the same way you do. Not anymore!

    http://sqlinthewild.co.za/index.php/2008/09/04/comparing-date-truncations/

    Thanks Gail.

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: problem with temp table losing its order

    Ok. As we've said, you cannot be sure that your index will be used unless you give it an index hint (Some people will argue you can't even be...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: problem with temp table losing its order

    To make sure we're all on the same page, please post the exact code that generated that screenshot. (The table/index definitions as they currently stand, and the updates targetting...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: problem with temp table losing its order

    Don't create the non-clustered index at all. Shouldn't be necessary.

    WITH (INDEX(0))

    Since the clustered index is the only one, that will grab it correctly. While this may...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: problem with temp table losing its order

    You have to make your clustered index the order that you want the table updated in. Make what you currently have your non-clustered index into your primary key /...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Query to Calculate percentages

    Concept:

    Write your query to link the original table grouped by item # to a derived table with a sum of all items. Divide the sum of the parent query...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: problem with temp table losing its order

    Barry: You can, I do it all the time when applying this method.

    Gardenlady: Your index specification looks correct... unfortunately you're specifying the WRONG index :cool:. You need...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: problem with temp table losing its order

    A couple quick thoughts. (I admittedly skimmed this)

    1. You're not using an index hint. While it's not always necessary, it's always good practice. Add WITH (INDEX(0))...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Need assistance with conditional update

    How about something like:

    UPDATE pa SET

    pa.UnMergeDate = GETDATE(),

    pa.MergeDate = NULL,

    pa.AppraiserComment = CASE WHEN h.AppraiserChangeType =...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Stored Proc cursors and updates questions

    JMK (11/28/2008)


    Hi Seth,

    Thanks... funny thing, in spelling out the logic I was attempting to do, a light bulb went off on where I may have missed a step and...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Stored Proc cursors and updates questions

    Please refer to the article in my signature for how to post the table structure / sample data in an easily usable format.

    Also, please post the definition of the view.

    It...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

Viewing 15 posts - 1,006 through 1,020 (of 1,473 total)