SQL Server
Exporting all tables with BCP
MSSQL on Docker
This will start a container called mssql, on the default port of 1433 while limiting it to 8GB RAM and setting a password for sa.
docker run --name mssql -m 8G -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=<password>' -p 1433:1433 -d mcr.microsoft.com/mssql/server
Note you have to accept the EULA by passing
'ACCEPT_EULA=Y'or the container won't start
The container will also shutdown if the sa password you specify doesn't meet the minimum requirements: minimum 8 characters
MSSQL on Podman
podman run --name mssql -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=<password>' -p 1433:1433 -d mcr.microsoft.com/mssql/server:2022-latest
Viewing all SQL Error Codes & Messages
SELECT * FROM SYSMESSAGES WHERE msglangid='1033' ORDER BY error ASC
How To
Creating a machine account login for SQL Server
Performance and Optimization
Disable Customer Experience Improvement Program
Under Services, stop the SQLTELEMETRY service (SQL Server CEIP service (MSSQLSERVER) service) and set it to Disabled.
Snapshot Isolation
Enable Snapshot Isolation for the database:
ALTER DATABASE [DBNAME] SET ALLOW_SNAPSHOT_ISOLATION ON; GO
Enable Read Committed Snapshot isolation level:
ALTER DATABASE [DBNAME] SET READ_COMMITTED_SNAPSHOT ON WITH ROLLBACK IMMEDIATE; GO