Forum Replies Created

Viewing 15 posts - 61 through 75 (of 97 total)

  • RE: search pattern in select statement

    Oh,

    I didn't explain my idea correctly, where you understood

    REPLACE(Sequence, ',', ',,') + ',,'I tried to express

    ',' + REPLACE(Sequence, ',', ',,') + ',',...

  • RE: search pattern in select statement

    Thanks Yatish, your explanations are clear. I have only a doubt: "A" and "A+" are different letters at all?, or there is any obscure relation between these two letters?. If...

  • RE: search pattern in select statement

    Hello yatish,

    I'm just curious because these kind of requirements looks more as a puzzle than a real life requirement. Could you explain briefly what's the need for this kind of...

  • RE: stored proc occasionally hangs?

    Hello sqldba_icon,

    seeing your query there are two things focused my attention and looked strange to me:

    The NOT EXISTS clause. As pointed by Kevin it could be bad for the optimization...

  • RE: Stored Procedure does nothing in job

    Hello,

    a problem I encountered at some times is assuming wrong date formats. In your query you have a clause,

    where bss.x2besuchsdatum >= '05.02.2010'

    and this clause could be the origin of your...

  • RE: Query to insert MonthID in a table

    Hello,

    You want to be careful here. The OP never stated what datatype the MonthID field was, but, unless he was doing an implicit conversion in his original code, it looks...

  • RE: Query to insert MonthID in a table

    Hello,

    as I understand you are trying to add the next MonthID in your table, irrespective of the current month.

    And there is another problem, you are trying to use date functions...

  • RE: Apostrophe in Stored Proc

    Hello,

    Grant, it is true that single quotes create troubles but when they are used in dynamic SQL queries; in this case the query is static, single quotes should not produce...

  • RE: query performance

    Hello,

    seeing your query I realize there is some code in excess. Your query is like this,

    SELECT * FROM

    (

    SELECT ...

    UNION ALL

    SELECT ...

    ) TotalStartsTable

    you can remove the outer query.

    Next, your UNION...

  • RE: UNION ALL is hanging the server and is very slow.

    Hello faisalkhanbk,

    when you code

    select invoiceno,invoicedt,customerid,0,0,invoiceamt,0,0,0 from v_aging where datediff(day,CreditPeriodDate,getdate())>=7 and datediff(day,CreditPeriodDate,getdate())<30

    you force SQL Server to made calculations over CreditPeriodDate for each row. That's bad because you can code it in...

  • RE: Updating millions of records

    Hello,

    maybe you have a problem blocking this volume of data. You can face this kind of massive updates using a cursor and commiting rows regularly, following this schema:

    DECLARE CUR CURSOR...

  • RE: BULK Import from a file with decimal values

    ha ha, I'm sorry, a Google search was an option that I didn't think about.

    Changing the regional settings doesn't work, my machine works with spanish settings and this machine is...

  • RE: how to write this query

    Hi,

    change your JOIN into a LEFT JOIN, and select all rows that aren't in PROD;

    select A.timestamp,A.point_id,A._VAL from DEV.DEVTABLE.dbo.DATA_LOG A

    LEFT join PROD.PROTABLE.dbo.DATA_LOG B

    on A.timestamp = B.timestamp and A.point_id = B.point_id collate...

  • RE: newbie - how to insert [FILE_RUN_DATE] [varchar](8) NULL into destination column [FileRunDate] [datetime] NULL

    Hello,

    your CONVERT sentence looks right, I tried this,

    WITH X AS (SELECT '20110101' AS FILE_RUN_DATE

    UNION SELECT '20110202'

    UNION SELECT '20110303'

    UNION SELECT '20110404')

    SELECT convert(datetime,[FILE_RUN_DATE],112) AS 'FILE_RUN_DATE' FROM X

    and it worked well. When...

  • RE: ERROR cursor:The cursor does not include the table being modified or the table is not updatable through the cursor.

    Hello,

    your cursor is over a table named dbo.source_table, so your update must be over the same table;

    Update dbo.Customer

    Set CompanyName=@CmpName

    where CURRENT OF Cursor1

    This code doesn't work because Cursor1 doesn't point to...

Viewing 15 posts - 61 through 75 (of 97 total)