Forum Replies Created

Viewing 15 posts - 4,216 through 4,230 (of 5,504 total)

  • RE: Stop running sql queries from backend

    Jeffrey Williams-493691 (2/22/2010)


    ...

    If so, then you need to make sure the user accounts in SQL Server only have the privileges necessary to execute the stored procedures your application calls. ...

  • RE: Pivot Query- need help

    Glad I could help 🙂

    Come back to this site if you need further assistance.

    But remember: one post is better than 6! 😉

  • RE: Trying to max performance in this TVF

    You should look into using a split string function based on a Tally (or Numbers) table.

    The related article in my signature describe the concept. You could also search for "split...

  • RE: Pivot Query- need help

    Thanks to Gail for stopping me to post in the wrong thread just in time!!

    And here's what I was about to post "over there":

    (Note: I second Gus preferring to do...

  • RE: Dynamic Crosstab Query

    My pleaseure. 🙂

    If you get stuck, post some sample data to describe the scenario together with your expected result and we'll try to help again.

  • RE: Dynamic Crosstab Query

    erdem1973 (2/22/2010)


    I have modified your code like below.Because the main idea here is to get individual sums of lfisno columns.

    I have also added the lfisno column to the dynamic SQL...

  • RE: Humor

    Lowell (2/22/2010)


    blocked at work, is that the "little bobby tables" comic?

    Sir, Yes, Sir! 😀

  • RE: Dynamic Crosstab Query

    You could simply add the sum of lbrutfiyat to the CROSS APPLY part.

    The interesting part is the SUM() OVER(PARTITION BY) clause, which is not seen that often. But it helps...

  • RE: Error in SQL

    What value are you trying to get?

    Depending on the value of the DATEFIRST you'll get different results...

    There might be a more efficient way to do it.

    Regarding the leading zero: What...

  • RE: Crosstab

    StudID isn't part of your subquery and you cannot reference t.2 in your outer query.

    Try the following:

    SET @query = N'SELECT StudID, '+

    @cols +'

    FROM

    (SELECT t2.StudID

    , MarksId

    , t1.Subjects

    , t1.Marks

    FROM Students AS t2

    JOIN...

  • RE: best way to display breakouts with sum totals?

    Please be a little more specific about what you're trying to do.

    If you provide ready to use sample data as described in the first link in my signature I'm sure...

  • RE: UNION a series of TOP statements

    Paul White (2/21/2010)


    lmu92 (2/21/2010)


    When using DATEPART(WEEKDAY, AsofDate) you need to make sure to have DATEFIRST set to 7. Otherwise you'll get incorrect results.

    Lutz,

    You sure about that?

    Monday is the first day...

  • RE: Dynamic Crosstab Query

    For learning how to build dynamic cross tabs please see the related link in my signature.

    When applied to your scenario it could look like the following code:

    -- step 1: build...

  • RE: UNION a series of TOP statements

    When using DATEPART(WEEKDAY, AsofDate) you need to make sure to have DATEFIRST set to 7. Otherwise you'll get incorrect results.

    (see one of the recent articles: "Finding the Correct Weekday Regardless...

  • RE: Dynamic Crosstab Query

    Would you mind to explain how you came up with the values maked bold and underlined in the quote below? I can't find the values nor any kind of formula...

    smodel...

Viewing 15 posts - 4,216 through 4,230 (of 5,504 total)