1

I have a table in PostgreSQL that has array column like abc_id varchar[](1) and it has data in it like {A,B,C}.

I want to create that table in Synapse SQL how can I create array columns is it possible?

1
  • 1
    SQL Server has no array data type(s); the closest you could get would be XML or JSON data. Use a normalised design. Commented May 18, 2022 at 9:28

1 Answer 1

0

There is no explicit array type ibn Synapse SQL. We consider the array type data as complex type. As mentioned in the comment, consider using JSON as the main base.

The below image will explain the scheme of array and nested structure.

enter image description here

The following code block is the sample JSON example of implementing nested structures, which is a complex type and acceptable in Synapse SQL.

{
    "id": "66532691-ab20-11ea-8b1d-936b3ec64e54",
    "context": {
        "data": {
            "eventTime": "2020-06-10T13:43:34.553Z",
            "samplingRate": "100.0",
            "isSynthetic": "false"
        },
        "session": {
            "isFirst": "false",
            "id": "38619c14-7a23-4687-8268-95862c5326b1"
        },
        "custom": {
            "dimensions": [
                {
                    "customerInfo": {
                        "ProfileType": "ExpertUser",
                        "RoomName": "",
                        "CustomerName": "diamond",
                        "UserName": "[email protected]"
                    }
                },
                {
                    "customerInfo": {
                        "ProfileType": "Novice",
                        "RoomName": "",
                        "CustomerName": "topaz",
                        "UserName": "[email protected]"
                    }
                }
            ]
        }
    }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.