Forum Replies Created

Viewing 15 posts - 1,966 through 1,980 (of 1,983 total)

  • RE: The Numbers Table

    peter (11/25/2008)


    jacroberts (11/25/2008)


    Adam Machanic (11/25/2008)


    Anyone can take any example and change it so it performance is important.

    You're absolutely right! Why do you suppose that it happens to be so...

  • RE: The Numbers Table

    Adam Machanic (11/25/2008)


    Anyone can take any example and change it so it performance is important.

    You're absolutely right! Why do you suppose that it happens to be so easy?

    Is it...

  • RE: The Numbers Table

    Adam Machanic (11/25/2008)


    If you have a daily report that is run in batch, with no user waiting at the end of a button for the result, it doesn't matter if...

  • RE: The Numbers Table

    timothyawiseman (11/24/2008)[hr

    >>The problem is that your example did not show a case where efficiency is not a concern.

    >>But, in your example you say there is no need to worry about...

  • RE: The Numbers Table

    timothyawiseman (11/24/2008)


    jacroberts (11/24/2008)


    Performance isn't always an issue as in my previous example.

    I agree with Jeff that performance should always be a concern. After all, you may eventually need that...

  • RE: The Numbers Table

    You could also create tables with different number bases e.g for binary:

    WITH Digits (i,s)

    AS

    (

    SELECT 0 AS [Value], '0' AS String UNION ALL SELECT 1, '1'...

  • RE: The Numbers Table

    Adam Machanic (11/24/2008)


    Joe Celko (11/24/2008)


    Here is another method, which uses a tale of digits and some math

    CREATE TABLE Sequence (seq INTEGER NOT NULL PRIMARY KEY);

    WITH Digits (i)

    AS

    (VALUES (0),...

  • RE: The Numbers Table

    Performance isn't always an issue as in my previous example.

  • RE: The Numbers Table

    It depends how much performance is an issue, for a lot of queries it is not. For example, if there is a daily report that runs in batch it would...

  • RE: The Numbers Table

    I'd consider using a table valued function instead that only returns the rows I'm interested in:

    e.g.:

    CREATE FUNCTION [dbo].[Nums]

    (

    @StartNum int,

    @EndNum int

    )

    RETURNS @table...

  • RE: T-SQL Code Optimizers

    Can you show use the before and after SQL so we can see how well it did?

  • RE: NULL Equals NULL?

    donnelcyril (11/9/2008)


    Hi,

    I am having problems with my queries which I definitely think is because of null values. This is what I want to do:

    Find out a list of phone numbers...

  • RE: Identifying Queries Running Slower Than Normal

    Akash Agarwal (8/13/2008)


    I m getting ther error on the line

    CROSS APPLY sys.dm_exec_sql_text(qs.plan_handle) qt

    while creating the Proc

    The error is

    Msg 102, Level 15, State 1, Procedure dba_QueryTimeDelta1, Line 49

    Incorrect syntax...

  • RE: Identifying Queries Running Slower Than Normal

    I've added a NullIf function to prevent the divide by zero error:-------------------------------------------------------------------------- ----------------------------------------------------------------------------------
    -- Purpose: Identify queries that are running slower than normal,
    -- when taking into account...

  • RE: Identifying Queries Running Slower Than Normal

    Here's one with divide by zero error removed and indentation:

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

    -- Purpose: Identify queries that are running slower than normal,

    -- when taking...

Viewing 15 posts - 1,966 through 1,980 (of 1,983 total)