title: Writing stored procedures in C# pros and cons
body: <p>I just learned that you can write user defined functions in C# and use them as stored procedures in SQL Server.</p>
  
  <p><em>Stored procedures that are written in managed code are called SQL Server Common Language Run-Time stored procedures or SQL CLR stored procedures</em></p>
  
  <p><a href="https://msdn.microsoft.com/en-us/library/vstudio/zxsa8hkf(v=vs.100).aspx" rel="nofollow noreferrer">msdn - Walkthrough: Creating a Stored Procedure in Managed Code</a></p>
  
  <p>It does not seem so widely used when Googeling it. Is there anybody familiar with this and can tell me the pros and cons of using SQL CLR stored procedures. When to use them and when not to? Perfomance etc.</p>
  
  <p>I am a newbie to t-SQL and prefer writing code in C#. </p>
  
  <p>marc_s answer to a similar question has some answers, is his opinion shared among all?</p>
  
  <p><a href="https://stackoverflow.com/questions/5336800/stored-procedure-in-sql-clr">Stackoverflow - stored procedure in sql clr</a></p>