Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 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 December 6th, 2006, 05:46 AM
Registered User
 
Join Date: Dec 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default copying values into a column from another table

Need a little help to try and get around my problem.
A nominal table in linux creates a priod eg nomhist_1206
I done an open query in a view to look @ this table but I have a n issue where the nomhist table has values in eg code1, code2, and in code3 but the next homhist table nomhist_1106 has in code1, code2 values are in code3 etc.

So I placed the view into a table then done a search and removed the to nulls then search for a value using if's and put it into a temp table.

I then set code1 to null hoping that I could update

code1 on the temp table to code1 but it doesn't seem to work.

Update f_TM1_nomhist_0105
Set code1 = b.code1
from f_TM1_nomhist_0105 a, #rob2 b
where
a.code1 is null

Its like a copy and paste!! delete code1's values then replace them with the temp table. It inserts 7500 in all rows??

 
Old December 8th, 2006, 03:31 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Where do you use a join between those two tables?

_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying from one table to another Clive Astley VB Databases Basics 2 August 23rd, 2005 12:48 AM
how to make column of table 1 = to column of table gilgalbiblewheel Classic ASP Databases 4 October 11th, 2004 11:57 PM
copying from table 1 inserting in table 2 gilgalbiblewheel Java GUI 0 September 15th, 2004 03:40 PM
Copying Table Relationship Diagram mike123abc SQL Server 2000 1 February 19th, 2004 09:16 AM
copying array to table (reverse of getrows?) rachelow VB Databases Basics 0 July 19th, 2003 03:10 AM





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