# Using Transact-SQL commands to configure MSSQL in chef

**URL:** <https://discourse.chef.io/t/using-transact-sql-commands-to-configure-mssql-in-chef/13360>\
**Category:** Chef Infra (archive)\
**Created:** [July 26, 2018, 3:00am UTC](https://discourse.chef.io/t/using-transact-sql-commands-to-configure-mssql-in-chef/13360 "2018-07-26T03:00:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnpaultthomas](https://avatars.discourse-cdn.com/v4/letter/j/839c29/32.png) [@johnpaultthomas](https://discourse.chef.io/u/johnpaultthomas)\
**Post date:** [July 26, 2018, 3:00am UTC](https://discourse.chef.io/t/using-transact-sql-commands-to-configure-mssql-in-chef/13360/1 "2018-07-26T03:00:55Z")

</div>

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/](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 ☹ any help appreciated!
