Does [ ] effect performance?

  • I want to create a temporary table and use "script table as" as below:

    CREATE TABLE #[TCallList001Local](

    [CSINO] [nvarchar](20) NULL,

    [TYPE] [nvarchar](15) NULL,

    ......

    )

    One co-worker recommend me that do not use [ ]. It will effect performance.

    Is it true?

  • They aren't really necessary in this example, but won't affect performance, and never hurts to use them.

    You need to put the # sign inside the bracket though.

    The Redneck DBA

  • To answer questions of this nature, uese the SET STATISTICS TIME, IO ON and you can learn for yourself what the effects of with [ ] or without [ ] are.

    SET STATISTICS TIME,IO ON

    CREATE TABLE [#TCallList001Local](

    [CSINO] [nvarchar](20) NULL,

    [TYPE] [nvarchar](15) NULL)

    SET STATISTICS TIME,IO OFF

    DROP TABLE #TCallList001Local

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply