Forum Replies Created

Viewing 15 posts - 121 through 135 (of 187 total)

  • RE: XQuery Problem

    Thanks for trying to make the table description at least... Though just empty rows isn't going to help us much I think?

  • RE: Which SQL would run faster?

    Make it a poll instead... 🙂 I think 1 and 2 would be equal in performance (it seems that the same amount of rows are touched, and every row is...

  • RE: Dynamic SQL issues with passing variables in stored procedure

    So I think the @WhereStatement wasn't actually part of the INSERT. If you get used to put the SQL in a variable, understanding of using the quotes is much easier....

  • RE: Dynamic SQL issues with passing variables in stored procedure

    I agree that putting the SQL statement in a variable could have solved the problem, but I think I got it anyway. If you add an extra ') to the...

  • RE: distinct view

    Without any tabel description, sample data and desired output, it's hard to guess where the problem really is.

    You can use DISTINCT in Views, so that's not the problem....

  • RE: Dynamic SQL issues with passing variables in stored procedure

    henkvisser (1/16/2009)


    I'm trying to use the stored procedure below in SQL Server 2000, but I get the following error;

    Server: Msg 170, Level 15, State 1, Line 4

    [Microsoft][ODBC SQL Server Driver][SQL...

  • RE: Numbering groups of rows

    Ken McKelvey (1/13/2009)


    Try something like:

    SELECT T1.[Order], T1.OpNo, T1.Operation

    &nbsp&nbsp&nbsp&nbsp,DENSE_RANK() OVER (ORDER BY T1.[Order], MAX(T2.OpNo)) AS GroupID

    FROM YourTable T1

    &nbsp&nbsp&nbsp&nbspJOIN YourTable T2

    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspON T2.Operation = 'SETG'

    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspAND T1.[Order] = T2.[Order]

    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspAND T1.OpNo >= T2.OpNo

    GROUP BY T1.[Order],...

  • RE: Why is this returning invalid records

    MrBaseball34 (1/12/2009)


    SELECT e.EncounterID, SUM(ed.Balance) as TotalAmt

    FROM ptEncounterDetails ed

    INNER JOIN ptEncounterEncounterDetail eed

    ON eed.EncounterDetailID = ed.EncounterDetailID

    INNER JOIN ptEncounter e

    On e.EncounterID = eed.EncounterID

    WHERE TotalAmt >= 5.00 AND

    ...

  • RE: Sql Server vs Sql server

    One thing I run into with such problems is fragmentation.

  • RE: Money

    Aam (1/12/2009)


    It is a good question though. You'd assume the data type that uses more bytes for storage would have a greater 'precision' both ways of the decimal point.

    Strange...

  • RE: Query to Calculate Cumulative Salary

    Please read the following for answers to these questions...

    [font="Arial Black"]Solving the "Running Total" & "Ordinal Rank" Problems in SS 2k/2k5[/font][/url]

    I'm still too attached to my VB way of thinking, so...

  • RE: make store procedure

    nazaninahmady_sh (12/23/2008)


    Thanks alo Gail

    but where i should write it?

    In a New Query box in SSMS... So in the same place as where you have the query. So in SSMS,...

  • RE: Query Hints

    Last of the 3 questions all the options were true... I hope to see some questions where none or only 1 option is true... I'm going to click them all...

  • RE: Query to Calculate Cumulative Salary

    UPDATE #Results

    SET @PrevCum_Sal = Cum_Sal = Sal + @PrevCum_Sal,

    @PrevName = Name --Just an "anchor"

    FROM...

  • RE: Query to Calculate Cumulative Salary

    Thanks for the input, though there were some flaws in it that made it a bit unclear what is desired exactly. Here I changed the input a bit, let me...

Viewing 15 posts - 121 through 135 (of 187 total)