# Slingshot! and Microsoft SQL

**URL:** <https://forum.dynamobim.com/t/slingshot-and-microsoft-sql/51292>\
**Category:** Packages\
**Created:** [June 1, 2020, 10:20pm UTC](https://forum.dynamobim.com/t/slingshot-and-microsoft-sql/51292 "2020-06-01T22:20:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![S.A.M](https://avatars.discourse-cdn.com/v4/letter/s/b5ac83/32.png) [@S.A.M](https://forum.dynamobim.com/u/S.A.M)\
**Post date:** [June 1, 2020, 10:20pm UTC](https://forum.dynamobim.com/t/slingshot-and-microsoft-sql/51292/1 "2020-06-01T22:20:50Z")

</div>

I am trying to edit a database setup in Microsoft SQL Sever Manager and have noticed that the Slingshot package seems to only have 4 command nodes. Has anyone been successful in using Slingshot with Microsofts SQL software?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/2/62bda5c6e44dbba1623f72083c8ba02b9847b67a.png)

---

<div class="post-metadata">

**Author:** ![Andrew\_Hannell](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/andrew_hannell/32/103315_2.png) [@Andrew\_Hannell](https://forum.dynamobim.com/u/Andrew_Hannell)\
**Post date:** [June 2, 2020, 2:39am UTC](https://forum.dynamobim.com/t/slingshot-and-microsoft-sql/51292/2 "2020-06-02T02:39:47Z")

</div>

Yes, it works fine  
You just use a code block to build the ‘command’, rather than nodes such as SQL.InsertInto- for example if you wanted an UPDATE query

MSSQL can be a little tricky with things like authentication, named instances (servers) vs default instances, security or connection settings, firewall etc etc- but it does work. For this reason, I’d recommend SQLite if you are starting from scratch- it is very simple & easy.

Search on this forum for posts by myself or others for SQL

---

<div class="post-metadata">

**Author:** ![juansolorzano0](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@juansolorzano0](https://forum.dynamobim.com/u/juansolorzano0)\
**Post date:** [July 20, 2020, 4:07pm UTC](https://forum.dynamobim.com/t/slingshot-and-microsoft-sql/51292/3 "2020-07-20T16:07:02Z")

</div>

I have recently been working with exporting bulk information from rvt files to a database, I’ve tried using the slingshots nodes with no luck, so it took me a while but I worked it out by using .Net Api SqlClient and I’m able to do any operation from dyamo to a MSSQL DB.

import clr  
clr.AddReference(‘System.Data’)  
from System.Data import SqlClient  
from System.Data import \*  
from System.Data import DataTable

import clr  
clr.AddReference(‘System’)  
from System import \*  
from System import Console  
from System import Data  
from System.Collections.Generic import \*

sqlConnectionString = “server=servername;database=databasename;uid=login;password=yourpassword”  
sqlDbConnection = SqlClient.SqlConnection(sqlConnectionString)  
sqlDbConnection.Open()

command = SqlClient.SqlCommand  
command = sqlDbConnection.CreateCommand()

transaction = SqlClient.SqlTransaction  
transaction = sqlDbConnection.BeginTransaction(“SampleTransaction”)

command.Connection = sqlDbConnection  
command.Transaction = transaction

command.CommandText = “DELETE FROM you\_table WHERE x = @Id”  
command.Parameters.Add("@Id", SqlDbType.Int).Value = 100  
command.ExecuteNonQuery()  
transaction.Commit()

sqlDbConnection.Close()  
OUT = 0

 ![pythonsqlcon](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/5/35286c19d45ff395f5bb5f3a25a0993533dfda2f.png)

---

<div class="post-metadata">

**Author:** ![S.A.M](https://avatars.discourse-cdn.com/v4/letter/s/b5ac83/32.png) [@S.A.M](https://forum.dynamobim.com/u/S.A.M)\
**Post date:** [July 30, 2020, 9:31pm UTC](https://forum.dynamobim.com/t/slingshot-and-microsoft-sql/51292/4 "2020-07-30T21:31:51Z")

</div>

This was gold for me! After a bit of messing around with it I can now track and log all the information I want on Dynamo usage in our network. Work flawlessly with MSSQL Thank you!

---

<div class="post-metadata">

**Author:** ![juansolorzano0](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@juansolorzano0](https://forum.dynamobim.com/u/juansolorzano0)\
**Post date:** [July 30, 2020, 9:55pm UTC](https://forum.dynamobim.com/t/slingshot-and-microsoft-sql/51292/5 "2020-07-30T21:55:38Z")

</div>

I’m glad I was able to help you just a bit, next time I’ll try to add some comments to my code and specify the sections. Good luck.

---

<div class="post-metadata">

**Author:** ![msakr4](https://avatars.discourse-cdn.com/v4/letter/m/ec9cab/32.png) [@msakr4](https://forum.dynamobim.com/u/msakr4)\
**Post date:** [July 20, 2022, 4:37am UTC](https://forum.dynamobim.com/t/slingshot-and-microsoft-sql/51292/6 "2022-07-20T04:37:52Z")

</div>

![Screenshot 2022-07-20 003641](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/d/ada1990652b074b1d7d9506657f1afbde38693c0.png)  
hello,  
can someone please tell me how do I load the slingshot package into dynamo?
