Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 24th, 2006, 12:01 PM
Registered User
 
Join Date: Jul 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Modify DB and Code

Once again, I'm new to MS development so easy on me. Here's what I want to do. I've recreated the database but have changed all names to my naming conventions. The structure is identical. Now, I want to transfer all data from the existing tables into my newly named tables. I've been messing with this a bit and it seems there would be a simple SQL command like,
INSERT INTO newname SELECT * FROM oldname
I'm I missing something simple with server 2005?

Second, since all pieces are being rebuilt from the ground up what other areas would you foresee issue with? For example, recreating the structure of the project with the customevents being a seperate project within the solution and how this is done.

Thanks,


SL
 
Old July 24th, 2006, 01:03 PM
Registered User
 
Join Date: Jul 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Just wanted to add that I have been able to do some inserts but my main issue is with this error

"Explicit value must be specified for identity column in table 'mytable_Articles' either when IDENTITY_INSERT is set to ON or when a replication user is inserting into a NOT FOR REPLICATION identity column."

My command:
SET IDENTITY_INSERT test1.dbo.mytable_Articles ON
INSERT INTO [test1].[dbo].[mytable_Articles]
           ([AddedDate]
           ,[AddedBy]
           ,[CategoryID]
           ,[Title]
           ,[Abstract]
           ,[Body]
           ,[Country]
           ,[State]
           ,[City]
           ,[ReleaseDate]
           ,[ExpireDate]
           ,[Approved]
           ,[Listed]
           ,[CommentsEnabled]
           ,[OnlyForMembers]
           ,[ViewCount]
           ,[Votes]
           ,[TotalRating])
     SELECT
           [AddedDate]
           ,[AddedBy]
           ,[CategoryID]
           ,[Title]
           ,[Abstract]
           ,[Body]
           ,[Country]
           ,[State]
           ,[City]
           ,[ReleaseDate]
           ,[ExpireDate]
           ,[Approved]
           ,[Listed]
           ,[CommentsEnabled]
           ,[OnlyForMembers]
           ,[ViewCount]
           ,[Votes]
           ,[TotalRating]
    FROM tbh_Articles

Thanks for any help.

SL
 
Old July 24th, 2006, 09:48 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You have 2 sets of issues. Referrential Integrity constraints and Identity columns. You need to disable constraints on the target tables, and you need to enable indentity inserts. After moving the data you have to re-enable constraints and disable identity inserts. See google and Books On-Line for syntax.

Eric






Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a SQL Server DB through VB code tknnguyen VB Databases Basics 2 July 2nd, 2008 11:28 AM
Access db/ Common Dialog/ errors in code azkabancells VB Databases Basics 1 May 25th, 2005 10:34 AM
Need DSN Connection Code to Access DB markw707 ASP.NET 1.0 and 1.1 Basics 0 May 13th, 2005 09:10 AM
Chapter 14 Code example in Oracle DB theinscrutable BOOK: Professional Jakarta Struts 0 January 10th, 2005 01:31 PM
code to clean and modify dbase lord_brighton Access VBA 0 August 8th, 2004 07:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.