Forum Replies Created

Viewing 15 posts - 5,251 through 5,265 (of 10,144 total)

  • RE: Only NUMBERS

    carlosaamaral (2/7/2013)


    Hello Chris,

       Sorry - I may be doing something wrong ...

      

    Message 102, Level 15, State 1, Line 11

    Incorrect syntax near '.'.

    ;WITH Strings AS (

    SELECT String = 'AJKY.GSEFD6,7345535HNB,BBN4343.434'

    UNION ALL...

  • RE: Catch Data between symbols in SQL

    vinu512 (2/7/2013)


    I worked it out. This is the query that would get you the results you want:

    --Creating Table

    Create Table Ex1

    (

    Id Int Identity(1,1),

    AllLevels Varchar(MAX)

    )

    --Inserting Sample...

  • RE: Only NUMBERS

    carlosaamaral (2/7/2013)


    Good Morning,

    to 200,000 lines is very, very slow ..... :crying:

        to 1 line, it's good ...

    I will continue using the...

  • RE: How to update on condition based?

    demonfox (2/7/2013)


    ChrisM@Work (2/7/2013)


    demonfox (2/7/2013)


    ...updating column1 to column1; definitely not a good idea...

    There was a thread covering exactly this, fairly recently. I'll try to track it down. IIRC the conclusion (for...

  • RE: How to update on condition based?

    demonfox (2/7/2013)


    ...updating column1 to column1; definitely not a good idea...

    There was a thread covering exactly this, fairly recently. I'll try to track it down. IIRC the conclusion (for most folks)...

  • RE: UNION vs OR --> NP-Complete Problem

    GilaMonster (2/5/2013)


    Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.

  • RE: Error converting data type varchar to numeric

    ~nano (2/7/2013)


    Hi there

    I had this frustrationg error on a query as well, all though the dataset I was using for a join didnt even contain anything other than numbers.

    I got...

  • RE: Error converting data type varchar to numeric

    DougG (2/6/2013)


    ...I guess what I missed from Scott's post was that all of the "THEN"s will be evaluated even if it does not pass the "WHEN" or

    if a previous WHEN...

  • RE: error while casting a column name

    ALI100 (2/6/2013)


    SetFormattedValue =CASE

    When rg.ReferredFieldType='NUM'

    Then CAST(#PointedMslValues.Value AS NUMERIC(18,cAST(rg.ReferredDecimalPoints) )

    more cases .

    END

    I am generating a dynamic query which is giving error actually it...

  • RE: Finding patterns in rows (date ordered)

    greg.bull (2/7/2013)


    ...Would you mind explaining what the "working" line does in the cross apply line (ie is this the trigger for a new episode ?)

    Regards, Greg.

    PS I often get called...

  • RE: query tuning (PFA, execution plan and indexed view)- need help to enhance performance

    saxena200 (2/6/2013)


    @chris-2

    PFA the execution Plan...

    this is not working.... 🙁

    Apologies, I missed a column from the GROUP BY:

    SELECT DT.MO_OF_YR_NM ...

  • RE: query tuning (PFA, execution plan and indexed view)- need help to enhance performance

    saxena200 (2/6/2013)


    @chris-2

    PFA the execution Plan...

    this is not working.... 🙁

    You commented out the query hint. Can you run it without the query hint commented out, please?

  • RE: Error converting data type varchar to numeric

    Like this?

    SELECT

    t.*,

    x.*,

    y.*,

    z.*

    FROM (SELECT Target = 100) t

    CROSS APPLY (

    SELECT

    DataValue = CAST(t.[Target] AS DECIMAL(15,4)),

    DataType = 'C'

    ) x

    CROSS APPLY (

    SELECT vcDataValue = CONVERT(VARCHAR(20),x.DataValue,1)

    ) y

    CROSS APPLY (

    SELECT FormattedData...

  • RE: Error converting data type varchar to numeric

    DougG (2/6/2013)


    No good.

    Same error on the final cross apply.

    When I comment out the last cross apply, I do get results for t, x, and y.

    Have another read of Scott's...

  • RE: Error converting data type varchar to numeric

    Try using APPLY for prototyping this. When you're done, converting to an inline function is little more than copy & paste:

    SELECT

    t.*,

    x.*,

    y.*,

    z.*

    FROM PSBPR_Tree t

    CROSS APPLY (

    SELECT

    DataValue =...

Viewing 15 posts - 5,251 through 5,265 (of 10,144 total)