Using Transact-SQL commands to configure MSSQL in chef


#1

Hi
with inspec we can write
sql = mssql_session(user: ‘my_user’, password: ‘password’)
describe sql.query(“SELECT SERVERPROPERTY(‘ProductVersion’) as result”).row(0).column(‘result’) do
its(“value”) { should cmp > ‘12.00.4457’ }
end
ref: https://www.inspec.io/docs/reference/resources/mssql_session/
Is there a similar elegant way of using something like mssql_session in a chef recipe to run transact-sql command to configure a MSSQL server ?
if not what’s the best way to do the same in a chef recipe? is running sql scripts from a template to power shell session the only way :frowning: any help appreciated!