David Meego - Click for blog homepageThis is a reposting of an article I originally wrote on my Developing for Dynamics GP blog.

It has been brought to my notice that we have another issue with a dictionary adding records to the syMenuMstr (SY07110) table each time a user logs into Microsoft Dynamics GP.  This issue is caused by the new Dynamics Online Services dictionary which was installed as part of Microsoft Dynamics GP 10.0 Service Pack 5 and Microsoft Dynamics GP 2010 Service Pack 1.  This is similar to the Microsoft Dynamics GP 10.0 Service Pack 5 Login Performance issue found previously.

Read more →

David Meego - Click for blog homepageThis is a reposting of an article I originally wrote on my Developing for Dynamics GP blog.

I recently responded on a forum post which asked why the paths for the custom forms and reports dictionaries in the Dynamics.set launch file where pointing to the Data folder. The post also asked why the application did not complain about the fact that the dictionaries listed in the Dynamics.set did not actually exist in the Data folder.

So, I thought it would be a good excuse to answer the questions raised as a blog post.

Read more →

David Meego - Click for blog homepageThis is a reposting of an article I originally wrote on my Developing for Dynamics GP blog.

Added to the Useful SQL Scripts Series.

There are times when you need to recreate a table to change its structure but don’t want to lose the data stored in the table.  I have had this situation a number of times when working on upgrade support cases where (for some unknown reason) a table does not have the correct table structure to allow the Dexterity Utilities to upgrade it.

Disclaimer: I know that later versions of the Professional Services Tools Library (PSTL) does support recreating a table while maintaining the data.  However, you might not have PSTL installed and the script in this post is simple to use.

The script makes a backup of the current table to a new table of the same name with the suffix BAK.  Once the backup is created, you can use the SQL Maintenance (File >> Maintenance >> SQL) window in Microsoft Dynamics GP to drop and create the table and its Auto Stored Procedures.

Note: Please see the post Granting Access and Binding Defaults when recreating SQL Tables for more information on creating tables (especially when related to upgrades).

Once the table has been recreated, you can run the rest of the script to copy the contents of the backup table into the newly recreated table.  Then the final step is to remove the backup table.

Note: Please make sure you have a current backup of the database before using the code in this article.

T-SQL Script Code

-- Written by David Musgrave of Winthrop Development Consultants

-- Last Modified: 12-Nov-2025

/* This Script is designed to be executed in sections */
/* Please read the instructions included as comments  */
/* Use Find and Replace to change the table name      */
/* Highlight each Section and click Execute or F5     */


/* 1 - Make a backup of the table so the data is saved */
-- Make backup of table
select * into TEMP_GL00105 from GL00105 
select count(*) from TEMP_GL00105 
/* 1 - End of Section ................................ */


/* 2 - Optional for testing: Remove data from original table */
-- Test code to remove data
select count(*) from GL00105
delete from GL00105
select count(*) from GL00105
/* 2 - End of Section ...................................... */


/* 3 - Drop and recreate original table using correct structure */
-- Recreate table at this stage using SQL Maintenance or T-SQL
-- This will leave a blank table of the correct structure

/* 3 - End of Section ......................................... */


/* 4 - Re-populate original table from the previously backed up table */
-- Declare variable for SQL 2005/2008
declare @srcfieldlst varchar(max)
declare @dstfieldlst varchar(max)
declare @dstvalues varchar(max)
-- Declare variable for SQL 2000
-- declare @fieldlst varchar(8000)
-- declare @newfieldlst varchar(8000)
-- declare @dstvalues varchar(8000)

-- Insert data from backup table
set @srcfieldlst = ''
select @srcfieldlst = @srcfieldlst + case when len(@srcfieldlst) > 0 then ', ' else '' end + '[' + dst.cn + ']' 
from ( 
	select o.name tn , c.name cn , c.colid from sysobjects o join syscolumns c on o.id = c.id 
	where o.name = 'TEMP_GL00105'  
	and c.name != 'DEX_ROW_ID'  
--	and c.name != 'DEX_ROW_TS'   
) src
join ( 
	select o.name tn, c.name cn , c.colid from sysobjects o join syscolumns c on o.id = c.id 
	where o.name = 'GL00105'  
	and c.name != 'DEX_ROW_ID'  
--	and c.name != 'DEX_ROW_TS'   
) dst
on src.cn = dst.cn
order by src.colid 

set @dstfieldlst = @srcfieldlst
set @dstvalues = ''
select @dstfieldlst = @dstfieldlst + case when len(@dstfieldlst) > 0 then ', ' else '' end + '[' + dst.cn + ']' 
	 , @dstvalues = @dstvalues + ', ' + dst.emptyvalue
from ( 
	select o.name tn , c.name cn , c.colid from sysobjects o join syscolumns c on o.id = c.id 
	where o.name = 'TEMP_GL00105'  
	and c.name != 'DEX_ROW_ID'  
--	and c.name != 'DEX_ROW_TS'   
) src
right outer join ( 
	select o.name tn, c.name cn , c.colid, c.xtype, t.name,
	case 
		when t.name in ('tinyint','smallint', 'int', 'bigint','bit','uniqueidentifier') then '''' + '0' + '''' 
		when t.name in ('numeric', 'real','decimal','float','money') then '''' + '0.0' + '''' 
		when t.name in ('char', 'varchar','nchar','nvarchar','text','ntext','sysname') then '''' + '' + '''' 
		when t.name in ('binary','varbinary','image') then 'cast(' + '0x0' + ' as ' + t.name + ')'
		when t.name in ('datetime','smalldatetime','datetime2','timestamp') then '''' + '1900-01-01 00:00:00.000' + '''' 
		when t.name in ('date') then '''' + '1900-01-01' + '''' 
		when t.name in ('time') then '''' + '00:00:00.000' + '''' 
		else '''' + '' + '''' 
	end emptyvalue
	from sysobjects o join syscolumns c on o.id = c.id join systypes t on c.xtype = t.xtype and c.xusertype = t.xusertype
	where o.name = 'GL00105'  
	and c.name != 'DEX_ROW_ID'  
--	and c.name != 'DEX_ROW_TS'   
) dst
on src.cn = dst.cn
where src.tn is null
order by src.colid 
 
--print @dstfieldlst
--print @srcfieldlst + @dstvalues

exec ( 'insert GL00105 ( ' + @dstfieldlst + ' ) ' + 'select ' + @srcfieldlst + @dstvalues + ' from TEMP_GL00105 ' ) 
select count(*) from GL00105
/* 4 - End of Section ............................................... */


/* 5 - After verifying that the recreated table has the correct data */
-- Remove Backup Table
drop table TEMP_GL00105 
/* 5 - End of Section .............................................. */



select * from GL00105

Note: The declaration of the varchar for Microsoft SQL Server 2000 cannot use the “max” syntax.

To use this script (also attached at the bottom of this article), please highlight the portions you need to execute and press F5.  Only run the next section of code once you are satisfied that the previous code has executed successfully.

Here is the script:

Hope you find this script useful.

David

11-Feb-2011: Added comments to better explain how script works.
06-Dec-2011: Added link to Granting Access and Binding Defaults when recreating SQL Tables post.
12-Mar-2019: Updated with latest code.
15-Apr-2025: Updated to fix varchar conversion error for added binary columns.
12-Nov-2025: Updated to fix issue with duplicate column error when custom column types are used. Thanks to Matt Connor for finding this issue and providing the solution.

 

David Meego - Click for blog homepageThis is a reposting of an article I originally wrote on my Developing for Dynamics GP blog.

Yesterday, I had a really interesting escalated case for a “Site Down” situation.

The story was that after installing the regular Windows Updates for Windows Server 2003 on their SQL Server machine, the customer rebooted to complete the update installation. When the server came back online, no-one could log into Microsoft Dynamics GP anymore.

Read more →

David Meego - Click for blog homepageThis is a reposting of an article I originally wrote on my Developing for Dynamics GP blog.

[Edit] 05-Apr-2023: Updated code available from the article below:

Back on the 1st July 2000, Australia changed its sales tax system from a wholesale sales tax with various rates (depending on the item) to a Goods and Services Tax (GST) with a fixed 10% rate.

To go with the change in the tax system, the Australian Taxation Office (ATO) also brought in a new tax return reporting system known as the Business Activity Statement.

Read more →

Patrick Roth - Click for blog homepageThis is a reposting of an article Patrick Roth originally wrote on my Developing for Dynamics GP blog.

We ran into an odd issue recently that I’d like to share today.

An ISV reported that in their customer was getting an error when the ISV application attempted to execute a stored procedure.

[SQL Server] Could not find stored procedure DYNAMICS.dbo.SomeStoredProcedure

Easy you say – the proc doesn’t exist.  Just create it and you’ll be fine.

Read more →

David Meego - Click for blog homepageThis is a reposting of an article I originally wrote on my Developing for Dynamics GP blog.

It has come to our notice that there is an issue where the Analytical Accounting dictionary for Microsoft Dynamics GP 10.0 Service Pack 5 is adding 4 records to the syMenuMstr table every time the Microsoft Dynamics GP application is launched.

Read more →

David Meego - Click for blog homepageThis is a reposting of an article I originally wrote on my Developing for Dynamics GP blog.

Added to the Microsoft Dynamics GP Application Level Security Series.

I am still surprised how many times questions appear on the newsgroups and forums asking about which Security Tasks and Security Roles are needed to access a particular window. It has been a while since I posted anything about the Support Debugging Tool, and this seems like a perfect opportunity to show how simple it is to use the Support Debugging Tool to find this information.

Read more →

Beth Gardner - Click for blog homepageThis is a reposting of an article Beth Gardner originally wrote on my Developing for Dynamics GP blog.

We have been running into a few different issues with Microsoft Dynamics GP 10.0 and GP 2010 when you have Office 2010 installed.

[Edit] Re-installing the VBA 6.4 core components (as used by Dynamics GP) has been shown to resolve this issue for VBA6.DLL, VBE.DLL, VBA7.DLL and VBE7.DLL errors.  Please download the necessary files from this link:

 

Read more →

Patrick Roth - Click for blog homepageThis is a reposting of an article Patrick Roth originally wrote on my Developing for Dynamics GP blog.

It is somewhat coincidental that one of the system techs had a case Friday running into an error launching Dynamics GP 2010 and the release of Microsoft Dynamics GP 10.0 Service Pack 5.  What do these events have to do with each other?  Read on…

Read more →

David Meego - Click for blog homepageThis is a reposting of an article I originally wrote on my Developing for Dynamics GP blog.

The technique I will discuss in this post is not specific for Microsoft Dynamics GP, but as this is a Microsoft Dynamics GP related blog, I will put a GP “spin” on it.

Since the user interface change from MDI (Multiple Document Interface) to SDI (Single Document Interface) for version 10.0 of GP (see Version 10.0 and its individual windows), we now have a situation that can occur when a window can open outside of the visible area of your windows desktop.

Read more →

David Meego - Click for blog homepageThis is a reposting of an article I originally wrote on my Developing for Dynamics GP blog.

Time and time again I have heard consultants say that the solution to stopping Microsoft Dynamics GP remembering the last user on a Terminal Server or Citrix installation is to make the Dex.ini file read-only.  There was even a Knowledge Base (KB) article that suggested clearing the SQLLastUser setting from the Dex.ini file and then marking the file as read-only.  Well, in my opinion this method has always been evil and from Microsoft Dynamics GP 10.0 onwards will not work anyhow.

Read more →