Forum Replies Created

Viewing 15 posts - 361 through 375 (of 5,394 total)

  • RE: Combined Ranking

    If you have to eliminate fruit that are not completely covered by the stock, this should work:

    SET STATISTICS TIME ON;

    SET STATISTICS IO ON;

    DECLARE @tmp TABLE(fruit VARCHAR(50),shop VARCHAR(10),preference INT, qty INT)

    INSERT...

  • RE: Combined Ranking

    I don't understand what should happen if there is not enough stock to cover the order. Should the fruit be ignored?

    Can you post the expected output based on that sample...

  • RE: RAM,Max,Min,CPU counts by T-SQL

    You need the VIEW SERVER STATE permissions to run this query:

    SELECT cpu_count AS [Logical CPU Count], hyperthread_ratio AS [Hyperthread Ratio],

    cpu_count/hyperthread_ratio AS [Physical CPU Count],

    --physical_memory_in_bytes/1048576 AS [Physical Memory (MB)] ...

  • RE: Terminator 5 Movie Review

    Spam, reported

  • RE: Are the posted questions getting worse?

    ChrisM@Work (6/22/2015)


    Alvin Ramard (6/22/2015)


    GilaMonster (6/22/2015)


    It's starting to look like the replication which keeled over last week did so because the passwords on the distributor were changed. If I've lost my...

  • RE: executing a cte

    I formatted the code and added some commenst.

    It should be clearer now.

    -- this defines a CTE: think of it as an "inline view"

    -- that you can reference anywhere in...

  • RE: executing a cte

    It deletes from the #temp table. If you don't understand this code, don't use it.

  • RE: Opening 1433 port for SQL Server cluster

    The clients will never use the node IP address to connect to SQL Server. Just open the port on the virtual IP address.

  • RE: Combined Ranking

    bugg (6/19/2015)


    spaghettidba (6/19/2015)


    Ah, great. Glad I could help.

    Might sound like a weird question, but: is this really a database for selling fruit? 🙂

    🙂 not fruit but selling other products,...

  • RE: Combined Ranking

    Ah, great. Glad I could help.

    Might sound like a weird question, but: is this really a database for selling fruit? 🙂

  • RE: Combined Ranking

    I assume you didn't see my latest attempt. It should solve your speed issues.

  • RE: Combined Ranking

    I just noticed that I'm an idiot: the RN column is already the running sum in this case, so you don't need to calculate it with another triangular join:

    DECLARE @tmp...

  • RE: Combined Ranking

    Sorry, I repeated my tests and yes, it's dog slow 🙂

  • RE: Combined Ranking

    If you have thousands of fruits, probably sys.all_columns does not have enough rows for your tally table. You may need to CROSS JOIN with sys.all_columns again and select just the...

  • RE: Job running for hours longer than expected

    Probably the query that reads the data is using a different execution plan than usual. Try detecting it using sp_whoisactive.

Viewing 15 posts - 361 through 375 (of 5,394 total)