SQL Server - Invalid characters in parameter names
问题 I need to know what are the valid characters to use in a SQL parameter name. Given something simple like SELECT * FROM tblTest WHERE testid = @[X] , if X contains a hyphen, for instance, the statement will fail. What are the valid characters for parameter names? 回答1: Search for "Identifiers" in your SQL Books online, and you should find: Rules for Regular Identifiers The rules for the format of regular identifiers depend on the database compatibility level. This level can be set by using sp