# MS SQL server to CrateDB convert

**URL:** https://community.cratedb.com/t/ms-sql-server-to-cratedb-convert/1018
**Category:** SQL
**Created:** [February 21, 2022, 7:33pm UTC](https://community.cratedb.com/t/ms-sql-server-to-cratedb-convert/1018 "2022-02-21T19:33:35Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Shakeel\_Ahmed](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/shakeel_ahmed/32/318_2.png) [@Shakeel\_Ahmed](https://community.cratedb.com/u/Shakeel_Ahmed)
#### Post date: [February 21, 2022, 7:33pm UTC](https://community.cratedb.com/t/ms-sql-server-to-cratedb-convert/1018/1 "2022-02-21T19:33:35Z")

</div>

We are planning to sync MS SQL Database to CrateDB. Could you please guide what is the best way to convert the schema of MS SQL to crateDB.

---

<div class="post-metadata">

### Author: ![proddata](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/proddata/32/1379_2.png) [@proddata](https://community.cratedb.com/u/proddata)
#### Post date: [February 21, 2022, 7:42pm UTC](https://community.cratedb.com/t/ms-sql-server-to-cratedb-convert/1018/2 "2022-02-21T19:42:32Z")

</div>

how big/complex are your schemas?

The available data types are listed here:

> **[Data definition](https://crate.io/docs/crate/reference/en/4.7/general/ddl/index.html)**
>
> This section provides an overview of how to create tables and perform other data-definition related operations with CrateDB. Table of contents Creating tables- Table definition, Table configuration., Data types- Overview, Primitive types, Container...

CrateDB schemas are very similar to PostgreSQL schemas.

---

<div class="post-metadata">

### Author: ![Emre\_Sevinc](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/emre_sevinc/32/375_2.png) [@Emre\_Sevinc](https://community.cratedb.com/u/Emre_Sevinc)
#### Post date: [February 24, 2022, 9:56am UTC](https://community.cratedb.com/t/ms-sql-server-to-cratedb-convert/1018/3 "2022-02-24T09:56:10Z")

</div>

You might want to give [https://pgloader.io/](https://pgloader.io/) a try. According to its documentation, one of the supported options is indicated as “Migrate from MS SQL Server® to PostgreSQL”. And since CrateDB is mostly compatible with PostgreSQL, PgLoader might be able to satisfy your requirements.

---

<div class="post-metadata">

### Author: ![hernanc](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/hernanc/32/676_2.png) [@hernanc](https://community.cratedb.com/u/hernanc)
#### Post date: [April 12, 2023, 1:00pm UTC](https://community.cratedb.com/t/ms-sql-server-to-cratedb-convert/1018/4 "2023-04-12T13:00:12Z")

</div>

Hi, I think you may encounter some issues with pgloader as it makes use of a specific feature in PostgreSQL, but if you are considering moving data from MSSQL to CrateDB you may find [this tutorial](https://community.cratedb.com/t/replicating-data-to-cratedb-with-debezium-and-kafka/1388) interesting and you could use [this](https://www.jooq.org/translate/) to get started translating MSSQL statements (including `CREATE TABLE` commands) to the PostgreSQL dialect.
