Forum Replies Created

Viewing 15 posts - 1,621 through 1,635 (of 2,647 total)

  • RE: UPDATE with FROM -- can't figure out where I'm going wrong

    Matt Miller (#4) (2/20/2012)


    So - no record is returned since you can't join to a record that doesn't match the join (at least not as is).

    EDIT: Isn't that the point...

    Jared
    CE - Microsoft

  • RE: insert sp_executesql and quotes roblem

    Jeff Moden (2/20/2012)


    Honestly, I'm seriously confused. Since you've already identified that there is a way to do this without the use of dynamic SQL, why do you insist on...

    Jared
    CE - Microsoft

  • RE: insert sp_executesql and quotes roblem

    Try this:

    create table #my_test (myval varchar(300))

    go

    declare @sql nvarchar(max)

    declare @parmdef nvarchar(25)

    DECLARE @param nvarchar(300)

    SET @sql = 'INSERT INTO #my_test (myval) VALUES(@value)'

    SET @parmdef = N'@value varchar(300)'

    SET @param = 'test string'

    select @sql

    EXEC sp_executesql @sql,@parmdef,@value...

    Jared
    CE - Microsoft

  • RE: One thing I keep missing in SQL

    the set {1, 1, 2} = set {1, 2}, because the repeating "1" is the same as a single "1".

    Eh... Kind of? That is if the elements of the...

    Jared
    CE - Microsoft

  • RE: One thing I keep missing in SQL

    SQL Kiwi (2/20/2012)


    SQLKnowItAll (2/20/2012)


    Why is your first example not a set? A set is simply "A group or collection of things that belong together or resemble one another or are...

    Jared
    CE - Microsoft

  • RE: One thing I keep missing in SQL

    SQL Kiwi (2/20/2012)


    For what it's worth, I didn't really see what Joe was driving at with his example either. It's pretty easy to do what the OP was asking...

    Jared
    CE - Microsoft

  • RE: UPDATE with FROM -- can't figure out where I'm going wrong

    S. Kusen (2/20/2012)


    SQLKnowItAll (2/20/2012)


    S. Kusen (2/20/2012)


    Whoops- Let me edit that.. Sorry for the confusion..

    Was that a pasting error or was that the cause of your update issue? 🙂

    LOL- Wasn't the...

    Jared
    CE - Microsoft

  • RE: One thing I keep missing in SQL

    patrickmcginnis59 (2/20/2012)


    SQLKnowItAll (2/20/2012)


    The OP had this:

    select

    A,

    B,

    ...

    Jared
    CE - Microsoft

  • RE: One thing I keep missing in SQL

    I agree its a matter of taste.

    It's not a matter of taste. It is that A * B AS C is not the same as A * ...

    Jared
    CE - Microsoft

  • RE: UPDATE with FROM -- can't figure out where I'm going wrong

    S. Kusen (2/20/2012)


    Whoops- Let me edit that.. Sorry for the confusion..

    Was that a pasting error or was that the cause of your update issue? 🙂

    Jared
    CE - Microsoft

  • RE: One thing I keep missing in SQL

    The OP had this:

    select

    A,

    B,

    ...

    Jared
    CE - Microsoft

  • RE: One thing I keep missing in SQL

    patrickmcginnis59 (2/20/2012)


    SQLKnowItAll (2/20/2012)


    patrickmcginnis59 (2/20/2012)


    SQLKnowItAll (2/20/2012)


    patrickmcginnis59 (2/20/2012)


    I'm realise I'm posting in an old thread, but I'm genuinely curious about this and maybe someone can point out what I'm missing.

    Now try to...

    Jared
    CE - Microsoft

  • RE: SELECT with default fallback

    It should not be an issue if you have the proper indexes. I would think that there should be one on Region, Division, Group. If your data is in that...

    Jared
    CE - Microsoft

  • RE: UPDATE with FROM -- can't figure out where I'm going wrong

    Look at the difference between this:

    and (case

    when CHARINDEX('\', dpi.instancename, 1) = 0 then dpi.instancename

    when CHARINDEX('\', dpi.instancename, 1)...

    Jared
    CE - Microsoft

  • RE: UPDATE with FROM -- can't figure out where I'm going wrong

    Are you sure this is what you want in your update?

    SELECT SUBSTRING('SERVERNAME\NAMEDINSTANCE', 1, CHARINDEX('\', 'SERVERNAME\NAMEDINSTANCE', 1) - 1)

    Because this gives the server name in the case of a named instance...

    Jared
    CE - Microsoft

Viewing 15 posts - 1,621 through 1,635 (of 2,647 total)