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...


    For faster help in answering any problems Please read How to post data/code on a forum to get the best help - Jeff Moden[/url] for the best way to ask your question.

    For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]

    Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
    Jeff Moden's Cross tab and Pivots Part 1[/url]
    Jeff Moden's Cross tab and Pivots Part 2[/url]

  • 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...


    For faster help in answering any problems Please read How to post data/code on a forum to get the best help - Jeff Moden[/url] for the best way to ask your question.

    For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]

    Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
    Jeff Moden's Cross tab and Pivots Part 1[/url]
    Jeff Moden's Cross tab and Pivots Part 2[/url]

  • 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 *...


    For faster help in answering any problems Please read How to post data/code on a forum to get the best help - Jeff Moden[/url] for the best way to ask your question.

    For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]

    Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
    Jeff Moden's Cross tab and Pivots Part 1[/url]
    Jeff Moden's Cross tab and Pivots Part 2[/url]

  • RE: Syntax help required

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


    For faster help in answering any problems Please read How to post data/code on a forum to get the best help - Jeff Moden[/url] for the best way to ask your question.

    For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]

    Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
    Jeff Moden's Cross tab and Pivots Part 1[/url]
    Jeff Moden's Cross tab and Pivots Part 2[/url]

  • 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...


    For faster help in answering any problems Please read How to post data/code on a forum to get the best help - Jeff Moden[/url] for the best way to ask your question.

    For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]

    Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
    Jeff Moden's Cross tab and Pivots Part 1[/url]
    Jeff Moden's Cross tab and Pivots Part 2[/url]

  • 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...


    For faster help in answering any problems Please read How to post data/code on a forum to get the best help - Jeff Moden[/url] for the best way to ask your question.

    For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]

    Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
    Jeff Moden's Cross tab and Pivots Part 1[/url]
    Jeff Moden's Cross tab and Pivots Part 2[/url]

  • 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...


    For faster help in answering any problems Please read How to post data/code on a forum to get the best help - Jeff Moden[/url] for the best way to ask your question.

    For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]

    Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
    Jeff Moden's Cross tab and Pivots Part 1[/url]
    Jeff Moden's Cross tab and Pivots Part 2[/url]

  • 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...


    For faster help in answering any problems Please read How to post data/code on a forum to get the best help - Jeff Moden[/url] for the best way to ask your question.

    For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]

    Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
    Jeff Moden's Cross tab and Pivots Part 1[/url]
    Jeff Moden's Cross tab and Pivots Part 2[/url]

  • 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...


    For faster help in answering any problems Please read How to post data/code on a forum to get the best help - Jeff Moden[/url] for the best way to ask your question.

    For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]

    Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
    Jeff Moden's Cross tab and Pivots Part 1[/url]
    Jeff Moden's Cross tab and Pivots Part 2[/url]

  • 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...


    For faster help in answering any problems Please read How to post data/code on a forum to get the best help - Jeff Moden[/url] for the best way to ask your question.

    For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]

    Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
    Jeff Moden's Cross tab and Pivots Part 1[/url]
    Jeff Moden's Cross tab and Pivots Part 2[/url]

  • 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...


    For faster help in answering any problems Please read How to post data/code on a forum to get the best help - Jeff Moden[/url] for the best way to ask your question.

    For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]

    Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
    Jeff Moden's Cross tab and Pivots Part 1[/url]
    Jeff Moden's Cross tab and Pivots Part 2[/url]

  • 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...


    For faster help in answering any problems Please read How to post data/code on a forum to get the best help - Jeff Moden[/url] for the best way to ask your question.

    For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]

    Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
    Jeff Moden's Cross tab and Pivots Part 1[/url]
    Jeff Moden's Cross tab and Pivots Part 2[/url]

  • 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);


    For faster help in answering any problems Please read How to post data/code on a forum to get the best help - Jeff Moden[/url] for the best way to ask your question.

    For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]

    Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
    Jeff Moden's Cross tab and Pivots Part 1[/url]
    Jeff Moden's Cross tab and Pivots Part 2[/url]

  • 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...


    For faster help in answering any problems Please read How to post data/code on a forum to get the best help - Jeff Moden[/url] for the best way to ask your question.

    For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]

    Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
    Jeff Moden's Cross tab and Pivots Part 1[/url]
    Jeff Moden's Cross tab and Pivots Part 2[/url]

  • 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...


    For faster help in answering any problems Please read How to post data/code on a forum to get the best help - Jeff Moden[/url] for the best way to ask your question.

    For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]

    Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
    Jeff Moden's Cross tab and Pivots Part 1[/url]
    Jeff Moden's Cross tab and Pivots Part 2[/url]

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