SQL Server Q&A

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries Tagged ‘error message’

FIX: BCP Out Fails with Exception Error if You Use a Format File to Change Order of Columns

Symptoms
If you use Bcp.exe to export a table to a flat file, the process may fail with an exception error if you use a format file to change the order of the columns during the export. The exception error occurs within the Bcp.exe file and the following error message appears:

The instruction at “memory_address” referenced memory at “memory_address”.
The memory could not be “written”.The output file is created but no rows are exported.
Resolution
Use a view to change the order of the columns to export. Then, use the view when you perform the bulk copy program and have the format file match the order of the columns in the view.

FIX: Index Tuning Wizard Execution May Generate Floating Point Exception

Symptoms
When you run the Index Tuning Wizard, this error message may occur:

Server: Msg 3628, Level 16, State 1, Line 2
A floating point exception occurred in the user process. Current transaction is canceled.
Resolution
When a double was out of range from an underflow or overflow, the Index Tuning Wizard incorrectly converted the number into the maximum or minimum float value.

FIX: BCP Out Fails with Exception Error if You Use a Format File to Change Order of Columns

Symptoms
If you use Bcp.exe to export a table to a flat file, the process may fail with an exception error if you use a format file to change the order of the columns during the export. The exception error occurs within the Bcp.exe file and the following error message appears:

The instruction at “memory_address” referenced memory at “memory_address”.
The memory could not be “written”.The output file is created but no rows are exported.
Resolution
Use a view to change the order of the columns to export. Then, use the view when you perform the bulk copy program and have the format file match the order of the columns in the view.

BUG: Restore With STANDBY Option May Recover a Database

Symptoms
If you specify an empty string for the STANDBY option when you perform a RESTORE, the STANDBY option is ignored and the RESTORE statement performs a recovery of the database. Any subsequent RESTORE of transaction logs returns the following error message:

Server: Msg 4306, Level 16, State 2, Line 1
The preceding restore operation did not specify WITH NORECOVERY or WITH STANDBY. Restart the restore sequence, specifying WITH NORECOVERY or WITH STANDBY for all but the final step.
Server: Msg 3013, Level 16, State 1, Line 1
Backup or restore operation terminating abnormally.
Resolution
Provide a valid filename and path for the STANDBY file.

BUG: DOC Error: Documentation Incorrectly States that DB_Owner role has Restore Database Permissions

Symptoms
SQL Server 7.0 Books Online states that a member of the db_owner role has RESTORE DATABASE permission. However, when a member of the db_owner fixed database role tries to restore a database, the following error message occurs:

Server: Msg 3110, Level 14, State 1, Line 1
Only members of the sysadmin role or the database owner of ‘Database_Name’ can run RESTORE DATABASE.
Server: Msg 3013, Level 16, State 1, Line 1
Backup or restore operation terminating abnormally.
Resolution
Members of the db_owner fixed database role do not have RESTORE permissions. This behavior is by design. Fixed database role membership can only be checked when the database is accessible and undamaged. Because this is not always the case when the RESTORE statement is executed, members of the db_owner fixed database role do not have RESTORE permissions.

InvalidCastException when you bind DateTimePicker that contains a null value in Visual Basic

Symptoms
When you bind a DateTimePicker control to a data source, you may receive the following error message:

An unhandled exception of type ‘System.InvalidCastException’ occurred in mscorlib.dll
Additional information: Object cannot be cast from DBNull to other types.
Resolution
This behavior occurs if the field that is bound to the DateTimePicker control contains a null value that is represented by the System.DBNull object. The DateTimePicker control does not support the System.DBNull object.