Description
Microsoft SQL Server is a relational database management system.Examples
Dependency:
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>mssqlserver</artifactId>
<version>1.20.0</version>
<scope>test</scope>
</dependency>
Usage:
var mssqlserver = new MSSQLServerContainer()
.acceptLicense();
mssqlserver.start();
Dependency:
go get github.com/testcontainers/testcontainers-go/modules/mssql
Usage:
mssqlContainer, err := mssql.Run(ctx,
"mcr.microsoft.com/mssql/server:2022-CU10-ubuntu-22.04",
mssql.WithAcceptEULA(),
)
Dependency:
dotnet add package Testcontainers.MsSql --version 3.9.0
Usage:
var msSqlContainer = new MsSqlBuilder()
.WithImage("mcr.microsoft.com/mssql/server:2022-CU10-ubuntu-22.04")
.Build();
await msSqlContainer.StartAsync();
Dependency:
npm install @testcontainers/mssqlserver --save-dev
Usage:
const container = await new MSSQLServerContainer().start();
Dependency:
pip install testcontainers[mssql]
Usage:
with SqlServerContainer("mcr.microsoft.com/mssql/server:2022-CU12-ubuntu-22.04") as mssql:
engine = sqlalchemy.create_engine(mssql.get_connection_url())
with engine.begin() as connection:
result = connection.execute(sqlalchemy.text("select @@VERSION"))