betr-io / terraform-provider-mssql

Terraform provider for Microsoft SQL Server
https://registry.terraform.io/providers/betr-io/mssql/latest
MIT License
36 stars 29 forks source link

Facing an error while creating users in MSSQL server (in aws) < Error: unable to read user [platform-test].[user]: mssql: 'STRING_AGG' is not a recognized built-in function name.> #21

Open IshanYadav opened 3 years ago

IshanYadav commented 3 years ago

Hi, Sharing the script. Please let me know any findings. MSSQL version = 13.0.1601.5

terraform { required_providers { mssql = { source = "betr-io/mssql" version = "0.1.0" } } } provider "mssql" { debug = "true" }

resource "mssql_login" "example" { server { host = "xxx.xxx.xxx.xxx" login { username = "mssql_admin" password = "Mynewpassword" } } login_name = "test" password = "Hello" }

resource "mssql_user" "example" { server { host = "xxx.xx.xxx.xx" login { username = "mssql_admin" password = "Mynewpassword" } } username = "test" roles = ["db_owner"] database = "platform-test" login_name = mssql_login.example.login_name }

Error

< Error: unable to read user [platform-test].[user]: mssql: 'STRING_AGG' is not a recognized built-in function name.> Note: Able to create in database but getting the above error. Please give your inputs.

Thanks and Regards, Ishan Yadav

mkusmiy commented 2 years ago

STRING_AGG function is available only since MS SQL 2017 while v13.0.1601.5 is MS SQL 2016

pregress commented 1 year ago

Following pr should fix it https://github.com/betr-io/terraform-provider-mssql/pull/48