Why the SQL Server ignore the empty space at the end automatically?

SQL Server is following the ANSI/ISO standard for string comparison. The article How SQL Server Compares Strings with Trailing Spaces explains this in detail. SQL Server follows the ANSI/ISO SQL-92 specification… on how to compare strings with spaces. The ANSI standard requires padding for the character strings used in comparisons so that their lengths match … Read more

SSL Certificate missing from dropdown in SQL Server Configuration Manager

After communication in comments I can suppose that your main problem is the CN part of the certificate which you use. To have successful TLS communication for IIS Server one have no such strong restrictions like SQL Server has. Microsoft require (see here) that The name of the certificate must be the fully qualified domain … Read more

in sql server what is the difference between user_type_id and system_type_id in sys.types

You almost never want to join sys.columns.system_type_id = sys.types.system_type_id. This will lead to duplicate records in the case of user-defined types. There are two JOINs which do make sense. Both of them work equivalently for built-in types. sys.columns.user_type_id = sys.types.user_type_id For a built-in type, it returns the built-in type. For a user-defined type, it returns … Read more

Find max value and show corresponding value from different field in SQL server

There are several ways that this can be done: A filter in the WHERE clause: select id, name, population from yourtable where population in (select max(population) from yourtable) Or a subquery: select id, name, population from yourtable t1 inner join ( select max(population) MaxPop from yourtable ) t2 on t1.population = t2.maxpop; Or you can … Read more

Docker connect SQL Server container non-zero code: 1

You cant really use mcr.microsoft.com/mssql/server:2019-latest containers on M1 because MSSQL DB does not support ARM architecture. The only way I found – is to use Azure SQL container that supports ARM and can be run on M1. Here my docker-compose.yml config example: version: “3.9” services: # Database instance mssql: image: mcr.microsoft.com/azure-sql-edge:latest volumes: – events_mssql:/var/opt/mssql ports: … Read more

GRANT syntax for domain\user

Assuming you have created a user in this database associated with the AD login, e.g. CREATE LOGIN [domain\user] FROM WINDOWS; GO USE your_database; GO CREATE USER [domain\user] FROM LOGIN [domain\user]; GO Then you merely have to follow the same syntax. Because \ is not a standard character for an identifier, you need to escape the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)