Solution for database table names starting with SQL Server numbers: SQL Server
Today I encountered a depressing problem about the database table name.
The table name of the SQL Server database can start with a number, but the table name cannot be directly written during query, as shown below:
Select *
Form into tablename
An error is reported during execution. However, you can add brackets to the table name, as shown below:
Select *
From [using tablename]
When developing with DataSet in VS, an SQL statement is automatically generated, but some of the generated SQL statements are enclosed by square brackets, but some are not added,
During program execution, the correctness of the statement cannot be determined, and errors cannot be easily found during debugging.
Therefore, we must standardize the process of writing SQL statements in the future. It is best not to start the table name with a number.