SQL Error when importing objects

wash64864
Member Posts: 13
I am trying to import objects into Navision SQL. Some of the columns in the table are being deleted. All the data in the columns are blank or zero, but I get and error message which reads as follows: The statistics (column name) is dependent on (column name). ALTER TABLE DROP COLUMN (column name) failed because one or more objects access the column. I tried dropping statistics on the table but to no avail. Has anyone encountered this problem?
0
Comments
-
I think you have in File=>Database=>Alter=> Tab Integration=>Field "Maintain Relationships"=Yes.
Removing this toggle might help. But I don't know what the consequences are of removing the toggle. I never removed it, because when I create a DB, I don't put it to Yes.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
[Topic moved from Navision to SQL General forum]0
-
Was this issue ever resolved? I'm running into this same problem on a current upgrade. Maintain Relations is NO. And Auto Update Stats is off.There are no bugs - only undocumented features.0
-
Hi,
I have the same Problem,
could someone please tell me how i could solve this ??
[-o<0 -
I was able to resolve this issue by dropping the statistics before importing the objects. Then just do a create statistics after.
I put together the following SQL script for the drop.
DECLARE @SQLString nvarchar(500);
DECLARE Stat_Cursor CURSOR
FOR
Select OBJECT_NAME(object_id), name from sys.stats
Where user_created = 1;
OPEN Stat_Cursor;
DECLARE @ObjectName sysname;
DECLARE @StatName sysname;
FETCH NEXT FROM Stat_Cursor
INTO @ObjectName, @StatName;
@FETCH_STATUS = 0
BEGIN
SET @SQLString = '';
SET @SQLString = 'DROP Statistics [';
SET @SQLString = @SQLString + @ObjectName;
SET @SQLString = @SQLString + '].[';
SET @SQLString = @SQLString + @StatName;
SET @SQLString = @SQLString + ']';
EXECUTE sp_executesql @SQLString;
FETCH NEXT FROM Stat_Cursor
INTO @ObjectName, @StatName;
END;
CLOSE Stat_Cursor
DEALLOCATE Stat_Cursor
GOThere are no bugs - only undocumented features.0 -
I think Joerg describes this problem in his blogpost but it is very technical.
http://dynamicsuser.net/blogs/stryk/arc ... stics.aspx
These functions also exists in our SQL perform tools but those are not available for free I'm affraid as they also contain much much more functionality.
Good luck0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions