Forum Replies Created

Viewing 15 posts - 46 through 60 (of 311 total)

  • RE: Quirky Update query...works on server ...fails on PC.

    No thanks. Interested in SQL2008 32-bit as well?

  • RE: Quirky Update query...works on server ...fails on PC.

    SQL Kiwi (1/6/2012)


    Peter Brinkhaus (1/6/2012)


    Using 256MB memory it failed 7 out of 8 times. Ran it once with 512MB, failed also. Ran it once with 1GB, succesfully.

    Excellent, a 32-bit confirmation,...

  • RE: Quirky Update query...works on server ...fails on PC.

    SQL Kiwi (1/6/2012)


    Has anyone else managed to reproduce this now given the extra information I provided? Jeff in particular? I'm particularly interested to hear from anyone running 32...

  • RE: Join - that may not be possible

    If replacing potential delimiters is sufficient, then there no need for splitting the field. Just replace potential delimiters with a unified delimiter and surround the code to search for with...

  • RE: help in the below scenario

    DECLARE @SampleData TABLE ([DESC] VARCHAR(10))

    INSERT INTO @SampleData

    VALUES ('abc'), ('u&w<yz')

    SELECT

    CA.Result.value('.', 'VARCHAR(30)')

    FROM

    @SampleData SD

    CROSS APPLY

    (

    SELECT

    -- Surround every character with [] using an index...

  • RE: Query with date ranges

    shadow_2 (12/14/2011)


    What is the benefit of the OUTER APPLY? To eliminate the additional SELECT and GROUP BY on the storechanges?

    Look at the actual execution plans. The first one contains a...

  • RE: How to group based on value and rank

    ChrisM@home (12/14/2011)


    Quick today, Peter. I see you've also commented on a sort column 😎

    Funny, almost same query, same execution plan. Note that the solutions probably do not scale very well...

  • RE: How to group based on value and rank

    Maybe this one will do. I added the max. date to the group for sorting.

    DECLARE @T TABLE ([Value] INT, [Date] DATETIME)

    INSERT INTO @T([Value], [Date]) VALUES (5, '01/01/2011 00:00:00')

    INSERT INTO @T([Value],...

  • RE: Query with date ranges

    Or better:

    SELECT

    V.visitID, V.storenr, COALESCE(OA.prev_storetype, S.storetype) storetype

    FROM

    #visits V

    JOIN

    #stores S ON S.storenr = V.storenr

    OUTER APPLY

    (

    SELECT TOP 1

    storenr, changedate, prev_storetype

    ...

  • RE: Query with date ranges

    If I understand your requirement correctly:

    SELECT

    V.visitID, V.storenr, COALESCE(SC.prev_storetype, S.storetype) storetype

    FROM

    #visits V

    JOIN

    #stores S ON S.storenr = V.storenr

    LEFT JOIN

    #storechanges SC ON SC.storenr = S.storenr...

  • RE: Advnaced Grouping Help Needed

    Maybe this one will do?

    WITH SampleData AS

    (

    SELECT * FROM (VALUES

    (0, 'blue', 'bob'),

    (1, 'red', 'bob'),

    (3, 'purple', 'bob'),

    ...

  • RE: Issue with View

    Jeffrey Williams 3188 (11/25/2011)


    Peter Brinkhaus (11/25/2011)


    Jeffrey Williams 3188 (11/25/2011)


    This is one of the reasons why it is not recommended that you use '*' in production code. When you modify...

  • RE: Issue with View

    Jeffrey Williams 3188 (11/25/2011)


    This is one of the reasons why it is not recommended that you use '*' in production code. When you modify the underlying tables, the views...

  • RE: Issue with View

    Try

    EXEC sp_refreshview 'EmployeeAddress'

    The view is non-schemabound so you have to refresh it's metadata when altering the underlying tables.

  • RE: What's going on with nvarchar(max)?

    In Method 1 the result type of the REPLICATE function will be implicitly VARCHAR(5000) because the input expression is VARCHAR.

    Because it is concatenated with an NVARCHAR(MAX) expression this

    VARCHAR(5000) expression will...

Viewing 15 posts - 46 through 60 (of 311 total)