SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Insert into one table if not exists in other tab
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jayram
Starting Member

47 Posts

Posted - 06/25/2013 :  16:09:16  Show Profile  Reply with Quote
i have two tables

CODES and RATES

CREATE TABLE [dbo].[RATES](
[CBA] [varchar](6) NOT NULL,
[NOS] [varchar](5) NOT NULL)

CREATE TABLE [dbo].[CODES](
[CBA] [varchar](6) NOT NULL)

my rates table has 4 records like follows for CBA01

insert into RATES select 'CBA01', 'A4233'
insert into RATES select 'CBA01', 'A4234'
insert into RATES select 'CBA01', 'A4235'
insert into RATES select 'CBA01', 'A4236'

my codes table has CBA01 to CBA100

my rates table has entries for CBA01. i want to duplicate the records for CBA01 for all other CBA's (CBA02 to CBA100) in rates table.

Any help!!

thanks

jayram
Starting Member

47 Posts

Posted - 06/25/2013 :  16:22:19  Show Profile  Reply with Quote
Never mind. i got it using Cross join.

Thanks
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000