Category SQL-Server

T-SQL: Remap SQL users

If you copy (backup/restore) a database from system A to system B, it is possible that the SQL users won’t be able login and this because the GUID/SID of the users on system A doesn’t match the GUID/SID of system…

Read More

SQL-Server: Get Server – Edition – Instance Name with T-SQL

  The following t-sql statement returns the server name, server instance, instance, edition & version of the running SQL-Server.   SELECT SERVERPROPERTY(‘MachineName’) AS [ServerName], SERVERPROPERTY(‘ServerName’) AS [ServerInstanceName], SERVERPROPERTY(‘InstanceName’) AS [Instance], SERVERPROPERTY(‘Edition’) AS [Edition], SERVERPROPERTY(‘ProductVersion’) AS [ProductVersion], Left(@@Version, Charindex(‘-‘, @@version) -…

Read More