I am developing an application that is going to be setup on a server that is in a public area, that anyone will have access to.
If you are trying to block the DBA from seeing the CLR body, you are just making it more difficult...if the CLR is deployed, i can still extract the assembly and run it through a decompiler.
Now for end users, SQL server is deny by default...that means no one can do anything unless you give them permission to do something, so it's really advantageous to learn how to be tight with permissions instead of granting db_owner to everyone, for example.
So for example, you can give people EXECUTE permissions on a stored procedure(s), and all they can do is call it,they cannot see the procedure body unless you give them permission to do so.(db_ddladmin,db_owner, VIEW DEFINITION)
My thinking was that CLR Stored Procedures are more secure than the regular stored procedures because they can't be edited from the server.
you are introducing a big performance hit by trying to do everything in CLR...the code you posted already has a cursor in it, which is something you want to avoid up front, and use set based operations to take advantage of SQL's abilities.
The stored procedure I posted is the log in procedure I'm using. However the other procedures I have are more complex, carrying out billing and remittance logic, etc. So I wanted to hide the logic from the anyone who might try to make unauthorized changes. I posted the simplest stored procedure so that I could learn how to implement it starting with the basics.
CLR's have their place, but they should be reserved to do things you cannot normally do in TSQL..if you relpace existing functionality with a CLR, it will be slower, with very very rare exceptions.
help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!