| Author |
Message |
powervision
Joined: 29 Jan 2008 Posts: 3
|
Posted: Tue Jan 29, 2008 2:36 pm Post subject: Default created with wrong name |
|
|
Hi,
This problem apply's to Doc1 and Sql packager.
In the past i had an default value (sql 2005) named "NegOne". I deleted that default and created a new one. "NegativeOne". (This default is used in some custom data types). When i create a snapshot of the database a file is created with the name: NegativeOne. It contains this line (and some others): "create default [NegativeOne] as -1" So far so good.
When i create a exe with SQL Packager 5 the default is created with the old name (copy from script): "create default [NegOne] as -1". All other sql in the same scriptfile uses "NegativeOne" as default and the scripts fails to run (thats when i notist). I created html documentation with docman and this tool shows this:
-----------------
Default - [dbo].[NegativeOne]
(local) > CSS_WH > Defaults > [dbo].[NegativeOne]
Quick Links
Properties SQL Script Uses Used By
Properties
Property Value
Owner dbo
SQL Script
SET QUOTED_IDENTIFIER OFF
GO
create default [NegOne] as -1
Uses
----------------
notice: Default - [dbo].[NegativeOne]<>create default [NegOne] as -1
i scaned my database compleetly, there is no "NegOne" default, reference or something with this name.
Question: where does "Doc1" en "Packager 5" gets the name used to create the scripts?
(i use all the latest version's of the software (toolbelt).
Regards,
Pepijn Visser |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6345 Location: Red Gate Software
|
Posted: Wed Jan 30, 2008 7:24 pm Post subject: |
|
|
Hello Pepijn,
SQL Packager gets the name of objects by parsing the SQL code used to create the object in the case of UDFs, stored procedures, and defaults. When SQL Server is used to rename objects, typically it updates the sysobjects table and not the syscomments table, where the actual ddl is stored.
For instance, running
| Code: |
| SELECT [text] FROM syscomments WHERE [id] IN (SELECT id FROM sysobjects WHERE [NAME]='NegOne') |
More than likely, the result will show CREATE DEFAULT NeagtiveOne as... and that's the problem.
The only way around I know of is to drop and recreate the default. _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
powervision
Joined: 29 Jan 2008 Posts: 3
|
Posted: Thu Jan 31, 2008 2:12 pm Post subject: Drop and recreate |
|
|
Hi,
Thanx for the reply brian. I recreated the default and everyting works fine.
regards,
Pepijn Visser |
|
| 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