Theme Graphic
Theme Graphic

SQL Database Recovery | Repair SQL Database

SQL recovery software to recover & repair corrupted MS SQL database from MSSQL Server. Support recovery of data from MS SQL 2000, 2005 &...

Subscribe

Author

Archive

Open 2010

Tags

Posted on Sunday, May 09, 2010 at 11:49 PM

Using bcp and Bulk Insert Cause Assertion in SQL Server


In Microsoft SQL Server, you can copy bulk data between an instance of SQL Server and data file in user-specified format, using bcp utility. You can use this tool for exporting data from SQL Server tables or importing large number of rows into the SQL Server tables. However, in some situations, inserting data in SQL Server table using bcp utility may damage the database table and cause serious data loss. At this point, you have to use SQL Database Recovery software to repair the damaged table, if you do not have a complete backup in place.

In a practical scenario, you may come across an assertion when you import data in the MS SQL Server table, using Bulk Insert T-SQL command or bcp utility. The SQL Server database corruption may also occur in such situations. Furthermore, you might encounter the below error message:

“Server: Msg 823, Level 24, State 2, Procedure gfspTMAppendText, Line 20 I/O error (bad page ID) detected during read at offset 0x0000000024e000 in file 'C:\Program Files (x86)\Microsoft SQL Server\MSSQL\data\REPRO.mdf'.”

At the same time, you may get the below errors in SQL Server log:

1.DateTime spid53 SQL Server Assertion: File: <SpcAlloc.cpp>, line=466 Failed Assertion = '0'.

2.DateTime spid53 Error: 3624, Severity: 20, State: 1.

When you attempt to check database integrity and fix database corruption using DBCC CHECKDB utility, you face error messages, which states:

1.Server: Msg 8909, Level 16, State 1, Line 1 Table error: Object ID 0, index ID 0, page ID (1:105). The PageId in the page header = (0:0).

2.Server: Msg 8928, Level 16, State 1, Line 1 Object ID 2009058193, index ID 255: Page (1:105) could not be processed. See other errors for details.

What causes this problem:

The above issue may occur if the below conditions are true: You run bcp tool or Bulk Insert together with FIRE_TRIGGERS option. You import an SQL Server table having after trigger, and this trigger updates text column of other table.

In such situations, you need to repair and restore damaged SQL Server database using SQL Repair tools. The applications are specifically designed to scan and Repair SQL database in all cases of corruption. MS SQL Repair with these applications is totally safe and simple.

SQL Recovery software repairs and restores damaged SQL Server database, in all cases of corruption. It is compatible with Microsoft SQL Server 2008, 2005, and 2000. The software restores all SQL Server database objects, such as tables, reports, forms, macros, data types, triggers, stored procedures, and constraints.
Bookmark: Submit To Digg Submit To reddit Submit To del.icio.us Bookmark With StumbleUpon Bookmark With FaceBook Bookmark With Google Bookmarks   Share: Share By Email By Email

0 comments on "Using bcp and Bulk Insert Cause Assertion in SQL Server"
No comments posted yet.

Leave A Comment
Subject:


Comment:
   Bold Italic Underline          Code Link Image Horizontal Rule


Because you do not have or are not logged in to your Programmer's Heaven account, please enter your name.

Name:


To help prevent comment SPAM, please enter the magic code '938' in the box:




Posting Rules
Please follow these rules when posting comments on blog posts.
  • Do not post anything that is racist, hate speech or of a sexual or adult nature.
  • Do not post or link to anything that infringes copyrighted laws.
  • Posting about security or legal topics is fine so long as you are not glorifying or encouraging people to perform illegal activities.
  • Both the author of this blog and the Programmer's Heaven administrators may delete any inappropriate comments without notice at their own discretion.
 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.