Forum Replies Created

Viewing 15 posts - 2,191 through 2,205 (of 2,647 total)

  • RE: Remove Duplicates in Result as the Query Executes

    Run this on your temp table:

    with duplicates as (select duplicatecolumn1,duplicatecolumn2, row_number() over (partition by duplicatecolumn1, duplicatecolumn2 order by duplicatecolumn1, duplicatecolumn2) as rowno

    from tablename

    ) delete from duplicates where rowno > 1;

    Thanks,

    Jared

  • RE: SQL Server database location changes

    It can be annoying to have to change the location every time you restore or create a new database. That's about it. Also, if you have no files in...

  • RE: SQL Server database location changes

    You can change the defaults and restart SQL Server to take effect. However, there are no issues with having the files located somewhere other than the defaults.

    Thanks,

    Jared

  • RE: Use of WITH(NOLOCK)

    Ninja's_RGR'us (11/10/2011)


    Trying to clear up the air :

    You get the data movement error... when there's data movement. That means pagesplit or possibly if a record is moved to...

  • RE: Managment Studio. Different PC's give different result for same query.

    Scott Levy (11/10/2011)


    How did you refresh the local cache, Scott?

    Edit | Intellisense | Refresh Local Cache (Shift+Control+R)

    It only appears when you have a query open for editing I think.

    Scott

    Just to...

  • RE: Use of WITH(NOLOCK)

    Iulian -207023 (11/10/2011)


    Page splits might be due to index fragmentation

    Iulian

    Actually, I believe that is reversed... index fragmentation comes from page splits. However, that's besides the point. I'm sorry I'm...

  • RE: timeouts on SQLServer with SQLTrace_Lock

    Sapen (11/10/2011)


    Thanks Jared I will start digging into these

    Also, In the sql server error log I am seeing the below errors at the same time when the timeouts occurred.

    Process 0:0:0...

  • RE: Use of WITH(NOLOCK)

    Iulian -207023 (11/10/2011)


    Thank you Ninja's_RGR'us and GilaMonster for the very good examples: charts with aproximate values and session tables.

    Jared I don't think that NOLOCK can generate the...

  • RE: timeouts on SQLServer with SQLTrace_Lock

    Sapen (11/10/2011)


    Its not a trace but a job that inserts into the monitor table. Infact, I created this table and the job just to track the cause for this timeout...

  • RE: How to retrieve tables , sp's, views , functions related to a particular field?????

    For searching SPs:

    USE dbName

    SELECT Distinct SO.Name

    FROM sysobjects SO (NOLOCK)

    INNER JOIN syscomments SC (NOLOCK) on SO.Id = SC.ID

    AND SO.Type = 'P'

    AND SC.Text LIKE '%Text needed%'

    ORDER BY SO.Name

    For searching columns:

    SELECT o.name as...

  • RE: need query help

    apatel 89420 (11/10/2011)


    hi,

    I have a table that i need to query to get distinct procduct # > 2009-01-01.

    table structure

    Product # ProductManager Status ...

  • RE: timeouts on SQLServer with SQLTrace_Lock

    Sapen (11/10/2011)


    The system has encountered difficulty:

    SQL Command Failed; SQL = gw_LookupURI

    ---------------------------------------

    This message originates

    in FillDataSetFromStoredProc(),

    in the w3wp process on the server

    WEBSERVER:

    AppDomain = /LM/W3SVC/4/ROOT/EZMed-1-129652918758885483

    ---------------------------------------

    System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed...

  • RE: Updating Stats

    GilaMonster (11/10/2011)


    Start with the auto_stats events. See how often they really happen.

    For queries affected by poor stats, normal monitoring and look for queries with erratic durations. Investigate and see...

  • RE: Use of WITH(NOLOCK)

    Iulian -207023 (11/10/2011)


    What is happening if for example there is one table that updates on a daily basis,

    another table that updates every hour and there is a query that...

  • RE: Updating Stats

    Also Gail, could you point me in a direction or tell me how to test/monitor this? Would I do it for a specific query or look at wait stats...

Viewing 15 posts - 2,191 through 2,205 (of 2,647 total)