|
Comments and Discussions
|
|
|
Hi!
Try exec command: SSTCL.exe /Src_server=SQL2008\ /Src_catalog=mydb /Src_Trusted /Translate
Got error:
SQL Error: Cannot insert the value NULL into column 'type', table 'tempdb.dbo.#temp2______________________________________________________________________________________________________________000000000003'; column does not allow nulls. INSERT fails.
The statement has been terminated., DB Server SQL2008\:mydb
2011-04-08 16:06:36.0855|INFO|Lewis.SST.SSTCommandLine|SST Started on 08.04.2011 16:06:36
My SQL2008 version information:
Microsoft SQL Server Management Studio 10.50.1600.1
Microsoft Analysis Services Client Tools 10.50.1600.1
Microsoft Data Access Components (MDAC) 6.1.7600.16385
Microsoft MSXML 3.0 4.0 5.0 6.0
Microsoft Internet Explorer 8.0.7600.16385
Microsoft .NET Framework 2.0.50727.4927
Operating System 6.1.7600
If I execute sql:
SELECT
a.xtype,
(SELECT TOP 1 [name] FROM [mydb].dbo.systypes AS c WHERE c.xusertype = a.xtype) AS type
FROM [mydb].dbo.systypes AS a
I've got result:
xtype type
34 image
35 text
36 uniqueidentifier
40 date
41 time
42 datetime2
43 datetimeoffset
48 tinyint
52 smallint
56 int
58 smalldatetime
59 real
60 money
61 datetime
62 float
98 sql_variant
99 ntext
104 bit
106 decimal
108 numeric
122 smallmoney
127 bigint
240 NULL
240 NULL
240 NULL
165 varbinary
167 varchar
173 binary
175 char
189 timestamp
231 nvarchar
239 nchar
241 xml
231 nvarchar
In fact, there are NULL records in results!
What should I do?
-- Modified Tuesday, April 12, 2011 4:55 AM
|
|
|
|
|
Ok, the User defined data types are not being found using the SQL statement in GetUDDTsList class.
Now, I know that the tool was not designed to support the new SQL 2005/8 server roles - so I wonder if its related to that. Also, maybe you can look to see what the user declared types are for the table in question? I could try to recreate the issue on my local box and then advise what code changes would be required.
The highest sounds are hardest to hear.
Going forward is a way to retreat.
Great talent shows itself late in life.
Even a perfect program still has bugs.
|
|
|
|
|
select * from (
SELECT a.name, a.xtype,
(SELECT TOP 1 [name] FROM [mydb].dbo.systypes AS c WHERE c.xusertype = a.xtype) AS type
FROM [mydb].dbo.systypes AS a
) b WHERE type is null
results:
name xtype type
-------------- ----- -----
hierarchyid 240 NULL
geometry 240 NULL
geography 240 NULL
SELECT *
FROM [mydb].dbo.systypes AS a
results:
name | xtype | status | xusertype | length | xprec | xscale | tdefault | domain | uid | reserved | collationid | usertype | variable | allownulls | type | printfmt | prec | scale | collation | image | 34 | 0 | 34 | 16 | 0 | 0 | 0 | 0 | 4 | 0 | NULL | 20 | 0 | 1 | 34 | NULL | NULL | NULL | NULL | text | 35 | 0 | 35 | 16 | 0 | 0 | 0 | 0 | 4 | 0 | 53269 | 19 | 0 | 1 | 35 | NULL | NULL | NULL | Cyrillic_General_CI_AS | uniqueidentifier | 36 | 0 | 36 | 16 | 0 | 0 | 0 | 0 | 4 | 0 | NULL | 0 | 0 | 1 | 37 | NULL | 16 | NULL | NULL | date | 40 | 0 | 40 | 3 | 10 | 0 | 0 | 0 | 4 | 0 | NULL | 0 | 0 | 1 | 0 | NULL | 10 | 0 | NULL | time | 41 | 0 | 41 | 5 | 16 | 7 | 0 | 0 | 4 | 0 | NULL | 0 | 0 | 1 | 0 | NULL | 16 | 7 | NULL | datetime2 | 42 | 0 | 42 | 8 | 27 | 7 | 0 | 0 | 4 | 0 | NULL | 0 | 0 | 1 | 0 | NULL | 27 | 7 | NULL | datetimeoffset | 43 | 0 | 43 | 10 | 34 | 7 | 0 | 0 | 4 | 0 | NULL | 0 | 0 | 1 | 0 | NULL | 34 | 7 | NULL | tinyint | 48 | 0 | 48 | 1 | 3 | 0 | 0 | 0 | 4 | 0 | NULL | 5 | 0 | 1 | 48 | NULL | 3 | 0 | NULL | smallint | 52 | 0 | 52 | 2 | 5 | 0 | 0 | 0 | 4 | 0 | NULL | 6 | 0 | 1 | 52 | NULL | 5 | 0 | NULL | int | 56 | 0 | 56 | 4 | 10 | 0 | 0 | 0 | 4 | 0 | NULL | 7 | 0 | 1 | 56 | NULL | 10 | 0 | NULL | smalldatetime | 58 | 0 | 58 | 4 | 16 | 0 | 0 | 0 | 4 | 0 | NULL | 22 | 0 | 1 | 58 | NULL | 16 | 0 | NULL | real | 59 | 0 | 59 | 4 | 24 | 0 | 0 | 0 | 4 | 0 | NULL | 23 | 0 | 1 | 59 | NULL | 24 | NULL | NULL | money | 60 | 0 | 60 | 8 | 19 | 4 | 0 | 0 | 4 | 0 | NULL | 11 | 0 | 1 | 60 | NULL | 19 | 4 | NULL | datetime | 61 | 0 | 61 | 8 | 23 | 3 | 0 | 0 | 4 | 0 | NULL | 12 | 0 | 1 | 61 | NULL | 23 | 3 | NULL | float | 62 | 0 | 62 | 8 | 53 | 0 | 0 | 0 | 4 | 0 | NULL | 8 | 0 | 1 | 62 | NULL | 53 | NULL | NULL | sql_variant | 98 | 0 | 98 | 8016 | 0 | 0 | 0 | 0 | 4 | 0 | NULL | 0 | 0 | 1 | 39 | NULL | 0 | NULL | NULL | ntext | 99 | 0 | 99 | 16 | 0 | 0 | 0 | 0 | 4 | 0 | 53269 | 0 | 0 | 1 | 35 | NULL | NULL | NULL | Cyrillic_General_CI_AS | bit | 104 | 0 | 104 | 1 | 1 | 0 | 0 | 0 | 4 | 0 | NULL | 16 | 0 | 1 | 50 | NULL | 1 | NULL | NULL | decimal | 106 | 0 | 106 | 17 | 38 | 38 | 0 | 0 | 4 | 0 | NULL | 24 | 0 | 1 | 55 | NULL | 38 | 38 | NULL | numeric | 108 | 0 | 108 | 17 | 38 | 38 | 0 | 0 | 4 | 0 | NULL | 10 | 0 | 1 | 63 | NULL | 38 | 38 | NULL | smallmoney | 122 | 0 | 122 | 4 | 10 | 4 | 0 | 0 | 4 | 0 | NULL | 21 | 0 | 1 | 122 | NULL | 10 | 4 | NULL | bigint | 127 | 0 | 127 | 8 | 19 | 0 | 0 | 0 | 4 | 0 | NULL | 0 | 0 | 1 | 63 | NULL | 19 | 0 | NULL | hierarchyid | 240 | 0 | 128 | 892 | 0 | 0 | 0 | 0 | 4 | 0 | NULL | 0 | 0 | 1 | 0 | NULL | 892 | NULL | NULL | geometry | 240 | 0 | 129 | -1 | 0 | 0 | 0 | 0 | 4 | 0 | NULL | 0 | 0 | 1 | 0 | NULL | -1 | NULL | NULL | geography | 240 | 0 | 130 | -1 | 0 | 0 | 0 | 0 | 4 | 0 | NULL | 0 | 0 | 1 | 0 | NULL | -1 | NULL | NULL | varbinary | 165 | 0 | 165 | 8000 | 0 | 0 | 0 | 0 | 4 | 0 | NULL | 4 | 1 | 1 | 37 | NULL | 8000 | NULL | NULL | varchar | 167 | 0 | 167 | 8000 | 0 | 0 | 0 | 0 | 4 | 0 | 53269 | 2 | 1 | 1 | 39 | NULL | 8000 | NULL | Cyrillic_General_CI_AS | binary | 173 | 0 | 173 | 8000 | 0 | 0 | 0 | 0 | 4 | 0 | NULL | 3 | 0 | 1 | 45 | NULL | 8000 | NULL | NULL | char | 175 | 0 | 175 | 8000 | 0 | 0 | 0 | 0 | 4 | 0 | 53269 | 1 | 0 | 1 | 47 | NULL | 8000 | NULL | Cyrillic_General_CI_AS | timestamp | 189 | 1 | 189 | 8 | 0 | 0 | 0 | 0 | 4 | 0 | NULL | 80 | 0 | 0 | 45 | NULL | 8 | NULL | NULL | nvarchar | 231 | 0 | 231 | 8000 | 0 | 0 | 0 | 0 | 4 | 0 | 53269 | 0 | 1 | 1 | 39 | NULL | 4000 | NULL | Cyrillic_General_CI_AS | nchar | 239 | 0 | 239 | 8000 | 0 | 0 | 0 | 0 | 4 | 0 | 53269 | 0 | 0 | 1 | 47 | NULL | 4000 | NULL | Cyrillic_General_CI_AS | xml | 241 | 0 | 241 | -1 | 0 | 0 | 0 | 0 | 4 | 0 | NULL | 0 | 0 | 1 | 0 | NULL | -1 | NULL | NULL | sysname | 231 | 1 | 256 | 256 | 0 | 0 | 0 | 0 | 4 | 0 | 53269 | 18 | 1 | 0 | 39 | NULL | 128 | NULL | Cyrillic_General_CI_AS |
modified on Tuesday, April 12, 2011 5:32 AM
|
|
|
|
|
|
Had a couple of little problems, which will note below, sorry if these are already covered in the article, and hope the following helps.
1.To start it would not build because of the absolute paths in the merge.bat file, easy enough to fix, just put my correct paths in.
2.I did not have enough permissions on the database (views and stored procs appearing in SQL Management Studio with locks on them and causing and this error in the log 2010-04-15 11:20:48.1989|ERROR|Lewis.SST.SQLSchemaTool|SQL Error: There is no text for object 'SomeView'., DB Server), a role called VIEW DEFINITION solved that, which keeps my privilages low enough to not scare the DBA
3. I have some stored procs which are not in the dbo schema, which caused an exception, there was no error displayed via the GUI but the log shows
2010-04-15 12:01:30.3545|ERROR|Lewis.SST.SQLSchemaTool|SQL Error: The object 'usp_SomeStoredProc' does not exist in database 'some_DB' or is invalid for this operation., DB Server
I Fixed this in Lewis.SST.SQLObjects.SqlQueryStrings.GetSprocsList changed the SELECT statement to prefix the stored proc name with the schema name, that keeps it happy then when being passed to 'EXEC sp_helptext' a little later.
SELECT
SPROC_NAME = s.name + '.' + o.name,
USER_NAME = user_name(o.uid),
o.category,
ExecIsAnsiNullsOn = (case when (OBJECTPROPERTY(o.id, N'ExecIsAnsiNullsOn')=1) then 1 else 0 end),
ExecIsQuotedIdentOn = (case when (OBJECTPROPERTY(o.id, N'ExecIsQuotedIdentOn')=1) then 1 else 0 end),
ExecIsStartup = (case when (OBJECTPROPERTY(o.id, N'ExecIsStartup')=1) then 1 else 0 end),
IsAnsiNullsOn = (case when (OBJECTPROPERTY(o.id, N'IsAnsiNullsOn')=1) then 1 else 0 end),
IsQuotedIdentOn = (case when (OBJECTPROPERTY(o.id, N'IsQuotedIdentOn')=1) then 1 else 0 end),
IsExecuted = (case when (OBJECTPROPERTY(o.id, N'IsExecuted')=1) then 1 else 0 end),
IsExtendedProc = (case when (OBJECTPROPERTY(o.id, N'IsExtendedProc')=1) then 1 else 0 end),
IsReplProc = (case when (OBJECTPROPERTY(o.id, N'IsReplProc')=1) then 1 else 0 end),
IsSystemProc = (case when (OBJECTPROPERTY(o.id, N'IsMSShipped')=1) then 1 else 0 end),
Check_Sum = (SELECT TOP 1 BINARY_CHECKSUM(SUBSTRING(LOWER( RTRIM(LTRIM(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(s1.Text, @crlf, ''), @tab, ''), @lf, ''), @cr, ''), ' ', '')))),1,4000))
FROM SYSCOMMENTS AS s1 WHERE o.id = s1.id) +
(SELECT SUM(LEN(LOWER(RTRIM(LTRIM(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(s2.Text, @crlf, ''), @tab, ''), @lf, ''), @cr, ''), ' ', '')))))) as text_Len
FROM SYSCOMMENTS AS s2 WHERE o.id = s2.id )
FROM dbo.sysobjects o, sys.schemas s
-- get all non-system procs
WHERE o.uid = s.schema_id
AND OBJECTPROPERTY(o.id, N'IsProcedure') = 1 AND OBJECTPROPERTY(o.id, N'IsMSShipped') = 0
ORDER BY SPROC_NAME, USER_NAME
|
|
|
|
|
Thanks for providing the fix for sproc schema. I've had it on my todo list forever (since last year), and just been to busy.
The highest sounds are hardest to hear.
Going forward is a way to retreat.
Great talent shows itself late in life.
Even a perfect program still has bugs.
|
|
|
|
|
not sure i like the way i fixed it now, but it seems to be working OK, also done some fixes for the TABLE SCHEMA and COLUMNS which fits with your code much better, i might fix the stored proc schema code properly, so that getting table and stored proc schema works the same way, and then send it you all over if you want.
|
|
|
|
|
That is absolutely brilliant and has made my day, no week
|
|
|
|
|
First let me say thank you for such a useful tool. In case you are keeping track, I noticed an error in the SQL generated to patch the source schema if a column's Identity specification was changed (e.g. someone dropped to insert data instead of using IDENTITY INSERT). The following generated code produces a syntax error:
-- Alter existing table columns
ALTER TABLE [dbo].[foo]
ALTER COLUMN [bar] [int] Identity (1 ,1) NOT NULL
--2nd pass thru after 'Alter' table columns to handle those columns having UDDTs
ALTER TABLE [dbo].[foo]
ALTER COLUMN [bar] [int] NOT NULL
AFAIK, there isn't a straight forward way to script this change in Sql2000/2005 - you have to duplicate either the table or column, transfer data, drop/create constraints and indexes, etc. For me the real value is in just showing me the differences and the generated patch is a convenience in some cases.
Thanks again.
-Ed
|
|
|
|
|
Hello,
Good catch on the bug . I will make changes to the XSLT to handle identify columns in the ALTER TABLES/ALTER COLUMN section. I can never seem to find all the code issues.
I appreciate the good words and the information about the bug.
Thanks very much,
Lindsey
The highest sounds are hardest to hear.
Going forward is a way to retreat.
Great talent shows itself late in life.
Even a perfect program still has bugs.
|
|
|
|
|
When i try to compily your solution
it doesn't find the DTS namespace
and FTSCustTasks
in de DTSPackage class..
Am a missing references??
|
|
|
|
|
Hi, Please review the message titled "Compile Errors".
Here is the bulk of that message.
There is a dependency for the development project to have the Microsoft SQL Server 2000 Service Pack 4 installed or the SQL Server 2000 DTS DLLs. There are three DLLs included in the SQL Server 2000 SP4 that I should have made sure the interops were included in the reference DLLs directory: Interop.DTS.dll, Interop.DTSCustTasks.dll, and Interop.DTSPump.dll.
The references to the interops were removed from the ZIP when it was cleaned of the build DLLs.
There is also a dependency Microsoft's XMLDiff DLLs where the source should be in the ZIP along with a dependency on NLog which is in the reference DLLs directory and the latest WIX installer which is available from wix.sourceforge.net.
There is a zip file for the DTS interop DLLs on my google code site: http://code.google.com/p/sqlschematool/[^], though you should probably get them from SQL Server 2000 SP4.
The highest sounds are hardest to hear.
Going forward is a way to retreat.
Great talent shows itself late in life.
Even a perfect program still has bugs.
|
|
|
|
|
Hi Also Source Code and MSI File not exists
Please if you have the files, send the files to my mail omnis@t-home.mk
Thanks
Regards,
Daniel
|
|
|
|
|
Great job, that tool is looking very good
I find 2 major problems
1. different schema error
Generate SQL Schema:
2009-03-05 11:06:13.5532|ERROR|Lewis.SST.SQLSchemaTool|
SQL Error: The object 'XXX' does not exist in database 'DB' or is invalid for this operation., DB Server localhost:DB
the XXX is a view on Schema different from the dbo.
dropping the XXX view on the DB couse error on different view on that schema, dropping all the views on that schema and the Generate work OK (only do not generate the different schema)
the "SQL Schema Tool" generaly iggnore schemas...
1. Export tabe as... error (in any format)
LOG:
2009-03-05 11:25:04.3154|INFO|Lewis.SST.Gui|SST GUI Ending, saving options settings.
2009-03-05 11:25:07.8421|ERROR|Lewis.SST.Gui|Application Error: Collection was modified; enumeration operation may not execute.
at System.Collections.ArrayList.ArrayListEnumeratorSimple.MoveNext()
at System.Windows.Forms.Application.ExitInternal()
at System.Windows.Forms.Application.ThreadContext.OnThreadException(Exception t)
at System.Windows.Forms.Control.WndProcException(Exception e)
at System.Windows.Forms.Control.ControlNativeWindow.OnThreadException(Exception e)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Lewis.SST.Gui.App.Main()
Message details:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at Lewis.SST.SQLMethods.SQLData.GetDBTableNames(String DBName, SqlConnection connection)
at Lewis.SST.Gui.SQLServerExplorer.getDBTables(TreeNode dbtn)
at Lewis.SST.Gui.SQLServerExplorer.getDataTablesToolStripMenuItem_Click(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3031 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
SSTUI
Assembly Version: 1.0.3.2
Win32 Version: 1.0.3.2
CodeBase: file:///C:/Program%20Files/Sql%20Schema%20Tool/SST%20GUI/SSTUI.exe
----------------------------------------
SSTassemblies
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.932 (QFE.050727-9300)
CodeBase: file:///C:/Program%20Files/Sql%20Schema%20Tool/SST%20GUI/SSTassemblies.DLL
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3031 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3031 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3031 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Data
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3031 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3031 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3031 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Web
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3031 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll
----------------------------------------
System.Messaging
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3031 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Messaging/2.0.0.0__b03f5f7f11d50a3a/System.Messaging.dll
----------------------------------------
System.Data.SqlXml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3031 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Data.SqlXml/2.0.0.0__b77a5c561934e089/System.Data.SqlXml.dll
----------------------------------------
System.Xml.Xsl.CompiledQuery.1
Assembly Version: 0.0.0.0
Win32 Version: 2.0.50727.3031 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Data.SqlXml/2.0.0.0__b77a5c561934e089/System.Data.SqlXml.dll
----------------------------------------
dyzminsh
Assembly Version: 1.0.3.2
Win32 Version: 2.0.50727.3031 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Transactions
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3031 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.EnterpriseServices
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3031 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
----------------------------------------
System.Design
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3031 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Design/2.0.0.0__b03f5f7f11d50a3a/System.Design.dll
----------------------------------------
System.Deployment
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3031 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Deployment/2.0.0.0__b03f5f7f11d50a3a/System.Deployment.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitdebugging="true" />
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
|
|
|
|
|
Hello,
If I understand correctly, the first issue is that the view has a different owner that the database owner (or the user defined for the SQL connection)?
In that case as a workaround, you could try connecting to the database with the 'SA' user.
I will have to setup a test for this scenerio to see what happens.
In the second issue, my understanding is you are unable to export data from the selected table name and get the above error.
The error indicates that the "Get List of Tables" function failed rather than the export. The function which gets the database's tables returns them in an arraylist after running the following T-SQL command where the '{0}' is replaced in code with the database name via the string.Format() method:
@"USE [{0}]
select
TABLE_NAME = convert(sysname,o.name), /* make nullable */
TABLE_OWNER = convert(sysname,user_name(o.uid)),
TABLE_TYPE = convert(varchar(32),rtrim(substring('SYSTEM TABLE TABLE VIEW ',(ascii(o.type)-83)*12+1,12))), /* 'S'=0,'U'=2,'V'=3 */
REMARKS = convert(varchar(254),null) /* Remarks are NULL */
from sysobjects o
where
o.name not in ('dtproperties','sysconstraints','syssegments')
and o.type = 'U'
order by TABLE_NAME
Try running this SQL in your query analyzer using the same user connection information you used in SST.
This could also be a permissions issue - or some SQL patch issue. Please provide the version of SQL Server and any patches you are running as well.
Thanks
The highest sounds are hardest to hear.
Going forward is a way to retreat.
Great talent shows itself late in life.
Even a perfect program still has bugs.
|
|
|
|
|
Hello,
1. On sql 2000 owner = Schema
On 2005 U can create Schemas different from user names, query view on abc Schema will be like abc.viewName
I connected with the 'SA' user
2 . The query above return the list of the tables on the DB like:
TABLE_NAME TABLE_OWNER TABLE_TYPE REMARKS
the_name dbo TABLE NULL
.
.
the table I try to export is on the list
It Kind of weird, when I try it again today there is different error
The only thing that change - I install .NET 3.5 SP1
no log change
error
System.NullReferenceException: Object reference not set to an instance of an object.
at Lewis.SST.SQLMethods.SQLData.GetData(String query, SqlConnection connection)
at Lewis.SST.Gui.SQLServerExplorer.ExportSelectedTable(ExportFormat format)
at Lewis.SST.Gui.SQLServerExplorer.cvsMenuItem_Click(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Thanks
|
|
|
|
|
Hello,
First - I did not handle the null datareader object which causes a secondary error. The null object error that hides the actual error message. That message is a SQL error that says the DB.dbo.Table does not exist.
So Second - Somewhere in code I am hard coding the schema name to be 'dbo'. I will have to take a look at the topic of schema's, roles and owners in SQL 2005.
Finally Third - I did not do the due dilligence to find out about this topic when I made the existing code work with SQL 2005 as I was always testing against SQL 2000 DBs that got migrated into SQL 2005.
This lack of good unit tests has caused many a programmer a good night's sleep.
Microsoft specifically says in their help file: Code written for earlier releases of SQL Server may return incorrect results if the code assumes that schemas are equivalent to database users.
So I apologize and recommend that for now - you should limit the use of the tool to only run against tables that are have the schema of dbo.
I am in the process of checking into the opensource project the necessary changes for the proper error handling so that the secondary or cascading error does not occur.
Thanks
The highest sounds are hardest to hear.
Going forward is a way to retreat.
Great talent shows itself late in life.
Even a perfect program still has bugs.
|
|
|
|
|
Sounds great, but...
Loaded SQL Schema Tool.sln into VS2008 (wouldn't load Wix, but that's no problem), ran Batch Rebuild All, and got errors...
D:\dev\SQL SChema Tool\DTS XML\DTSColumns.cs(12,30): error CS0246: The type or namespace name 'DTS' could not be found (are you missing a using directive or an assembly reference?)
D:\dev\SQL SChema Tool\DTS XML\DTSPackage.cs(1,7): error CS0246: The type or namespace name 'DTS' could not be found (are you missing a using directive or an assembly reference?)
D:\dev\SQL SChema Tool\DTS XML\DTSPackage.cs(2,7): error CS0246: The type or namespace name 'DTSCustTasks' could not be found (are you missing a using directive or an assembly reference?)
.
.
D:\dev\SQL SChema Tool\DTS XML\DTSPackage.cs(57,14): error CS0103: The name 'DTS' does not exist in the current context
Compile complete -- 20 errors, 0 warnings
Done building project "DTSPackageClass.csproj" -- FAILED.
Suggestions?
|
|
|
|
|
Hello,
I apologize for not stating all of the project requirements. There is a dependency for the development project to have the Microsoft SQL Server 2000 Service Pack 4 installed or the SQL Server 2000 DTS DLLs. There are three DLLs included in the SQL Server 2000 SP4 that I should have made sure the interops were included in the reference DLLs directory: Interop.DTS.dll, Interop.DTSCustTasks.dll, and Interop.DTSPump.dll. I removed them from the ZIP when I was cleaning up the build DLLs.
There is also a dependency Microsoft's XMLDiff DLLs where the source should be in the ZIP along with a dependency on NLog which is in the reference DLLs directory and the latest WIX installer which is available from wix.sourceforge.net.
I will add a zip(s) file for the DTS interop DLLs on my google code site: http://code.google.com/p/sqlschematool/[^], though you should probably get them from SQL Server 2000 SP4.
I appreciate your patience with me.
Thanks
The highest sounds are hardest to hear.
Going forward is a way to retreat.
Great talent shows itself late in life.
Even a perfect program still has bugs.
|
|
|
|
|
Thanks for quick response - it resolved all errors bar two...
>>> Start Compile Errors <<<<br mode="hold" />------ Build started: Project: SQLSchemaToolGUI, Configuration: Release Any CPU ------
del "C:\projects\C#\SQLSchemaTool\SQL Schema Tool GUI\bin\Release\merge.log"
"C:\projects\C#\SQLSchemaTool\SQL Schema Tool GUI\bin\Release\merge.bat"
The system cannot find the path specified.
The system cannot find the path specified.
C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(895,9): error MSB3073: The command "del "C:\projects\C#\SQLSchemaTool\SQL Schema Tool GUI\bin\Release\merge.log"
C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(895,9): error MSB3073: "C:\projects\C#\SQLSchemaTool\SQL Schema Tool GUI\bin\Release\merge.bat"" exited with code 1.
Done building project "SQLSchemaToolGUI.csproj" -- FAILED.
------ Build started: Project: SQLSchemaToolGUI, Configuration: Debug Any CPU ------
del "C:\projects\C#\SQLSchemaTool\SQL Schema Tool GUI\bin\Debug\merge.log"
"C:\projects\C#\SQLSchemaTool\SQL Schema Tool GUI\bin\Debug\merge.bat"
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(895,9): error MSB3073: The command "del "C:\projects\C#\SQLSchemaTool\SQL Schema Tool GUI\bin\Debug\merge.log"
C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(895,9): error MSB3073: "C:\projects\C#\SQLSchemaTool\SQL Schema Tool GUI\bin\Debug\merge.bat"" exited with code 1.
Done building project "SQLSchemaToolGUI.csproj" -- FAILED.
>>> End Compile Errors <<<<br mode="hold" />
The path and file "C:\projects\C#\SQLSchemaTool\SQL Schema Tool GUI\bin\Debug\merge.log" exists on my system, as does "C:\projects\C#\SQLSchemaTool\SQL Schema Tool GUI\bin\Debug\merge.bat".
I also removed the read only from the paths and files.
|
|
|
|
|
Hello,
For the SQLSchemaToolGUI project, edit the pre and post build events which are accessed from the project properties.
There is an initial line for both pre and post build events that has:
del "$(TargetDir)merge.log"
Change that line to:
IF EXIST "$(TargetDir)merge.log" del "$(TargetDir)merge.log"
What happened to cause this was I had first ran the merge.bat file from the commandline, which creates the merge.log file. So I never thought about the fact that the log file would not be there.
The log file is the output log of the .Net iLMerge tool, which the batch file is using to merge all the individual DLLs into the single SSTassemblies.dll file.
Thanks
The highest sounds are hardest to hear.
Going forward is a way to retreat.
Great talent shows itself late in life.
Even a perfect program still has bugs.
|
|
|
|
|
It looks like this would be useful tool for helping to determine differences between two versions of a database. But I'm always concerned when I see tools for performing automatic differencing of databases, because, assuming that the customer's database is not supposed to contain exactly the same rows as contained in the development DB, there is an important class of changes that they are unable to detect: namely, semantic DB changes that do not correspond precisely to schema changes.
For example: suppose that we have a table, employees , which contains the non-nullable integer field manager_id . Currently, this field is set to -1 to indicate that an employee has no manager (e.g. the CEO). Later, it is decided that it is better to represent unmanaged employees using a NULL in this column, so on the development DB, we make column manager_id nullable, and run the following query to change all unmanaged employees from -1 to NULL:
UPDATE employees
SET manager_id = NULL
WHERE manager_id = -1
Now, when it comes time to update a customer's DB, your automatic schema differencing approach will have no trouble picking up the change from non-nullable to nullable in the manager_id column. But how could it ever infer that it needs to change the manager_id column values for unmanaged employees? The answer is that it can't. So this important change slips through unnoticed. (Unless of course someone knowledgeable about the DB changes that have been made is babysitting each customer DB upgrade -- but then that defeats the purpose of having an automated tool.)
For this reason, I recommend using a change-script-based approach to maintaining databases. Have each database contain a table of meta-information describing which scripts have been applied so far, and write a program that applies all change scripts that have not yet been applied, then updates this table. This way, any and all changes to databases are picked up. The downside is that this approach requires more discipline on the part of the developers -- changes can't be made in an ad hoc way using a GUI tool, they must be given as SQL DDL/DML scripts.
|
|
|
|
|
Hello,
I would agree 100% that you'd want to review any SQL changes going to a customer database.
As I see it, the main purpose for any automatic SQL updates would be for enhancement of a "continuous integration" process whereby the process updates the SQL in the QA enviroment automatically, at the same time the auto deploy of the latest code build takes place.
Thanks for your thoughtful reply.
The highest sounds are hardest to hear.
Going forward is a way to retreat.
Great talent shows itself late in life.
Even a perfect program still has bugs.
|
|
|
|
|
Very helpful tool.
Thanks.
Toño (Mexicali,BC,México)
|
|
|
|
|
|
General News Suggestion Question Bug Answer Joke Praise Rant Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.
|
|