Forum Replies Created

Viewing 15 posts - 1,021 through 1,035 (of 2,894 total)

  • RE: A quick query puzzle:

    adrian.facio (10/18/2012)


    Look, i came up with this, how do you like it?. I test the function in Winforms project but im pretty sure it will work nice in sql clr

    Imports...

  • RE: A quick query puzzle:

    If you need elegant and efficient solution for this problem then CLR using Static RegEx with compiled pattern is the way to go. I don't have VS with me now,...

  • RE: Getting the closest date to a given date

    ... Right now, that cte is returning me about a million records, and is taking around 30 seconds to run. I need to bring it down to around 2-3 seconds...

  • RE: Create select statement for the query

    Which tables all of these PLACE_OF_DELIVERY, PLACE_OF_RECEIPT and saisan_month columns come from?

    They are not in your DDL and you didn't use table aliases in your query...

  • RE: Create select statement for the query

    Ough man! You need to split this monster into parts...

    That will make it much more readable and most likely much more efficient...

  • RE: STATISTICS IO/TIME

    Grant Fritchey (10/18/2012)


    Abu Dina (10/18/2012)


    the most conflicts faced by me is key lookup in most of queries that i get time out

    Could this be considred a good hint to add...

  • RE: Cursor runs for a long time

    kapil_kk (10/18/2012)


    how to fetch one by one row using WHILE instead of cursor?

    That will not make much difference to a cursor.

    BUt I told to not to change the stored...

  • RE: Deleting the records without foreign key

    raghuveer126 (10/18/2012)


    i have datawarehouse database where there is only primary key and no foreign keys.

    I have a condition from one table and based on that condition i have to delete...

  • RE: STATISTICS IO/TIME

    Abu Dina (10/18/2012)


    the most conflicts faced by me is key lookup in most of queries that i get time out

    Could this be considred a good hint to add some covering...

  • RE: Cursor runs for a long time

    I don't think that Luis example will run (WHERE IsSuperUser AND...) , and he couldn't test it as you didn't supply any table DDL's.

    Yes, He is right it's possible to...

  • RE: Searching Columns for Seperate Strings

    Duplicate post with "changed" requirements:

    http://www.sqlservercentral.com/Forums/Topic1374194-391-1.aspx

  • RE: SSIS Package Inside Trigger keeps running endlessly

    Did your "above you" insisted that you should use trigger to execute XP_CMDSHELL? Or they just told you that SSIS should start as soon as records inserted?

    I would not...

  • RE: Re-entered : Searching Columns for Seperate Strings

    ;WITH Mysample (Record_id, Col1, Col2, Col3, Col4, Col5)

    AS

    (SELECT 101, 'A', 'A', 'B', 'A', 'A' UNION ALL

    SELECT 102, 'B', 'B', NULL, NULL, 'B' UNION ALL

    SELECT 103, 'C', 'C', 'C',...

  • RE: STATISTICS IO/TIME

    mah_j (10/18/2012)


    the most conflicts faced by me is key lookup in most of queries that i get time out.

    also there is a job that updates statistics of a table every...

  • RE: Dynamic Query in sql

    vikramchander90 (10/18/2012)


    Exact code used is this

    Create proceduretest1

    As

    Begin

    Declare@col1totalint

    Declare@col2totalint

    Declare@col3totalint

    Declare @dynqrynvarchar(max)

    Declare @counterint

    Select@counter=1

    While@counter<=3

    Begin

    Select@dynqry='Declare @col'+convert(varchar(5),@counter)+'total int'

    Select@col'+CONVERT(varchar(5),@counter)+'total=SUM(col'+CONVERT(varchar(5),@counter)+') FROM Table1'

    exec sp_executesql @dynqry

    Select @counter=@counter+ 1

    End

    Select @col1total,@col2total,@col3total

    End

    But even if i declare and assign value after executing the query...

Viewing 15 posts - 1,021 through 1,035 (of 2,894 total)