Red Gate forums :: View topic - Pre script running issue
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Packager 6
SQL Packager 6 forum

Pre script running issue

Search in SQL Packager 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
Satish



Joined: 20 Dec 2011
Posts: 1

PostPosted: Tue Dec 20, 2011 8:19 pm    Post subject: Pre script running issue Reply with quote

Hi,

we ran into a problem while using the Red-Gate SQL Packager 6.4.0.8
We built a package and tried running it on a server where the packager is supposed to create a new database. The problem occurred when the packager tried to install a .net assembly file(dll) into the newly created database.
It threw an error that said
“CREATE ASSEMBLY for assembly 'Delta.SQLCLR' failed because assembly 'Delta.SQLCLR' is not authorized for PERMISSION_SET = UNSAFE. The assembly is authorized when either of the following is true: the database owner (DBO) has UNSAFE ASSEMBLY permission and the database has the TRUSTWORTHY database property on; or the assembly is signed with a certificate or an asymmetric key that has a corresponding login with UNSAFE ASSEMBLY permission.”
This could be fixed by using the statement “SET TRUSTWORTHY ON” on the newly created db.
But when we made the above script a part of the preSQL script and ran the packager in command line, it did not seem to have executed the above script and came back with the same error.
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1144
Location: My desk.

PostPosted: Wed Dec 21, 2011 10:01 pm    Post subject: Reply with quote

Thanks for your post.
The /presql is run before the database is created, so it won't have actually made the change you expect.

One option would be to create the DB as part of your Pre-script, for instance if I wanted to create a table first:

Code:

USE master
GO
CREATE DATABASE pkg2
GO
USE packagerDB
GO
CREATE TABLE test
(
id INT NOT NULL ,
rowdata VARCHAR(200)
)
GO


Then, in your commandline, specify the DB you just created and the /makeupgrade switch as opposed to the /makedatabase switch.

Hopefully that should help get around the problem.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group