# SqlServerServerResource

- Module: [Aspire.Hosting.SqlServer](/reference/api/go/aspire.hosting.sqlserver.md)
- Version: `17.0.0`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)

A resource that represents a SQL Server container.

## Definition

```go
type SqlServerServerResource interface {
    ExpressionValue
    IComputeResource
    Resource
    ResourceWithArgs
    ResourceWithConnectionString
    ResourceWithEndpoints
    ResourceWithEnvironment
    ResourceWithWaitSupport
}
```

## Embeds

- `ExpressionValue`
- `IComputeResource`
- `Resource`
- `ResourceWithArgs`
- `ResourceWithConnectionString`
- `ResourceWithEndpoints`
- `ResourceWithEnvironment`
- `ResourceWithWaitSupport`

## Properties

- `ConnectionStringExpression`: `*ReferenceExpression` `get` -- Gets the connection string expression for the SQL Server.
- `Databases`: `map[string]string` `get` -- A dictionary where the key is the resource name and the value is the database name.
- `Host`: `EndpointReferenceExpression` `get` -- Gets the host endpoint reference for this resource.
- `JdbcConnectionString`: `*ReferenceExpression` `get` -- Gets the JDBC connection string for the SQL Server.
- `PasswordParameter`: `ParameterResource` `get/set` -- Gets the parameter that contains the SQL Server password.
- `Port`: `EndpointReferenceExpression` `get` -- Gets the port endpoint reference for this resource.
- `PrimaryEndpoint`: `EndpointReference` `get` -- Gets the primary endpoint for the SQL Server.
- `ResourceTypeDisplayName`: `string` `get` -- Gets the ResourceTypeDisplayName property
- `UriExpression`: `*ReferenceExpression` `get` -- Gets the connection URI expression for the SQL Server.
- `UserNameReference`: `*ReferenceExpression` `get` -- Gets a reference to the user name for the SQL Server.

## Methods

- [AddDatabase](/reference/api/go/aspire.hosting.sqlserver/sqlserverserverresource/adddatabase.md) -- `method` -- Adds a SQL Server database resource
  ```go
  AddDatabase(name string, options ...*AddDatabaseOptions) SqlServerDatabaseResource
  ```
- [WithDataBindMount](/reference/api/go/aspire.hosting.sqlserver/sqlserverserverresource/withdatabindmount.md) -- `method` -- Adds a bind mount for the data folder to a SQL Server resource.
  ```go
  WithDataBindMount(source string, options ...*WithDataBindMountOptions) SqlServerServerResource
  ```
- [WithDataVolume](/reference/api/go/aspire.hosting.sqlserver/sqlserverserverresource/withdatavolume.md) -- `method` -- Adds a named volume for the data folder to a SQL Server resource.
  ```go
  WithDataVolume(options ...*WithDataVolumeOptions) SqlServerServerResource
  ```
- [WithHostPort](/reference/api/go/aspire.hosting.sqlserver/sqlserverserverresource/withhostport.md) -- `method` -- Configures the host port that the SqlServer resource is exposed on instead of using randomly assigned port.
  ```go
  WithHostPort(port *float64) SqlServerServerResource
  ```
- [WithPassword](/reference/api/go/aspire.hosting.sqlserver/sqlserverserverresource/withpassword.md) -- `method` -- Configures the password that the SqlServer resource is used.
  ```go
  WithPassword(password ParameterResource) SqlServerServerResource
  ```
- [WithRepl](/reference/api/go/aspire.hosting.sqlserver/sqlserverserverresource/withrepl.md) -- `method` -- Adds a REPL command that opens an authenticated SQL Server shell with the configured client tools.
  ```go
  WithRepl(options ...*WithReplOptions) SqlServerServerResource
  ```
