Forum Replies Created

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

  • RE: The Numbers Table

    I'll add that recursion isn't much better than a While loop and is sometimes worse.

    I beg to differ. Recursion (in T-SQL) is always worse than a while loop!...

  • RE: The Numbers Table

    Ed W. (11/24/2008)


    Ok, so you populated a table with numbers. Everyone can argue about how to do that, but the real question is what do you DO with the table...

  • RE: The Numbers Table

    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), (1), (2),...

  • RE: The Numbers Table

    jeffery.baynard (11/24/2008)


    Itzik uses RECURSION, even faster.

    With nums as

    (

    Select 1 as n

    Union all

    Select n+1 from nums where n < 10

    )

    Select n

    From nums

    Sorry,...

  • RE: The Numbers Table

    CheeseMan316 (11/24/2008)


    Adam Machanic (11/24/2008)


    Just throw the CTE into an inline TVF. In my tests it almost always performs equally fast, and sometimes is even faster, than using a table.

    Adam...

  • RE: The Numbers Table

    Just throw the CTE into an inline TVF. In my tests it almost always performs equally fast, and sometimes is even faster, than using a table.

  • RE: Text Data

    Not only is the feature deprecated, but barely anyone used TEXTPTRs anyway 🙂

    By the way, when I saw "text data pointer" I thought the question was talking about the 24...

  • RE: Predict output

    As others have mentioned, a sort is not the only option, and the NULL may or may not come first... No one actually showed this yet, though, so here you...

  • RE: Things You Didn't Know About Temp Tables and Table Variables

    sandeep.pote (9/23/2008)


    We can add constraints on table variable like primary key, unique key and chekc constraints etc ...

    ...

    We cannot create non clustered index on table variable ...

    Just to clarify this...

  • RE: The Glue that Binds

    Grant Fritchey (9/23/2008)


    While our team has chosen nHibernate and not Entity Framework ...

    Just keep thanking your lucky stars that they didn't choose EF... Here's a thread someone sent me yesterday...

  • RE: The Glue that Binds

    Timothy (9/22/2008)


    I'm just curious, how would you expect any object relational mapper to handle the case of varying results from a procedure? What kind of result type would you expect...

  • RE: The Glue that Binds

    Timothy (9/22/2008)


    In those cases you'd have to write some code yourself in the designer, it wouldn't be automatic...meh, never mind.

    Exactly; doing that work would defeat the whole purpose of LINQ....

  • RE: The Glue that Binds

    Timothy (9/22/2008)


    Adam Machanic (9/22/2008)


    Now if we could just get stored procedures that exposed well-defined output contracts, the sweet spot would be clear: LINQ to SQL to stored procedures.

    Unless I'm missing...

  • RE: The Glue that Binds

    Matt Miller (9/22/2008)


    The overhead I'm talking about is comparing LINQ-enabled perf vs not. From what I can tell - there's a non-negligible perf penalty, just by adding in LINQ....

  • RE: The Glue that Binds

    Matt Miller (9/22/2008)


    If you're going to encapsulate your data calls in a "true" DAL - what advantage do you get out of LINQ? Why not finish encapsulating the calls...

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