Forum Replies Created

Viewing 15 posts - 3,166 through 3,180 (of 4,087 total)

  • RE: Left Join Killing Me

    I still don't see any sample data. It's hard to rewrite your view if we don't have data to compare the original results with the revised results.

    Also, please pick...

  • RE: Passing Parameter with a wildcard

    This problem is almost certainly due to parameter sniffing. Gail has a good article on Parameter Sniffing[/url]

    There are other issues with your code, though. You should use a...

  • RE: Left Join Killing Me

    You've been around long enough that you should know that we're going to ask for DDL, sample data, and the actual execution plan.

    I think that part of the problem is...

  • RE: EXECuting a dynamic string

    You should be using sp_executesql rather than EXEC. BOL has examples of using parameters including OUTPUT parameters.

    Drew

  • RE: SSMS stops while showing query execution plan

    riya_dave (5/9/2012)


    hi

    when i am showing estimate execution plan,SSMS just stops working.

    what causes it to stop working.

    Any idea?

    Let me guess. This is the same query where you replaced a CURSOR...

  • RE: improve performance of sp

    riya_dave (5/9/2012)


    hi

    i have cursor in my sp ,so i tried to remove it with while loop in order to enhance performance,but it takes more time than cursor.

    I am calling 5-6...

  • RE: Many aggregates in one query

    Eugene Elutin (5/9/2012)


    ... complex OLAP is better done in a tool specifically designed to do OLAP such as SSAS...

    So far OP failed to present enough details about required output to...

  • RE: Difference Between SQL Statements ..

    Without sample data, it's hard to tell what the problem is. Here is what I suspect is happening. Your TableA has multiple procedures for a given unit, some...

  • RE: Conditional select with function

    vinu512 (5/8/2012)

    Todd's Logic is very nice. Didn't hit me when I was trying it.

    But it was just lacking something.

    I tweaked it a little and got it working. 😀 Here's how...

  • RE: Many aggregates in one query

    I think that T-SQL is simply the wrong tool for this particular job. T-SQL is designed to optimize transactional processing. While you can do basic analytical processing in...

  • RE: Trying to create Set Statment when Clause is met ??

    Sean Lange (5/8/2012)


    With 526 points I would think you would know you should provide a bit more detail than this. This is totally a shot in the twilight.

    update pjprojex

    set rev_type...

  • RE: 13 x 4 Financial Year

    The key is to understand that there aren't 52 weeks in your year, but rather 52.2 weeks rounded down (truncated).

    Try the following

    MyCount = Round(datediff(day, @CalendarStartDate, CalendarDate) / (7 * 52.2...

  • RE: DATEDIFF(MONTH,0,getdate())

    anthony.green (5/8/2012)


    it is substituting 0 with the default date of '1900-01-01 00:00:00.000'

    If only a time value is assigned to a variable of a date data type, the value of the...

  • RE: case statement

    This will produce what you are looking for, but I agree with Eugene that the reasons for producing this result are suspect.

    SELECT STUFF(( SELECT ', ' + field2 FROM #Tbl...

  • RE: Conditional select with function

    If you have enough units of measure, you'll probably want to create a conversion table instead of using the CASE Statement. Something like the following.

    DECLARE @Sample TABLE

    (origin_code char(5) NOT...

Viewing 15 posts - 3,166 through 3,180 (of 4,087 total)