Solved

SQL Server 2012 CLR stored procedure - how to

Posted on 2016-08-05
7
75 Views
Last Modified: 2016-08-05
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
0
Comment
Question by:gbzhhu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 41744232
1
 
LVL 12

Author Comment

by:gbzhhu
ID: 41744345
Thanks Eric.

Perfect article for my need.  Reading it up and will feedback here.
0
 
LVL 12

Author Comment

by:gbzhhu
ID: 41744436
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
0
Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

 
LVL 70

Expert Comment

by:Éric Moreau
ID: 41744451
it would really help me if you could report what is incorrect!
0
 
LVL 12

Author Comment

by:gbzhhu
ID: 41744462
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
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 41744478
it doesn't change anything else. Check the script, you will be convinced!
0
 
LVL 12

Author Comment

by:gbzhhu
ID: 41744494
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
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question