Package com.microsoft.sqlserver.jdbc

## Class SQLServerMetaData

- java.lang.Object
- - com.microsoft.sqlserver.jdbc.SQLServerMetaData

    public class SQLServerMetaData
    extends Object

This class represents metadata for a column. It is used in the ISQLServerDataRecord interface to pass column metadata to the table-valued parameter.

### Constructor Summary

Constructors
`SQLServerMetaData​(SQLServerMetaData sqlServerMetaData)` Initializes a new instance of SQLServerMetaData from another SQLServerMetaData object.
`SQLServerMetaData​(String columnName, int sqlType)` Creates a new SQLServerMetaData
`SQLServerMetaData​(String columnName, int sqlType, int precision, int scale)` creates a new SQLServerMetaData
`SQLServerMetaData​(String columnName, int sqlType, int precision, int scale, boolean useServerDefault, boolean isUniqueKey, SQLServerSortOrder sortOrder, int sortOrdinal)` Creates a new SQLServerMetaData

### Method Summary

All Methods Instance Methods Concrete Methods
`String` `getColumName​()`
`int` `getPrecision​()`
`int` `getScale​()`
`SQLServerSortOrder` `getSortOrder​()`
`int` `getSortOrdinal​()`
`int` `getSqlType​()`
`boolean` `isUniqueKey​()`
`boolean` `useServerDefault​()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### SQLServerMetaData

    public SQLServerMetaData​(String columnName,
                             int sqlType)

Creates a new SQLServerMetaData

Parameters:
  `columnName` - the name of the column
  `sqlType` - the SQL type of the column

#### SQLServerMetaData

    public SQLServerMetaData​(String columnName,
                             int sqlType,
                             int precision,
                             int scale)

creates a new SQLServerMetaData

Parameters:
  `columnName` - the name of the column
  `sqlType` - the SQL type of the column
  `precision` - the precision of the column
  `scale` - the scale of the column

#### SQLServerMetaData

    public SQLServerMetaData​(String columnName,
                             int sqlType,
                             int precision,
                             int scale,
                             boolean useServerDefault,
                             boolean isUniqueKey,
                             SQLServerSortOrder sortOrder,
                             int sortOrdinal)
                      throws SQLServerException

Creates a new SQLServerMetaData

Parameters:
  `columnName` - the name of the column
  `sqlType` - the sql type of the column
  `precision` - the precision of the column
  `scale` - the scale of the column
  `useServerDefault` - specifies if this column should use the default server value; Default value is false.
  `isUniqueKey` - indicates if the column in the table-valued parameter is unique; Default value is false.
  `sortOrder` - indicates the sort order for a column; Default value is SQLServerSortOrder.Unspecified.
  `sortOrdinal` - specifies ordinal of the sort column; sortOrdinal starts from 0; Default value is -1.
Throws:
  `SQLServerException` - when an error occurs

#### SQLServerMetaData

    public SQLServerMetaData​(SQLServerMetaData sqlServerMetaData)

Initializes a new instance of SQLServerMetaData from another SQLServerMetaData object.

Parameters:
  `sqlServerMetaData` - the object passed to initialize a new instance of SQLServerMetaData

### Method Detail

#### getColumName

    public String getColumName​()

Returns:
  Retrieves the column name.

#### getSqlType

    public int getSqlType​()

Returns:
  Retrieves the java sql type.

#### getPrecision

    public int getPrecision​()

Returns:
  retrieves the precision of the type passed to the column.

#### getScale

    public int getScale​()

Returns:
  retrieves the scale of the type passed to the column.

#### useServerDefault

    public boolean useServerDefault​()

Returns:
  returns whether the column uses the default server value.

#### isUniqueKey

    public boolean isUniqueKey​()

Returns:
  retrieves the whether the column is unique.

#### getSortOrder

    public SQLServerSortOrder getSortOrder​()

Returns:
  retrieves the sort order.

#### getSortOrdinal

    public int getSortOrdinal​()

Returns:
  retrieves the sort ordinal.