# SqlServerServerResource Properties

- Package: [Aspire.Hosting.SqlServer](/reference/api/csharp/aspire.hosting.sqlserver.md)
- Type: [SqlServerServerResource](/reference/api/csharp/aspire.hosting.sqlserver/sqlserverserverresource.md)
- Kind: `Properties`
- Members: `9`

A resource that represents a SQL Server container.

## ConnectionStringExpression

- Name: `ConnectionStringExpression`
- Modifiers: `get`
- Returns: `ReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.SqlServer/SqlServerServerResource.cs#L105-L110)

Gets the connection string expression for the SQL Server.

```csharp
public ReferenceExpression ConnectionStringExpression { get; }
```

## Databases

- Name: `Databases`
- Modifiers: `get`
- Returns: `IReadOnlyDictionary<string, string>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.SqlServer/SqlServerServerResource.cs#L135)

A dictionary where the key is the resource name and the value is the database name.

```csharp
public IReadOnlyDictionary<string, string> Databases { get; }
```

## Host

- Name: `Host`
- Modifiers: `get`
- Returns: `EndpointReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.SqlServer/SqlServerServerResource.cs#L36)

Gets the host endpoint reference for this resource.

```csharp
public EndpointReferenceExpression Host { get; }
```

## JdbcConnectionString

- Name: `JdbcConnectionString`
- Modifiers: `get`
- Returns: `ReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.SqlServer/SqlServerServerResource.cs#L96)

Gets the JDBC connection string for the SQL Server.

```csharp
public ReferenceExpression JdbcConnectionString { get; }
```

## Remarks

Format: `jdbc:sqlserver://{host}:{port};trustServerCertificate=true`.

User and password credentials are not included in the JDBC connection string. Use the `Username` and `Password` connection properties to access credentials.

## PasswordParameter

- Name: `PasswordParameter`
- Modifiers: `get`
- Returns: `ParameterResource`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.SqlServer/SqlServerServerResource.cs)

Gets the parameter that contains the SQL Server password.

```csharp
public ParameterResource PasswordParameter { get; }
```

## Port

- Name: `Port`
- Modifiers: `get`
- Returns: `EndpointReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.SqlServer/SqlServerServerResource.cs#L41)

Gets the port endpoint reference for this resource.

```csharp
public EndpointReferenceExpression Port { get; }
```

## PrimaryEndpoint

- Name: `PrimaryEndpoint`
- Modifiers: `get`
- Returns: `EndpointReference`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.SqlServer/SqlServerServerResource.cs#L31)

Gets the primary endpoint for the SQL Server.

```csharp
public EndpointReference PrimaryEndpoint { get; }
```

## UriExpression

- Name: `UriExpression`
- Modifiers: `get`
- Returns: `ReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.SqlServer/SqlServerServerResource.cs#L67)

Gets the connection URI expression for the SQL Server.

```csharp
public ReferenceExpression UriExpression { get; }
```

## Remarks

Format: `mssql://{Username}:{Password}@{Host}:{Port}`.

## UserNameReference

- Name: `UserNameReference`
- Modifiers: `get`
- Returns: `ReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.SqlServer/SqlServerServerResource.cs#L58)

Gets a reference to the user name for the SQL Server.

```csharp
public ReferenceExpression UserNameReference { get; }
```

## Remarks

Returns the user name parameter if specified, otherwise returns the default user name "sa".
