Forum Replies Created

Viewing 15 posts - 601 through 615 (of 859 total)

  • RE: trimming a string

    drew.allen (4/12/2012)


    xenophilia (4/11/2012)


    when i run this:

    SELECT Distinct Outcome

    , TestNo

    , SUBSTRING(RIGHT('SuitePath',DATALENGTH('SuitePath') - 1),1,PATINDEX('%\%',RIGHT('SuitePath',DATALENGTH('SuitePath') - 1)) - 1)

    from testsuite

    i get this error

    Msg 536, Level 16, State 1, Line 1

    Invalid length parameter passed...

  • RE: Syntax help required

    Mike01 (4/12/2012)


    I modified your cte a little and I think these might be the results you're looking for

    ;WITH cte AS (

    SELECT *,

    ROW_NUMBER() OVER(PARTITION BY EventNumber, OBJECTID, ObjectSerial ORDER BY...

  • RE: rows repeating

    vinu512 (4/12/2012)


    Works Perfectly for me with IS NULL.

    Tried it like this :

    Create Table Ex

    (item1 int,

    item2 varchar(5),

    item3 int)

    Insert Into Ex

    Select 1, 'pen', 34

    Union All

    Select 1, 'pen', null

    Select *...

  • RE: Syntax help required

    if those results are not what you need can you post your expected results from the sample data.

  • RE: Syntax help required

    run the query that forms the common table expression and take a look at the row number. once you see that it will be clear why even with your...

  • RE: sql count with inner join

    mrashish_jaiswal (4/12/2012)


    Can you pls elaborate other table structure 🙂

    he is asking for DDL (create table statements) and sample data (hard coded inserts). please see the link in my signature...

  • RE: trimming a string

    xenophilia (4/11/2012)


    I am not catching the drift of that dialogue. Lynn is a man...I'm guessing. There was no offense meant.

    Today was one of those days. Nothing worked and...

  • RE: trimming a string

    Lynn Pettis (4/11/2012)


    capn.hector (4/11/2012)


    Lynn Pettis (4/11/2012)


    xenophilia (4/11/2012)


    No, for the original DDL that I posted, her trimming functions worked. They returned Beverages.

    I still only need the string between...

  • RE: trimming a string

    Lynn Pettis (4/11/2012)


    xenophilia (4/11/2012)


    No, for the original DDL that I posted, her trimming functions worked. They returned Beverages.

    I still only need the string between the first set...

  • RE: Syntax help required

    I think this is what you are looking for:

    with cte as (select ROW_NUMBER () OVER (PARTITION BY EVENTNUMBER ORDER BY TIMESTAMP ASC) as ROW, * FROM ExampleLog)

    SELECT * from cte...

  • RE: Need Help with the Error 'Subquery returned more than 1 value'.

    the select 1 just returns 1 instead of the multiple values for your exist(). and for the cursor, we need the table deffinitions and sample data before we can...

  • RE: Need Help with the Error 'Subquery returned more than 1 value'.

    suhailtajraja (4/11/2012)


    [Execute SQL Task] Error: Executing the query "/* removes Matters from timekeepers frequently use..." failed with the following error: "Subquery returned more than 1 value. This is not permitted...

  • RE: trimming a string

    xenophilia (4/11/2012)


    like this

    \dfsadfdsfsadfdsafdsaf\popopsfdasfasdfds\erwrewaafadsfdsfsadfdsfsdfsadfdsafsdfsdfdsdfdfsadfdsafdsfwrerewrewrewrewrewre

    once again that string works giving you dfsadfdsfsadfdsafdsaf when you run it through Lynn's parse

    DECLARE @tststr VARCHAR(MAX);

    SET @tststr = '\dfsadfdsfsadfdsafdsaf\popopsfdasfasdfds\erwrewaafadsfdsfsadfdsfsdfsadfdsafsdfsdfdsdfdfsadfdsafdsfwrerewrewrewrewrewre';

    SELECT SUBSTRING(RIGHT(@tststr,DATALENGTH(@tststr) - 1),1,PATINDEX('%\%',RIGHT(@tststr,DATALENGTH(@tststr) - 1)) - 1);

  • RE: trimming a string

    since it works on the data provided we can not go any further with out better data. please post some of the actual data you are running it on...

  • RE: trimming a string

    xenophilia (4/11/2012)


    when i run this:

    SELECT Distinct Outcome

    , TestNo

    , SUBSTRING(RIGHT('SuitePath',DATALENGTH('SuitePath') - 1),1,PATINDEX('%\%',RIGHT('SuitePath',DATALENGTH('SuitePath') - 1)) - 1)

    from testsuite

    i get this error

    Msg 536, Level 16, State 1, Line 1

    Invalid length parameter passed to...

Viewing 15 posts - 601 through 615 (of 859 total)