SSMS 18.9.2 bug in Data Compression Wizard - calculate

Erik van de Burgwal 1 Reputation point
2021-09-10T08:41:25.69+00:00

SSMS: Select Table (right click) > Storage > Manage Compression > Next > Page > Calculate
When the database-name contains character - , the button will not execute the calculation because the SQL generated does not escape the database name properly;

USE u-test
Database 'u' does not exist. Make sure that the name is entered correctly.

Verified in SSMS 18.9.2

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,129 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. ErickMarcia 1 Reputation point
    2021-09-10T13:30:08.803+00:00

    Prueba con [u-test]
    Nota: Para evitar este tipo de problema entre las mejores prácticas de desarrollo de base de datos, se recomienda no hacer uso de guiones "-".

    Try with [u-test]
    Note: To avoid this type of problem among the best database development practices, it is recommended not to use hyphens "-".

    0 comments No comments

  2. YufeiShao-msft 7,126 Reputation points
    2021-09-13T03:20:26.48+00:00

    Hi @Erik van de Burgwal

    Whether you want to create table or database, you cannot use '-' directly to create it successfully, because '-' belongs to the operator and does not comply with rules for T-SQL identifiers.
    The identifies that do not comply with these rules must be delimited by double quotation marks or brackets.

    create database [u-test]  
    

    after the database has been created, the database name will not display double quotation marks or brackets, but when using the T-SQL, you need to add these symbols. Like this:

    use [u-test]  
    

    An error will be reported when performing these steps as you have described:

    An exception occurred while executing a Transact-SQL statement or batch.  
    ------------------------------  
    ADDITIONAL INFORMATION:  
      
    Database 'u' does not exist. Make sure that the name is entered correctly. (Microsoft SQL Server, Error: 911)  
    

    The error shown in the additional information is the error that occurred when double quotation marks or brackets are not added. The UI does not recognize that the database used actually contains these symbols.

    It is recommended not to use identifiers that do not comply with the rules, because it may cause more trouble in practice


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.