Forum Replies Created

Viewing 15 posts - 166 through 180 (of 219 total)

  • RE: Curiouse View to create for SQLServer 2005

    matt32 (2/10/2010)


    but you can create a sp instead when you want to use cte

    ... or you can create a view without OPTION clause and add OPTION to the SELECT statement...

  • RE: Comparing a hash

    john.arnott (2/2/2010)


    When the HASHBYTES() function fails with the input truncation error, it does not return NULL, but rather doesn't return anything.

    But usually SQL Server considers "nothing" as a NULL value.

    Here...

  • RE: Comparing a hash

    Hugo Kornelis (2/1/2010)


    The HASHBYTES does apparently indeed have an (undocumented!!) limit of 8000 bytes on it's input string.

    SET CAPTIOUS_MODE ON

    To be fair, it is documented in BOL 2008 (http://msdn.microsoft.com/en-us/library/ms174415.aspx):

    Remarks

    Allowed input...

  • RE: Comparing a hash

    Hugo Kornelis (2/1/2010)


    the result of the HASHBYTES algorithm now exceeds 8000 bytes

    No, it doesn't 🙂 The SHA-1 algorithm always produces 160-bit output, here is the proof: http://en.wikipedia.org/wiki/SHA#Comparison_of_SHA_functions.

    The warning is raised...

  • RE: Rowcount

    honza.mf (1/29/2010)


    And what about the answer "Any number, 1" or better "Nonnegative number, 1".

    Agreed 😎

  • RE: Rowcount

    darren.sunderland (1/29/2010)


    In SQL 2000 I get 0,1 for the first run in a new window

    Did you use Query Analyzer or SQL Server Management Studio?

  • RE: Rowcount

    stewartc-708166 (1/28/2010)


    when a new query window is opened, a connection is made to the database, which returns a result (not visible)

    this item is reflected in the @@rowcount as 1

    Not exactly....

  • RE: Query cost

    Hugo Kornelis (1/27/2010)


    the unneeded brackets around [name] (name is not on the list of reserved keywords, so no delimitation required)

    Sometimes I use those unneeded brackets too, because SSMS highlights "name"...

  • RE: Query cost

    Rune Bivrin (1/27/2010)


    This used to be true, and I have often used this knowledge to optimise slow-running queries. But since SQL 2005 it no longer matters from a performance point...

  • RE: Fast normalization of a denormalized data source, using surrogate IDs

    Nice example of set-based data processing.

    I have a few minor notes here:

    1)

    SELECT @Client_ID = ISNULL(IDENT_CURRENT('NT_Client'),0) + 1

    SELECT @OrderHeader_ID = ISNULL(IDENT_CURRENT('NT_OrderHeader'),0) + 1

    Note the use of ISNULL - this allows you...

  • RE: Database Size

    vk-kirov (1/23/2010)


    3)

    CREATE DATABASE [TestDB] ON PRIMARY

    ( NAME = N'TestDB', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\TestDB.mdf' ,

    SIZE = 3072KB , FILEGROWTH = 1024KB )

    LOG ON

    ( NAME...

  • RE: Database Size

    timfle (1/23/2010)


    link to 2008 BOL: ms-help://MS.SQLCC.v10/MS.SQLSVR.v10.en/s10de_6tsql/html/29ddac46-7a0f-4151-bd94-75c1908c89f8.htm

    excerpt of text:

    size

    Is the initial size of the file.

    When size is not supplied for the primary file, the Database Engine uses the size...

  • RE: Database Size

    timfle (1/22/2010)


    does anyone read MS documentation?

    Obviously vk kirov doesn't

    Of course I may have overlooked something. Could you please post a suitable link to BOL and explain my mistake? I'll be...

  • RE: Database Size

    Tom Garth (1/22/2010)


    I ran a simple CREATE DATABASE mydb

    ...

    Then I used the 2005 SSMS UI to create a 'New database'

    ...

    Bravo, Tom!

    Of course SSMS does not use the 'CREATE DATABASE xxx'...

  • RE: Database Size

    CirquedeSQLeil (1/21/2010)


    timfle (1/21/2010)


    The answer is the same size as the model database. And the size of the model database is determined by the dba.

    That would have been the best...

Viewing 15 posts - 166 through 180 (of 219 total)