Forum Replies Created

Viewing 15 posts - 2,866 through 2,880 (of 2,894 total)

  • RE: Create a self referencing table from join of 2 tables

    For the future, please supply create table and data insert scripts together with question. It will help helper 🙂

    That is what you need:

    DECLARE @FirstTable TABLE

    ( ParentID int , ParentName...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: TSQL Debug Logging

    I am wondering what your log sp logs when the main sp does something within transaction and transaction is rolled-back. Unlike Oracle there is no autonomous transaction concept in SQL...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Statement Errors But Resturns Results Anyhow

    UMG Developer (5/14/2010)


    I am having a problem where an Access application executes an adhoc SQL string which generates an error, the problem is that SQL Server 2005 (SP2 CU15) returns...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Find PreviousChange of date

    Try this:

    SELECT *

    FROM (SELECT ROW_NUMBER() OVER (PARTITION BY PropID

    ORDER BY LatestApptDate desc ) AS PARowNumber

    ,PrevApptID

    ...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Optimize query in 2005

    There is no straight answer to this. Its depends on many factors.

    For begining you can just add non-clustered indices for all these columns.

    And see if the query will start using...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: freetext problem

    It is well known issue with SQL Server full-text predicates.

    You can use dynamic sql with sp_executesql or -

    I have once used the following and it did work:

    IF ISNULL(@Param,'') =...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Optimize query in 2005

    First of all. You should better use JOIN for joining tables:

    select A.DTrackID, A.DVersion, A.Version, ...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: ASSERTION , SUM(POSITION()) in SQL2005

    Does SQL2005 support CREATE ASSERTION statement?

    >NO, you will need to use CHECK constraint (unfort. a bit different to SQL-92 CREATE ASSERTION idea)

    Does Sql2005 support SUM(POSITION()) ?

    >NO, use CHARINDEX/PATINDEX instead

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Help with Query

    Jeff Moden (5/12/2010)


    elutin (5/12/2010)


    1. Quirky Update is very fast, but has some limitations and it is using undocumented feature of the SELECT. If you've read the article I've mentioned...

    Yet you...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: select Last not null field in a datetime range

    Small modification to the given query will do what you want:

    ;WITH CTE as

    (

    SELECT MAX(TickID) AskSideRWsizeTickID

    FROM #TABLE WHERE AskSideRWsize IS NOT NULL

    UNION...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: sp_senddbmail return code 0 but mailitem_id is NULL

    Check this one:

    http://sql-articles.com/blogs/return-code-values-documentation-for-sp_send_dbmail-procedure/

    Most likely you have an error in your query, which can be due to some security issues...

    Check what the query string contains and execute it within SP.

    Actually, I...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: sp_senddbmail return code 0 but mailitem_id is NULL

    add the following to see what this sp returns:

    DECLARE @RtnCode INT

    EXEC @RtnCode = msdb.dbo.sp_send_dbmail...

    Check what is returned in the @RtnCode.

    0 - success, 1- failure.

    BUT! There are some more undocumented return...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Help with Query

    1. Quirky Update is very fast, but has some limitations and it is using undocumented feature of the SELECT. If you've read the article I've mentioned, you have seen that...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: sp_senddbmail return code 0 but mailitem_id is NULL

    Can you please include the exact line of code where you are calling sp_send_dbmail?

    Can you see the "Mail queued." message, which is returned on success?

    When the user sending the message...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Optimize query in 2005

    There is very simple answer to your question:

    To increase your query performance you just optimize it using well known query optimisation techinques.

    I do hope my detailed answer will help you...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

Viewing 15 posts - 2,866 through 2,880 (of 2,894 total)