Forum Replies Created

Viewing 15 posts - 136 through 150 (of 192 total)

  • RE: 100,000 random numbers without cursor

    The system table cross join method is really slick (and it is a lot smaller!). The only downside is it adds I/O overhead to the query (~52,000 reads in SQL2k)...

  • RE: 100,000 random numbers without cursor

    If I understand your comment correctly, could you not just append an:

    ORDER BY 1

    to the query?

  • RE: What''''s faster - Inner or Outer Join

    Good Points Gift Peddie and Antares686. For some reason, I was thinking in join operators. Sorry guys!

  • RE: how to EXEC with no output???

    you can't return results from EXEC() into a varchar. (unless you take the results out of the table variable)

    I may be missing something here, but why are you using...

  • RE: how to EXEC with no output???

    To elaborate, @Results is a table variable with a schema to match the output of your query.

  • RE: how to EXEC with no output???

    Try this:

    INSERT INTO @Results

    EXEC (@FileExist)

  • RE: What''''s faster - Inner or Outer Join

    That is a very subjective question.

    It depends on how the tables and columns are indexed, what join operater is used, etc.

    Examples:

    are both columns in the join predeicate indexed at all,...

  • RE: 100,000 random numbers without cursor

    I would be surprised if there was a faster way to do it than this... (let me know if you want a different type of random number) Oh, and for...

  • RE: single space and empty string

    Your example will give you the same results nomatter how your db is configured.

    Len will always implicitly trim trailing spaces, datalength will not. Be aware, though, that datalength and len...

  • RE: single space and empty string

    SQL Server does sometimes treat a space as the same as an empty string.

    This occurs when the database compatibility is set to 65 or lower.

    To quote MSDN:

    Whether SQL Server...

  • RE: SUM(Varchar Column). Is this Possible?

    What is the max width of your comment column? Could you please provide the schema for your two tables?

    Thanks

  • RE: SUM(Varchar Column). Is this Possible?

    /*************************************

    *** Set up example table structure ***

    *************************************/

    CREATE TABLE #order

    (

        Order_id    INT    PRIMARY KEY CLUSTERED

        -- ... 

    )

    CREATE TABLE #OrderComment

    (

        CommentID   INT     PRIMARY KEY NONCLUSTERED,

        Order_ID    INT     REFERENCES #order(Order_Id),

        Comment     VARCHAR(500)

        -- ...

    )

    CREATE CLUSTERED INDEX IXC__OrderComment__Order_Id 

  • RE: SUM(Varchar Column). Is this Possible?

    You can definitly concatenate rows in a select statement. Give me a few mins and I'll give you an example

  • RE: Error handling deadlock issue

    In SQL 2000 (and earlier) a deadlock will terminate the process. The only way to handle errors (that I know of) is to code error handling logic outside the scope...

  • RE: Not using index

    There are a number of reasons SQL make the decesion not to use an index. Sometimes the query optimizer determines that a bookmark lookup is more costly than a clustered...

Viewing 15 posts - 136 through 150 (of 192 total)