Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 24th, 2006, 01:01 PM
Registered User
 
Join Date: Jul 2006
Location: , , .
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
__________________
SL
Reply With Quote
  #2 (permalink)  
Old July 24th, 2006, 02:03 PM
Registered User
 
Join Date: Jul 2006
Location: , , .
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
Reply With Quote
  #3 (permalink)  
Old July 24th, 2006, 10:48 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Atlanta, Georgia, USA.
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

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 12:28 PM
Access db/ Common Dialog/ errors in code azkabancells VB Databases Basics 1 May 25th, 2005 11:34 AM
Need DSN Connection Code to Access DB markw707 ASP.NET 1.0 and 1.1 Basics 0 May 13th, 2005 10: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 08:26 AM



All times are GMT -4. The time now is 07:02 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.