unable to select rows from table | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

unable to select rows from table

I have created one table named ‘050323’.This is just for storing test data ..no important data in this table.
But I am unable to select any records from this
tabke.Whenever I use ‘select top 3 from 050323’ I get the following error.I have tried all alternative to select rows from this table by QA..but no success.
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near ‘050323’.
Have you tried SELECT TOP 3 * FROM [050323]? This might solve the problem. CanadaDBA
the top caluse in select statement needs * or any column name to be executed without errors.
so correct syntax is
select top 3 * from table_name
select top 3 field1 from table_name
As FarhadR posted, if the table name is number it should be used within []. But it is advisable not to use numbers as column or table names
Madhivanan Failing to plan is Planning to fail
sometimes i do silly mistakes <img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ />