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
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.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Try to update statistics overnight (INDEXONLY).
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
I have the same Problem,
could someone please tell me how i could solve this ??
[-o<
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
GO
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 luck