# Ansible for SQL server deployments

**URL:** <https://forum.ansible.com/t/ansible-for-sql-server-deployments/35485>\
**Category:** Ansible Project\
**Created:** [July 9, 2021, 2:37pm UTC](https://forum.ansible.com/t/ansible-for-sql-server-deployments/35485 "2021-07-09T14:37:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![omoeko](https://avatars.discourse-cdn.com/v4/letter/o/e47774/32.png) [@omoeko](https://forum.ansible.com/u/omoeko)\
**Post date:** [July 9, 2021, 2:37pm UTC](https://forum.ansible.com/t/ansible-for-sql-server-deployments/35485/1 "2021-07-09T14:37:13Z")

</div>

I am looking at the possibility of deployments using ansible roles. The issue that I find is that ansible works at the host level within the defined inventory. SQL server on the other hand works differently, its a one to many relationship. You can have multiple SQL instances on a host.

My scenario is wanting to deploy the below script across 500 SQL instances. The 500 SQL instances equated to 350 ansible hosts.

Below is the deployment script.

use mydb  
GO  
if object\_id(‘persons’) is not null  
drop table dbo.persons  
GO  
create table persons  
(  
id int identity (1,1),  
name varchar(200)  
)
