SQL03070 with Grant External Access script
-
Thursday, January 05, 2012 3:59 PM
I have the following script, which I need to be built into the deployment script:
GRANT EXTERNAL ACCESS ASSEMBLY to SQLCLRLogin;
Where do I put this file in my visual studio "SQL Server 2008 Server Project"-style project?
When I attempt to build the project with this script in it, it gives me the error "SQL03070: This statement is not recognized in this context."
Am I supposed to exclude this script from the build via the file properties? Will it still be included in the deployment script if I do?Or should I just move the statement to the post-deployment script?Like a lot of people, I'm still fairly new to VS database/sql server projects, so I'm totally lost.Thanks.
All Replies
-
Monday, January 09, 2012 7:24 AMModerator
Hi jimasp,
Please make sure that the statement can be executed successfully on the source database via SQL Server Management Studio. Before you grant permission to login CLRLogin, the ASYMMETRIC KEY and LOGIN CLRLogin should be created first, the syntax is as below:USE master GO CREATE ASYMMETRIC KEY AsymmetricKeyName FROM EXECUTABLE FILE = '{put your .dll file path here}' CREATE LOGIN CLRLogin FROM ASYMMETRIC KEY AsymmetricKeyName GRANT EXTERNAL ACCESS ASSEMBLY TO CLRLogin GOStephanie Lv
TechNet Community Support
- Marked As Answer by Stephanie LvModerator Saturday, January 14, 2012 7:56 AM

