| Author |
Message |
james.taylor
Joined: 18 Mar 2008 Posts: 4
|
Posted: Mon Jul 28, 2008 1:59 pm Post subject: Trustworthy Databases |
|
|
I have a CLR Assembly that is part of my default database and needs to e included in my Packager application.
In order for the CLR Assembly to be created within my database, the database needs to be modified to be 'Trustworthy'
The Packager does not seem to modify this database setting and as a result the Package fails to install correctly.
Is there something i need to configure with the SQL Packager application at build time that i am not doing, or any way to default any new databases to be trustworthy?
Many thanks |
|
| Back to top |
|
 |
David Atkinson
Joined: 05 Dec 2005 Posts: 1079
|
Posted: Mon Jul 28, 2008 5:27 pm Post subject: |
|
|
Hi James,
Currently it is not possible to amend the SQL Script that SQL Packager outputs, so adding the line "ALTER DATABASE [IOS01] SET TRUSTWORTHY ON" is sadly not an option.
However, we are tentatively looking into the possibility of allowing SQL Packager to read in its input from a file, which should allow for a lot more flexibility.
If anyone else knows of any instances of where editing the Packager script may solve an existing problem, please respond to this thread or email me personally, as this will add weight to this enhancement candidate.
Regards,
David Atkinson
Product Manager
Red Gate Software
David.Atkinson at red-gate.com |
|
| Back to top |
|
 |
james.taylor
Joined: 18 Mar 2008 Posts: 4
|
Posted: Mon Jul 28, 2008 5:38 pm Post subject: |
|
|
David,
Thanks for the response.
I do have another reason for requiring the ability to alter/modify the script. This would be to modify the default passwords that the Redgate applications apply by default to their user creation scripts.
At our company we do have standard fixed users and passwords that our applications use internally. The ability to change these would be an ideal enhancement to the Packaging application.
Failing that, is there anyway of altering the default passwords that your script generators use? |
|
| Back to top |
|
 |
tchaplin@miningis.com.au
Joined: 23 Apr 2008 Posts: 15
|
Posted: Thu Sep 04, 2008 4:30 am Post subject: |
|
|
I got this to work by hacking the PackageExecutor.cs file in Red Gate\SQL Packager 5\SQL Packager Code Templates\C#
| Code: |
sqlCommand.CommandText = "ALTER DATABASE " + m_DatabaseName + " SET TRUSTWORTHY ON";
sqlCommand.ExecuteNonQuery(); |
I put it just under this code:
| Code: |
string [] dbOptions = m_DatabaseProperties.DatabaseOptions;
if (dbOptions != null)
{
foreach (string dbOption in dbOptions)
{
try
{
if (dbOption.Length > 0)
{
sqlCommand.CommandText = "Exec sp_dboption '" + m_DatabaseName + "', '"+ dbOption +"' ,'on'";
sqlCommand.ExecuteNonQuery();
}
}
catch
{
//MessageBox.Show(sqlCommand.CommandText,e.Message, System.Windows.Forms.MessageBoxIcon.Information);
}
//node.Nodes.Add(string.Format("db_option '{0}', 'on'", dbOption));
}
} |
It would be great if the ability to set all database options was made available in the future. |
|
| Back to top |
|
 |
tchaplin@miningis.com.au
Joined: 23 Apr 2008 Posts: 15
|
Posted: Thu Sep 04, 2008 6:11 am Post subject: Specify a template |
|
|
Is it possible to have multiple SQL Packager Code Templates and specify which one to use when packaging?
I have to do custom editing to the template for each of our different products. |
|
| Back to top |
|
 |
|
|
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