Forum Replies Created

Viewing 15 posts - 4,321 through 4,335 (of 8,731 total)

  • RE: string columns containing alphanumeric

    Another possibility.

    SELECT *

    FROM #temp

    ORDER BY CASE WHEN Section NOT LIKE '%[^0-9]%' THEN CAST( Section AS int) * -1

    ...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Syntax Errors when Re-Creating Procedure

    That process will change all the text that contains your database name. So, unless you have something really unique, it might cause problems and won't be safe to execute this...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Today's Random Word!

    eccentricDBA (8/26/2015)


    Ed Wagner (8/26/2015)


    whereisSQL? (8/26/2015)


    Ed Wagner (8/26/2015)


    crookj (8/26/2015)


    whereisSQL? (8/26/2015)


    Ed Wagner (8/26/2015)


    Fire

    Drill

    Dentist

    Shot

    Tequila

    Sunrise

    Siesta

    Fiesta

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Quick GETDATE question

    Without knowing the data types of your table, here's an example set to help you understand what's going on and how to fix your problem.

    CREATE TABLE #TestDate(

    ...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: max not giving the latest one

    lcarrethers (8/26/2015)


    Not sure how I would add it to the derived subquery

    Not sure how to do it either if you don't give sample data and expected results.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: duplicates of part.num to be summed and add another column called user

    From a quick search on the firebird documentation, which almost made me believe that it wouldn't have a SUM() function, this seems to be close to what you need.

    SELECT part.num...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: max not giving the latest one

    The createdon column is not included in the derived table (subquery).

    I'm not sure if you need to include it, or if you need to join the derived table to the...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: duplicates of part.num to be summed and add another column called user

    I agree with Ed, You might only need a SUM() with GROUP BY.

    It seems that you're not using your derived table "labor", so you might be able to remove it.

    Do...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: DATEADD issue grouping by week

    Try this formula:

    --DATEADD( wk, DATEDIFF( dd, 0, @dt)/7,0)

    SELECT dt, DATEADD( wk, DATEDIFF( dd, 0, dt)/7,0)

    FROM (SELECT TOP 30

    ...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Are the posted questions getting worse?

    Maybe that's a result of using a template which included that part. Or probably it was just included to comply with code standards that only require a catch block without...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Are the posted questions getting worse?

    djj (8/24/2015)


    GilaMonster (8/24/2015)


    I think it's in anticipation of my Star Wars RPG tonight. The puny resistance movement will be crushed under the might of the Imperial Army. The Emperor has...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Today's Random Word!

    whereisSQL? (8/24/2015)


    Ed Wagner (8/24/2015)


    TomThomson (8/24/2015)


    SQLRNNR (8/24/2015)


    oeuf

    revuelto

    Pistol

    Pete

    Mickey

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: sql delete trigger (parent child)

    If there's a foreign key, the trigger must be on the details table as its contents will be deleted before the header. You also don't need to loop to create...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Interesting results with Len and varchar(max)

    The problem is that your concatenation creates a varchar(8000) string which is then converted to be stored in a varchar(max).

    In both test 2 and 3, it gets truncated in the...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: sql delete trigger (parent child)

    Does this mean that you don't have foreign key constraints in place?

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 15 posts - 4,321 through 4,335 (of 8,731 total)