Link to home
Start Free TrialLog in
Avatar of gbzhhu
gbzhhuFlag 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
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gbzhhu

ASKER

Thanks Eric.

Perfect article for my need.  Reading it up and will feedback here.
Avatar of 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
it would really help me if you could report what is incorrect!
Avatar of 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
it doesn't change anything else. Check the script, you will be convinced!
Avatar of 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