Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17
  • Thread Tools
  1. 5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,009
    Thanks
    0
    Thanked 2 Times in 2 Posts
    The Delete Query is fairly straight forward
    Code:
    DELETE    FROM    TableToBackUp
    The Append Query will depend upon whether you have an IDENTITY field
    That is like an Access AutoNumber field

    IF YOU HAVE NO IDENTITY FIELD
    Code:
    INSERT INTO   TableToBackUp
    SELECT          BackupOfTable .*
    FROM         	BackupOfTable
    IF you have an Identity field then
    You must name Each Field That exists in the Tables and also Add a Line to Allow insertion into the Identity Field

    Code:
    SET IDENTITY_INSERT TableToBackUp ON
    GO
    INSERT INTO  TableToBackUp
                     	(Field1, Field2, Field3, etc)
    SELECT     	Field1, Field2, Field3, etc
    FROM       	BackupOfTable
    To be honest, you should not have to do any of this.
    Once you have set the BIT Fields to 0, and then Updated the design
    to have a default and Not allow zero's everything should be fine.
    Andrew

  2. 4 Star Lounger
    Join Date
    Feb 2001
    Location
    Australia
    Posts
    501
    Thanks
    10
    Thanked 0 Times in 0 Posts
    Thanks for your help. Writing default data to the three re-added bit fields and setting defaults for them resolved the issue, and the backup was not needed.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •