Forum Replies Created

Viewing 15 posts - 37,711 through 37,725 (of 49,566 total)

  • RE: Help us tune a query

    That looks a little better already.

    Try adding an index on the temp table. Put this on before you insert the data into the temp table.

    CREATE CLUSTERED INDEX idx_TopScores_RowNumberUserID ON...

  • RE: How to use CASE statement in Procedure

    Case is only used within a query. You'll have to use IF statements, like what Terrance has shown you.

  • RE: Help us tune a query

    As a first try at indexes, and without seeing any of the other queries against this table..

    Add an index:

    PointsCategory, UserID INCLUDE Date, PointsScored

    I know there's a similar existing index, but...

  • RE: Help us tune a query

    Mel Harbour (7/13/2009)


    It would be relatively straightforward to split it into running two completely separate SPs for the two cases.

    As a first step, before getting into indexing, I would suggest...

  • RE: Help us tune a query

    Ouch. 100000 rows in a table variable, a clustered index scan on the users table and a seek that's returning most of the table on the points... Not fun.

    Dunno if...

  • RE: Are the posted questions getting worse?

    Dave Ballantyne (7/13/2009)


    You can lead a horse to water but you cant force him to drink

    http://www.sqlservercentral.com/Forums/Topic751918-8-2.aspx?Update=1

    On second thoughts, I think I'm leaving that thread alone...

    tatcalltype ='null'

    Why.....

  • RE: Help us tune a query

    Dave Ballantyne (7/13/2009)


    My First thoughts are to create a nightly , 'Year to date' table of the summarised data.

    Obviously 99% of the users have no updates throughout the...

  • RE: Help us tune a query

    Hi Mel

    Could you please post index definitions and execution plan, as per http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

    😉

    What's the reasoning behind this?

    WHERE PointsCategory = ISNULL(@PointsCategory, PointsCategory)

    That kind of construct tends to play havok with indexing....

  • RE: How to recover my user database if LDF is lost?

    andresysbl (7/13/2009)


    mmmm

    exec sp_attach_single_file_db 'MYDATABASENAME',

    'PATH and NAME DATABASE FILE'

    Example:

    exec sp_attach_single_file_db 'test',

    'c:\test.mdf'

    Deprecated in SQL 2005, will be removed in a future version. Rather use CREATE DATABASE ... FOR ATTACH or CREATE DATABASE...

  • RE: Slow SQL Query

    Can you post index definitions please? From the plan there looks like an obvious index but without seeing the existing indexes....

  • RE: ALTER DATABASE SGCT SET SINGLE_USER

    river (7/13/2009)


    If i install only the client tools (management studio) on a desktop, when i connect to this server trought this GUI and make a query, this query is not...

  • RE: convert varchar to timestamp

    ps (7/13/2009)


    GilaMonster (7/13/2009)


    mysticslayer (7/12/2009)


    The issue here is that I get an parameter filled with quotes.

    Not quite sure what you mean here. Could you give more detail?

    Perhaps he's getting data...

  • RE: convert varchar to timestamp

    mysticslayer (7/12/2009)


    The issue here is that I get an parameter filled with quotes.

    Not quite sure what you mean here. Could you give more detail?

  • RE: convert varchar to timestamp

    Try making the parameter a varbinary instead of a varchar.

    ALTER PROCEDURE [dbo].[sp_example]

    (

    ...

  • RE: GUID or Int is the best for primary key columns?

    Dave Ballantyne (7/13/2009)


    Also the randomness can be an issue , though newsequentialid can overcome this. See this link

    That's if the primary key is the clustered index, which...

Viewing 15 posts - 37,711 through 37,725 (of 49,566 total)