Forum Replies Created

Viewing 15 posts - 31 through 45 (of 114 total)

  • RE: Bad performance of a query

    Yeah, even though the indexes you modified now cover the output of the index scan on orders, they don't cover all the possible combinations of predicates. For example, if...



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • RE: Bad performance of a query

    On or around line 287 you have a bunch of subqueries selecting counts from the @ipOrderStatusCodes with no outer references (meaning the subquery does not reference anything in the main...



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • RE: Index space incorrect

    Thanks Gail,

    I was kinda hoping it meant some problem, so I could say AHA! 😉



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • RE: Bad performance of a query

    I'm not certain this will help in your case, but I noticed that you have a variable named @ipOrderGuid which is declared as a varchar(max)

    You might try changing the type...



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • RE: Nested FOR XML with namespaces

    Ugh, never mind, it doesn't work...

    I've found a method that works; for each subquery, I add a garbage wrapper, and then strip it off, taking with it the namespace declaration....



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • RE: merging values and nulls

    A more general way is to take the original code that Phil suggested, and add a third join criterion based on the order:

    WITH metric1Values AS (

    SELECT MonthYear, Location, Metric1, ROW_NUMBER()...



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • RE: merging values and nulls

    A more general way is to take the original code that Phil suggested, and add a third join criterion based on the order:

    WITH metric1Values AS (

    SELECT MonthYear, Location, Metric1, ROW_NUMBER()...



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • RE: Multiple Insert/update by looping through each record

    If you're passing a single instance of the object, your best bet is to pass the individual properties of the video object as parameters to your stored proc. You...



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • RE: Solving SUDOKU thru SQL Code

    Just learned this yesterday, so I'll post a quick aside: Dual is a dummy object with one row.

    select 'foo' from dual

    is equivalent to the tsql statement

    select 'foo'

    which is...



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • RE: omit empty elements in for xml query

    Thanks for the reply, I was worried it would be something that complicated.

    It's fine in this simple example, but that represents a couple days of coding. Better get started.

    -a.



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • RE: Missing years as comma seperated list

    Also see Date Gap Problem and Finding gaps in a sequential number sequence[/url] for more help solving your problem.



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • RE: Schemabinding when tables in development

    Unfortunately, I don't know of any tutorials.

    You only _need_ to have scripts for the objects that are in development, but that tends to change, so I generally have scripts checked...



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • RE: Case in where clause not working

    Yeah, SQL doesn't do boolean values like in C based languages. The case statement returns a value that must be compared to something else to get a boolean.

    http://msdn.microsoft.com/en-US/library/ms181765(v=SQL.90).aspx



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • RE: Using PCL in Stored Procedure for Barcode

    I think you're not going to get much help here, as this is not a TSQL question. For what it's worth, your TSQL looks fine. I do have...



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • RE: Schemabinding when tables in development

    Two things you may find helpful are to separate your prod and test environments, and to modify your database objects through scripts rather than through SSMS.

    The second is the key...



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

Viewing 15 posts - 31 through 45 (of 114 total)