Forum Replies Created

Viewing 15 posts - 676 through 690 (of 1,473 total)

  • RE: Inserting Data Based on Join Criteria

    HowardW (9/14/2009)


    It's difficult to be sure what you're after without posting the create table statements and giving some sample data (I'm sure someone will be along to post a link...

    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: MTD AND YTD TOTALS IN SQL QUERY

    srathna77 (9/14/2009)


    Sorry sir i cannot give data. attached is the ouput document.

    As Lynn mentioned, we only want *sample* data. So if you have a Name (Like the one in...

    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: Code to acomodate year starting in April

    I think part of your problem is that you're basing the weekno off of getdate, when you aren't using calendar years to represent what the week numbers should 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: Copying Tables Between Databases

    vishal.gamji (9/13/2009)


    Looks like one of the routine tasks that a dba\dev would do right? i would create a dynamic sql script based on the metadata tables (system tables) that would...

    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: Conditional FK

    Bob Hovious (9/12/2009)


    I don't speak for anyone else at SSC, only myself.

    But in my opinion you really should make the effort to cut-and-paste your question here at...

    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: SELECT * versus SELECT 1 when using EXISTS

    I think he was just advocating testing things yourself and not always taking other people's word for it, not taking a side on this issue in particular. IIRC, 1 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: How do I wildcard search all columns in a database?

    Yeah, this script is only supplying the table name, not the fully qualified servername.databasename.schema.tablename.

    You can usually get away with not specifying the first 3, unless you're attempting to...

    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 do I wildcard search all columns in a database?

    Keep in mind that because the sp uses dynamic SQL, any wildcards you send in with your text string should work as wildcards.

    IE. EXEC UGLYSEARCH '1234%5678'

    or

    EXEC UGLYSEARCH '1234%[0-9][0-9][0-9][0-9]%[0-9][0-9][0-9][0-9]%5678'

    etc. etc.

    Also, I...

    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 do I wildcard search all columns in a database?

    Understood. Sorry if I sounded preachy, just had to check. Best of Luck in your search, unfortunately I have no such script handy.

    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 do I wildcard search all columns in a database?

    Some words come to mind.

    Cursor. Dynamic SQL. Slow. Why?

    You can use the field names from the information_schema view, use it as a cursor and dynamic sql to...

    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: unpivot question

    I've read that BOL article several times, maybe one of these times I'll actually remember what it says the next day ;-).

    I still don't see anything that would...

    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: possible to do in a case statement?

    You can use the same evaluation method to decide whether or not to increment the variable for your MessageID.

    DECLARE @ID INT

    SET @ID = 0

    Update #tblCompl

    SET Explanation = CASE

    WHEN CP<=Guide 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: possible to do in a case statement?

    Paul White (9/11/2009)


    Garadin (9/11/2009)


    You appear to be using a table variable to do your running totals. You don't want to do this, because you can't establish a clustered index...

    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: unpivot question

    Here's the other thread I mentioned:

    http://www.sqlservercentral.com/Forums/Topic785062-338-1.aspx

    The datatype thing could be mostly academic. With SQL2005 he could probably get away with just casting everything as varchar(max) and calling it a...

    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: unpivot question

    Paul White (9/11/2009)


    Garadin (9/11/2009)


    With that in mind though, consider using sql_variant instead of casting everything to varchars. I say consider because I haven't used sql_variant much myself, so I...

    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 - 676 through 690 (of 1,473 total)