***** * Zap document table in sql server database. * Close the document_rv view if it's open. If Used( "Document_rv") Use in Document_rv EndIf * Delete contents of UnitType table ? SQLExec( liHandle, "truncate table Document") && liHandle is assigned a value somewhere else. ? SQLExec( liHandle, "dbcc checkident (Document, reseed, 0)") * Done zapping Document table ***** ***** * Replace empty dates in Documents1_cu cursor * with 1900-01-01. Sql server seems to be having a problem with date overflow. Update documents1_cu set DocumentRequestedDate = Date(1900,1,1) where Empty( DocumentRequestedDate) Update documents1_cu set DocumentReceivedDate = Date(1900,1,1) where Empty( DocumentReceivedDate ) Update documents1_cu set DocumentTicklerDate = Date(1900,1,1) where Empty( DocumentTicklerDate) Update documents1_cu set DateEntered = Date(1900,1,1) where Empty( DateEntered) * Done fixing empty dates ***** ***** * Insert the data into the Documents table * Set document table to accept insertion of primary key values Select 0 Use document_rv ? "Set document_rv identity insert on: " ?? SQLExec( CursorGetProp("ConnectHandle", "Document_rv"), "set identity_insert Document on") Insert into document_rv ; select * from Documents1_cu ? "Updated document table: " ?? TableUpdate(.t., .t., "Document_rv")