Forum Replies Created

Viewing 15 posts - 8,131 through 8,145 (of 8,760 total)

  • RE: SQL Challenge: Updating parts of fields.

    Raymond.Pietrzak (5/30/2014)


    I was able to write my query against the VarChar(4000) data type. This worked.

    Update [WBPROD].[dbo].[TASK_SCHEDULE]

    Set TSKSCD_DESCRIPTION = Replace(TSKSCD_DESCRIPTION, '<timezoneId>0</timezoneId><timezone>America/New_York</timezone>', '<timezoneId>1</timezoneId><timezone>America/Chicago</timezone>')

    Update [WBPROD].[dbo].[TASK_SCHEDULE]

    Set TSKSCD_DESCRIPTION = Replace(TSKSCD_DESCRIPTION,

    ...

  • RE: Getting first and last value for every group.

    Since this is a 2012 thread, how about the window functions?

    😎

    create table #sampledata

    (

    userId int,

    BaseYear int,

    TotalSales float

    )

    insert into #sampledata

    select 1,2008,25000 union

    select 1,2009,22500 union

    select 1,2010,23400 union

    select 1,2011,26700 union

    select 1,2012,25200 union

    select 2,2008,25050...

  • RE: STintersect with buff

    I have found that one should generally (as much as I dislike generalization) avoid AUTO_GRID.

    😎

  • RE: Just curious, what are your SQL pet peeves ?

    samalex (5/29/2014)


    Everyone has their own style of writing code and doing things, but there are some pet peeves I've developed over the years, especially when I review other people's code,...

  • RE: Just curious, what are your SQL pet peeves ?

    Sean Lange (5/29/2014)


    samalex (5/29/2014)


    Wow, I agree with literally 100% of what you guys have entered, including 'sprocs'. We have a few non-DBA's who use this verbiage, and it always makes...

  • RE: Just curious, what are your SQL pet peeves ?

    GilaMonster (5/29/2014)


    Developers who think they know more than I do. 😉 :hehe:

    Ouch..... good thing that my title is no longer a "developer" :-P:-P

  • RE: MAX Degree of Parallelism Option Not working in Resource Governer

    adhiman (5/29/2014)


    I am running a query on SQL 2012 Server with the Resource governer setup for my account to have Max DOP option set to 1.

    The query still runs...

  • RE: Update with Case statement not working

    Sean Lange (5/29/2014)


    My code does two very important things. First, it only updates the rows that need to be updated instead of updating them all. Secondly it references the alias...

  • RE: Drop table not working

    Forgive me for being slow here and slightly off the topic, but how can a single session, multiple batch thingy create multiple instances of a temporary table with the same...

  • RE: Error Converting Datetime to String

    npatel 17252 (5/29/2014)


    SHIT! Thanks stupid stupid stupid me 🙂

    :-DThat is how we learn!:-D

    😎

  • RE: Update with Case statement not working

    tshad (5/29/2014)


    I have a situation where I want to update a column if and only if it is null.

    UPDATE Employee

    SET VEmployeeID = CASE WHEN E.VEmployeeID IS NULL

    ...

  • RE: Drop table not working

    GilaMonster (5/29/2014)


    It's because batches are parsed as a whole, then executed. When the parser hits the second create for that table it fails. It works with the debug break because...

  • RE: Error Converting Datetime to String

    Cannot say much without knowing more about the table structures, first guess would be this part of the join

    😎

    dbo.TCDaily.TCDay = dbo.EmpList.EmpID

  • RE: STintersect with buff

    wolfkillj (5/29/2014)


    Eirikur Eiriksson (5/29/2014)


    wolfkillj (5/29/2014)


    Eirikur Eiriksson (5/28/2014)


    Quick thought, if the "signs" are points then I would have thought that the STContains function would be more appropriate.

    😎

    Except that the requirement was...

  • RE: STintersect with buff

    wolfkillj (5/29/2014)


    Eirikur Eiriksson (5/28/2014)


    Quick thought, if the "signs" are points then I would have thought that the STContains function would be more appropriate.

    😎

    Except that the requirement was to determine which...

Viewing 15 posts - 8,131 through 8,145 (of 8,760 total)