Forum Replies Created

Viewing 15 posts - 91 through 105 (of 600 total)

  • RE: convert Stored Procedure to User Defined Function

    Why did this need a new thread?

    Maybe instead of doing this a bit at a time, with a new thread each time, in which nobody has anything real to work...

  • RE: function that does spefic conversion

    Select

    Distinct value as value ,CASE WHEN ISNUMERIC(value) <> 0 THEN CONVERT(int,value) ELSE value END AS converted_value From TableA

    This fails for two reasons.

    First, '1.0' for...

  • RE: function that does spefic conversion

    Here is his Lowell's sample modified for what you want.

    WITH SampleData (ID, Pay) AS

    (

    SELECT 1, '1.000'

    UNION ALL SELECT 2,'2.250'

    ...

  • RE: function that does spefic conversion

    You can't.

    You can make a function/query with output that LOOKS like that, but your output will be a string even it it looks like an integer/decimal for some rows. ...

  • RE: Currency Conversion between Destination Currency and Target Currency

    I don't now. There's a borderline between "help me figure out this problem I'm stuck on" and "please do my job for me" and you seem to be coming...

  • RE: Create new table from multiple table

    So what are you asking for?

  • RE: Create new table from multiple table

    You want help with the query syntax, or help turning the query into an insert statement?

    Does the destination table already exist (and if so, can we have DDL), or are...

  • RE: SQL SERVER VARIABLES

    What is the datatype of surKey and what are the execution plans?

  • RE: SQL SERVER VARIABLES

    What are the query plans each time?

  • RE: Strange rounding issues

    Jason-299789 (2/18/2015)


    I actually answered that QotD and got it right. :hehe:

    It makes sense for there to be truncation to prevent data loss but in doing so you still suffer data...

  • RE: Strange rounding issues

    Now check this:

    SELECT CAST(@var1/100.00 AS DECIMAL(18,10))*CAST(@Var2/100.00 AS DECIMAL(18,10))*CAST (@var3/100.00 AS DECIMAL (18,10))

    Look here

    The precision and scale is changing with each one of your calculations, as they have maximums. ...

  • RE: VIEW_METADATA option

    Rizk.Christopher (2/14/2015)


    Hey everyone. I was hoping that someone can clear something up for me on the VIEW_METADATA option, and what exactly it affects. I have been playing around with this...

  • RE: TOP N records help

    If you are going to use top, you should probably be including an order by clause as well, to ensure that it really is the 'top 3' as you define...

  • RE: Help with update

    UPDATE r SET ProjAmt = 0

    FROM

    (

    SELECT OrderID, ProjectID,ProductID,ProductName,ProjAmt,ROW_NUMBER() OVER (PARTITION BY OrderID, ProjectID ORDER BY ProductName) rn

    FROM #Temp

    ) r

    WHERE rn > 1

  • RE: Next Business Day

    Ok, I've put together a sample of how I would solve it. Jeff or someone else may have a more efficient way.

    Because you posted no DDL I don't have...

Viewing 15 posts - 91 through 105 (of 600 total)