Forum Replies Created

Viewing 15 posts - 1,396 through 1,410 (of 1,923 total)

  • RE: Return txt from string

    2Tall (6/7/2010)


    I implemented the last post and it is just what I was looking for.

    Great work guys.

    Many Thanks,

    Phil.

    Phil, i have edited my code, please use the latest code. Sorry for...

  • RE: Return txt from string

    skcadavre (6/7/2010)


    ColdCoffee (6/7/2010)


    If your request is what Sckadavre is saying, then this might help you! This code doesn use a self-referencing CTE, but assuming your string contains only one Key1:...

  • RE: date format in stored procedure

    Yes it will be.. but if u be bit more specific on what you need, then v might provide a better solution..

  • RE: date format in stored procedure

    Kavya,, try this:

    create procedure USP_InsertStatusText(@Statustext char(150),@RecievedBy varchar(50),@Deliverydate datetime)

    as

    BEGIN

    declare @date datetime

    set @Deliverydate= convert(varchar,@Deliverydate,1) --as [mm/dd/yy] from TB_StatusEntry

    insert into TB_StatusText values(@Statustext,@RecievedBy,@Deliverydate)

    END

    But i tell, you, please store the date field in...

  • RE: Return txt from string

    If your request is what Sckadavre is saying, then this might help you! This code doesn use a self-referencing CTE, but assuming your string contains only one Key1: "

    DECLARE @DELIMITER...

  • RE: Return txt from string

    If thats NOT what you wanted, then please tel us your desired result based on the input recored set i provided..

  • RE: Return txt from string

    Broadening the input result set:

    Sample table and sample data

    DECLARE @table TABLE ( STRING VARCHAR(64) )

    INSERT INTO @table

    SELECT '7487-OEM-00011193-0010(Key: HHYUR-86HZH-99V96-JKL0-88895)'

    UNION ALL...

  • RE: Return txt from string

    Hey Phil, is this what you are looking for?

    DECLARE @str VARCHAR(64)

    SET @str = '7487-OEM-00011193-0010(Key: HHYUR-86HZH-99V96-JKL0-88895)'

    SELECT SUBSTRING(@str,( CHARINDEX('Key:',@str)+5 ) , (CHARINDEX ('-',@str,CHARINDEX('Key:',@str)) - (CHARINDEX('Key:',@str)+5 ) ) ) KEY_FIRST_PART

  • RE: Extract string before character occurrence.

    Gopi Muluka (6/4/2010)


    ColdCoffee,

    Here the reason for the error message he received is whenever there is no '-' found in the string then CHARINDEX('-', @FieldName)-1 will return -1 ,

    Taking...

  • RE: flagging last 60days data

    ColdCoffee, the OP said 60 days, not 2 months, right?

    Initially, the OP said it is 60 days, but if u could see the quote i my previous post, the...

  • RE: Extract string before character occurrence.

    hey there, this might help you.

    First lets set-up sample data and table

    DECLARE @TABLE TABLE (STRING VARCHAR(100))

    INSERT INTO @TABLE (STRING)

    SELECT 'E01234/1-1'...

  • RE: flagging last 60days data

    For ex. today 5 June, it has to flag the data starting from 5 april

    Dehqon, from this requirement, i see that you are interested in the same day of the...

  • RE: Timeout expired

    Luca, why not break the 187998 rows into chunks of say 10000 and then carry out your processing ?? AS u have rightly said, CURSORs are troublesome, try using set-based...

  • RE: Help to understand CROSS JOIN

    Rod at work (6/3/2010)


    Thank you, ColdCoffee, for using a simpler example. That makes the concept of CROSS JOIN with a WHERE clause easier to understand.

    Wow, such a nice feeling...

  • RE: Trying to optimize a WHERE clause

    Ray K, nice that you have fixed the code, but for soehting called SQL Injection, you will still need to tweak the code a bit.. Please go through these following...

Viewing 15 posts - 1,396 through 1,410 (of 1,923 total)