---
sidebar_position: 5
description: Delete table column and other functions to work with MSSQL in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, MSSQL]
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Delete table column
 Deletes a column from the table



`Function DeleteTableColumn(Val Table, Val Name, Val Connection = "", Val Tls = "") Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | Table | --table | String | &#x2714; | Table name |
  | Name | --name | String | &#x2714; | Column name |
  | Connection | --dbc | String, Arbitrary | &#x2716; | Connection or connection string |
  | Tls | --tls | Structure Of KeyAndValue | &#x2716; | TLS settings, if necessary. See GetTlsSettings |

  
  Returns:  Map Of KeyAndValue - Result of query execution



```bsl title="1C:Enterprise/OneScript code example"
    Address  = "127.0.0.1";
    Login    = "SA";
    Password = "12we...";

    Base  = "testbase1";
    Table = "testtable";
    Name  = "new_field";

    TLSSettings      = OPI_MSSQL.GetTLSSettings(True);
    ConnectionString = OPI_MSSQL.GenerateConnectionString(Address, Base, Login, Password);

    // When using the connection string, a new connection is initialised,
    // which will be closed after the function is executed.
    // If several operations are performed, it is desirable to use one connection,
    // previously created by the CreateConnection function()
    Result = OPI_MSSQL.DeleteTableColumn(Table, Name, ConnectionString, TLSSettings);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            # JSON data can also be passed as a path to a .json file
            
            oint mssql DeleteTableColumn \
             --table "testtable" \
             --name "new_field" \
             --dbc "Server=127.0.0.1;Database=***;User Id=SA;Password=***;" \
             --tls "{'use_tls':true,'accept_invalid_certs':true}"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            :: JSON data can also be passed as a path to a .json file
            
            oint mssql DeleteTableColumn ^
             --table "testtable" ^
             --name "new_field" ^
             --dbc "Server=127.0.0.1;Database=***;User Id=SA;Password=***;" ^
             --tls "{'use_tls':true,'accept_invalid_certs':true}"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "result": true
}
```
