Forum Replies Created

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

  • RE: SQL Server T-SQL - Merge

    By virtue of using the MERGE statement you have already specified the TARGET table, so no need to quality the INSERT, UPDATE or DELETE:

    INSERT ([Name]

    ...

  • RE: Delete ON Self Join

    I'm not sure if I'm following what you want to do, but can't you simply delete the rows?

    DELETE CityStates

    WHERE StateID = 1

    OR PartneID = 1

  • RE: Select Random Row from a table

    It was just an example of other ways to get rangom rows.

  • RE: case statement in a where clause

    I'm not sure I understand waht you are tryign to do, but myabe this will help? SELECT

    ...

    WHERE

    1 = CASE

    ...

  • RE: Multiple selection criteria query assistance

    I'm not sure I fully understand, but maybe this will get you going:SELECT

    *

    FROM

    (

    SELECT *

    ...

  • RE: Bug in CTEs?

    I found the issue. The filter for CHARINDEX('=', Item) > 0 was being evaluated after the SUBSTRING. I changed the AttribValues CTE to this and it works:,AttribValues

    AS

    (

    ...

  • RE: Bug in CTEs?

    This doesn't seem to have any affect on the sampel data you provided but the NULL check and the LENGH seem to be out of order:,N(N)

    AS

    (

    ...

  • RE: Compression

    I know there are some articles out there (sorry I don't have a link), but the conclusion is that "it depends." I don't know of any hard and fast rules...

  • RE: Shown up by a developer

    A little late to the part and it sounds like you might have it coverd. But, do the statistis show the correct row count? I've seen them get out of...

  • RE: SELECT query running very slow - it's crawling!

    I don't know about your indexs, but applying a function to a column makes it so that predicate is not SARGable.

    You might try chaning:

    AND left(c.comment_code, 3) = '220'

    to something like:

    AND...

  • RE: Tally Table vs. While Loop

    I realize this doesn't actually help provide a solution to your actual question, but I've been through this before, albeit non-medical. And, trust me, there is no valid solution unless...

  • RE: Asking for help to understand subtle nuances of randomised query.

    I'm not sure if this is the case but according to Microsoft, there is no guarentee that nondeterministic scalar functions will executed for every row.

    I submitted a "bug" a while...

  • RE: Disable database engine tuning advisor?

    SkyBox (5/25/2011)


    I work with an unruly developer that always runs DTA against our production databases during prod hours. I have asked him several times not to do this and...

  • RE: Difference between Version store and Row Versioning

    EdVassie (5/23/2011)


    Row versioning and version store are different things.

    Row Versioning is what happens to rows. Every change to a row changes the row version Id.

    Row versioning has...

  • RE: Order varchar numericly

    Assuming all parsed values are INTs, it's pretty easy:

    ;with cte(vers)

    as

    (

    select '10.00.1818'

    union all

    select '10.00.1823'

    union all

    select '9.00.4315'

    union all

    select '9.00.4317'

    union all

    select '10.50.1600.1'

    union all

    select '10.50.1600'

    union all

    select '10.50.1600.2'

    union all

    select '-10.50.1600.2')

    select vers

    from cte

    cross apply(select REVERSE(vers)) as...

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