work around

  • Server: Msg 170, Level 15, State 1, Line 1

    Line 1: Incorrect syntax near '2'.

    Server: Msg 170, Level 15, State 1, Line 1

    Line 1: Incorrect syntax near 'ersonName style="BACKGROUND-POSITION: left bottom; BACKGROUND-IMAGE: url(res://ietag.dll/#34/#1001); BACKGROUND-REPEAT: repeat-x">testersonName>'

     

    The database is "2test" and I have noticed that any database that starts with a number gets this error when clearing the transaction logs with:

    "USE 2test

    GO

    DBCC SHRINKFILE (2test_log, 1)"

    is there a work around for this?

  • Yes, there is a workaround! Avoid using numbers for identifiers in the first place generally in SQL Server.

    Another workaround might be

    USE [2test]

    GO

    DBCC SHRINKFILE ([2test_log], 1)

    Note the [ ]

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • Great Thanks! I have inherited this, so I will have to do the best I can to get it in order. Other than clearing transation logs what other problems can this cause that I will need to be aware of?

  • I would say, any place where you need to reference to the db name, there might be a potential issue. Such as BACKUP, RESTORE, maintenance... Butr it should be safe with the []

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

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

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