Avatar of gbzhhu
gbzhhu
Flag for United Kingdom of Great Britain and Northern Ireland asked on

SQL Server 2012 CLR stored procedure - how to

I want to write code that checks count and properties of files on an SFTP server from SQL Server SSIS package. As far I know the easiest way to do this without scripting is to use CLR in a stored procedure.  Being very familiar with C# I can write the code easily but I need to understand deployment.

Do I need a reference to the DB.  When I do that I get a gazillion errors.  I am also worried about overwriting changes to my DB. I just want to add the new Stored Procedure.  Please advice how this is done usually

thanks
H
C#Microsoft SQL ServerMicrosoft SQL Server 2008

Avatar of undefined
Last Comment
gbzhhu

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Éric Moreau

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
gbzhhu

ASKER
Thanks Eric.

Perfect article for my need.  Reading it up and will feedback here.
gbzhhu

ASKER
Eric,

That is exactly what I did! Same as in your article but my DB is not new.  So what does publishing do my DB?  That is what I am wondering.  I guess I can test with a new DB that I create.  I need to test it on server not local as other things can go wrong
Éric Moreau

it would really help me if you could report what is incorrect!
Your help has saved me hundreds of hours of internet surfing.
fblack61
gbzhhu

ASKER
Nothing is incorrect!  I am wondering if the publish only adds the CLR objects defined in the project and doesn't change anything else in the DB
Éric Moreau

it doesn't change anything else. Check the script, you will be convinced!
gbzhhu

ASKER
Thanks Eric.

Your article helped me.  Maybe update your article because it says that "your database will be created"  To say changes will be applied to your DB or something along those lines.

Thank you again for the awesome article
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.