Forum Replies Created

Viewing 15 posts - 556 through 570 (of 1,473 total)

  • RE: Return multiple rows into one row (comma seperated) using COALESCE

    Here's an article that touches on using FOR XML PATH to do this type of concatenation.

    http://www.simple-talk.com/sql/t-sql-programming/concatenating-row-values-in-transact-sql/

    If you need some more help with writing the code, please post sample data 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: How the query is being executed if WHERE returns FALSE?

    Just because your query doesn't return any rows, it doesn't mean that the server didn't have to read through a large amount of data to come to the conclusion that...

    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: Inserting TAB into string

    What are you using to verify that you only get a space? You're not going to see it in QA or SSMS, as they don't show things like carriage...

    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: cumulative total

    eseosaoregie (10/6/2009)


    Incidentally, with the original data I gave you how would I have done it without out the datetimes?

    This is the method that I prefer. For this running total...

    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: Transpose Columns to Rows - SQL 2000

    Well, in that case, you need part 2 of the article ;-).

    http://www.sqlservercentral.com/articles/Crosstab/65048/

    That Jeff, always thinkin ahead.

    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: Trap LOCK_TIMEOUT but suppress error

    This is an interesting request. Can you explain a bit further? Does the action that is failing not actually need to happen? If so, why is 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]

  • RE: cumulative total

    What you're trying to do is known as a running total. Ordinarily, I'd point you to Jeff's article on it, but it's under construction as he is re-writing 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]

  • RE: Help with a Long running stored procedure

    Oh yeah, didn't even notice those were functions. That's likely major issue #2. Please post the code for the functions as well. If they're simple enough, pulling...

    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: Help with a Long running stored procedure

    At a glance (Gail has the right of it, please post what she asked for), these 2 may be causing significant problems.

    SELECT EfaYear

    FROM EfaCalendarDates

    WHERE ...

    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: Transpose Columns to Rows - SQL 2000

    Take a look at the article in my signature by Jeff Moden on Cross Tabs. Post back if you have questions.

    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: Using Pivot

    Jacob Pressures (10/5/2009)


    Is the only purpose of PARTITION BY only to break the number sequence and start over? Does it have any other purpose? It just seems like 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: Using Pivot

    PIVOT needs to aggregate something. You're not aggregating anything, thus the error. You really don't need PIVOT at all, you can use something like this:

    select g.studentid, g1.guardianname, g2.guardianname

    from...

    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 set the records count of table in one variable using sql query

    krish-529631 (10/5/2009)


    Hi Girish,

    First-of-all thanks for reply..

    Actually i use SQL Server 2000. so i can not use Table variable.

    any ways, i use temporary table using yr solution. 🙂

    Again thank u....

    SQL 2000...

    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 skip checking the existence of objects when creating Stored Procedure

    Roust_m (10/1/2009)


    The reason I want this is because I need to run an import script which runs better when indexed views are not there yet, which relies on a stored...

    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 skip checking the existence of objects when creating Stored Procedure

    bitbucket-25253 (10/2/2009)


    Garadin

    These were my test conditions using Developer version of SQL Server 2008 Microsoft SQL Server Management Studio 10.0.1600.22 ((SQL_PreRelease).080709-1414 )

    /

    ALTER DATABASE Test

    SET COMPATIBILITY_LEVEL = 100

    CREATE TABLE Dbo.NonExisting

    (ABC...

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