Forum Replies Created

Viewing 15 posts - 766 through 780 (of 1,034 total)

  • RE: Group on DateTimeColumn

    Bob Hovious 24601 (10/12/2009)


    GROUP BY convert(varchar(6),getdate(),112)

    I'd have gone

    GROUP BY DATEADD(dd,datediff(dd,0,cv.Dischargedtm),0)

    but that's because I hate to convert pretty things like datetimes into varchars...

  • RE: Help with converting data types

    Grinja (10/12/2009)


    Bear with me for a sec.

    The result of Value1/Value2 is 129200.84577771904321395533

    What I would like is to fit this into a Decimal(18,17)

    The following works:

    CAST(Value1/Value2 AS DECIMAL(18,12))

    But the following gives...

  • RE: 8000 char limit in a Stored Proc

    Couldn't SSIS handle this with little to no trouble? With a little work you can even join the tables together in it...

  • RE: Conversion failed .

    Right here there is.

    Tally Table[/url]

  • RE: Mutliple Values in a Variable

    WayneS (10/9/2009)


    Regarding Mark's solution, what would (IMHO) be better is if your application already had this table defined. Those codes are coming from someplace, just connect the ClassCode to the...

  • RE: Trapping for Foreign Key Constraint Errors

    Write an INSTEAD OF DELETE trigger that passes the ID to a stored proc that iterates through the constraints on the table and checks them via some nasty cursor?

  • RE: Trapping for Foreign Key Constraint Errors

    Trust me when I say this.

    Your users do not want to delete customers. Especially not the ones with sales information that depends on the customer info.

    Later on somebody is...

  • RE: Trapping for Foreign Key Constraint Errors

    Well if you want a bad approach and want to delete the orders, shipments, invoices, etc...

    Change the Foreign key to ON DELETE CASCADE

    That will clean it up.

    Otherwise testing the tables...

  • RE: Mutliple Values in a Variable

    adams.squared (10/8/2009)


    I wound up using a couple of IF Else statements.

    IF @type='Auto'

    BEGIN

    Select *

    From Table

    Where Class in ('RD','MD','RS')

    END

    IF @type='Industrial'

    BEGIN

    Select *

    From Table

    Where Class in ('ID','IW','JP')

    END

    ELSE

    BEGIN

    Select *

    From...

  • RE: query optimizing

    Thanks Jeff,

    Now I get it... I was so confused to see the seek because of the search by apples that I didn't pay attention to the 78% of the sort......

  • RE: query optimizing

    I definately need Jeff to explain because I've confused myself.

    I made a (VERY) limited test.

    create table #inventory(itemcode varchar(10),startlevel int, endlevel int, cost money)

    create index funfun on #inventory(itemcode,startlevel,endlevel,cost)

    insert into #inventory

    select

    'Apples',

    100,

    50,

    .35

    UNION ALL

    SELECT

    'Bannanas',

    75,

    50,

    .25

    UNION...

  • RE: query optimizing

    I'd leave Jeff to explain exactly because I sometimes get confused as to why SCANs creep up in situations like this but.

    As I recall the order of operations in a...

  • RE: query optimizing

    It's not the Order by so much as the ABS function in the Order by I'm pretty sure.

  • RE: XML Query

    Setiv,

    also open Tools -> Options -> Results to text and set the maximum length to a value higher than 256. I set mine to 4000 which works wonderfully 🙂

  • RE: XML Query

    Sanjay is right.... it got me because I wasn't reading clearly.

    <customersa customers.id="6">

    Is not the same as

    <customers customers.id="6">

    🙂 Good question... shows me why I hate xml as much...

Viewing 15 posts - 766 through 780 (of 1,034 total)