Forum Replies Created

Viewing 15 posts - 151 through 165 (of 241 total)

  • RE: Optimizing Stored Procedures that utilize only local variables (and lots of them)

    Where local variables get their values from?

    You should probably post some code. (Pick the simplest of your procedures).

    It would be hard to recommend (or not recommend) the use of...

    --Vadim R.

  • RE: Extract string between delimiters

    subbareddy542 (8/21/2012)


    pls try below code....

    DECLARE @t table(id int,name varchar(50))

    insert into @t(id,name)values(1,'abc_def_cet_qwe'),(2,'abc_dek'),(3,'def_rag'),(4,'pes_rfg_def')

    DECLARE @Del1 varchar(50)='def'

    select id,case when PATINDEX('%'+@Del1+'%',name)>0 then SUBSTRING(name,PATINDEX('%'+@Del1+'%',name),len(@Del1)) end as Sup

    from @t

    ;-)Or you can do this:

    SELECT id, Sup = 'def'

    FROM...

    --Vadim R.

  • RE: CONVERT DATA COLUMN TO ROW WTIH COMMA

    Using Luis' setup:

    DECLARE @test-2 table(

    col1int)

    INSERT INTO @test-2

    SELECT 1 UNION ALL SELECT

    2 UNION ALL SELECT

    3 UNION ALL SELECT

    4 UNION ALL SELECT

    5 UNION ALL SELECT

    6...

    --Vadim R.

  • RE: How to get sub total on non-numeric field in SSRS?

    naisu1383 (8/19/2012)


    Actually i am counting mail returns for month field if any. So for that i need count of month for particular month and then total of mail returns for...

    --Vadim R.

  • RE: How to get sub total on non-numeric field in SSRS?

    What is the meaning of

    January + February + March + .... ?

    What do you mean by total? Do you mean total number of days between MIN(Month) and MAX(Month)?

    --Vadim R.

  • RE: Convert Text to Date DataType

    Eugene Elutin (8/17/2012)[hr03? That is old ambulance number in Russia, you can use just 3 ...:hehe:

    Oh yea, 03 ?????? ??????. Long time ago, in another life...

    --Vadim R.

  • RE: Catching the output of RAISERROR()

    If you know message_ID and parameters can you quiery sys.messages and reconstruct the actual message?

    --Vadim R.

  • RE: SEPARATE WTH HYPHEN TO STRING again

    If you know positions you can use STUFF function:

    SELECT STUFF('AD675498IJU76', 5, 0, '-')

    SELECT STUFF(STUFF('AD675498IJU76', 5, 0, '-'), 8, 0, '-')

    SELECT STUFF(STUFF('AD675498IJU76', 5, 0, '-'), 9, 0, '-')

    --Vadim R.

  • RE: Convert Text to Date DataType

    Instead of 103 use 03

    DECLARE @D CHAR(10) = '17/08/12'

    SELECT CONVERT(date, @D, 03)

    --Vadim R.

  • RE: T-SQL Syntax

    Indeed, very difficult and controversial question.

    Counted Function and Procedure as different constructs but missed EXEC and RECEIVE.

    Oh well, as soon as we learn something…

    Also, what about UPDATE/INSERT/DELETE @tablevar ?

    --Vadim R.

  • RE: Insert records into one table form other table

    komal145 (8/15/2012)


    Issue is there is Aid with both "runquote" and "generatedocument" , need to load Aid with "Runquote",

    and then load the Aid's which are not "runquote" but with "Generatedocumnet"

    example: AID...

    --Vadim R.

  • RE: NULL

    Thank you for a nice easy question.

    But I'm not sure about explanation (or maybe I'm just reading it wrong):

    The Null value also matches the condition in case of Not Operators...

    --Vadim R.

  • RE: Insert Into Using OpenQuery Causes Massive Fragmentation

    Could it be that data that comes from OPENQUERY is in completely different Order then when you copy table to table?

    --Vadim R.

  • RE: How was the record deleted!!

    78869 to 78874 - that is 6 records you said you inserted 5 ?

    --Vadim R.

  • RE: Linked server error.

    TRUSTWORTHY on the remote databases is not set? just guessing...

    --Vadim R.

Viewing 15 posts - 151 through 165 (of 241 total)