HighDots Forums  

Insert in SQL

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Insert in SQL in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Aleks
 
Posts: n/a

Default Insert in SQL - 08-08-2004 , 12:04 AM






Sorry for bothering so much, thing is I am converting an old database to a
new one and I am not exactly a SQL master, anyways here it is.

OLD TABLE: DELETETHISOLDCOMMENTS
UserId = This is an ID
Comments = text

NEW TABLE: Casecomments
COMID = This is the ID of the table, in this case I think irrelevant
CaseID = This will be equal to the "UserId" in the old table
Comments = This will be equal to the "Comments" in the old table
SectionCase = This must be equal to 'Alien'

So, basically I need to insert the values from table 1 into table 2 (The new
one) using the UserId to insert into CaseId and Comments to insert into
Comments, additionaly for all records field "SectionCase" must be set to
"Alien".

How can this be done ?

Thanks for the help ...

Aleks



Reply With Quote
  #2  
Old   
Aleks
 
Posts: n/a

Default Re: Insert in SQL - 08-08-2004 , 12:15 AM






Ok ... this one I figured out:

insert into casecomments (SectionCase,Caseid,Comments,Visible)
select 'Alien',UserId,Comments,'0' from DELETETHISOLDCOMMENTS
"Aleks" <axiaxi2003 (AT) hotmail (DOT) com> wrote

Quote:
Sorry for bothering so much, thing is I am converting an old database to a
new one and I am not exactly a SQL master, anyways here it is.

OLD TABLE: DELETETHISOLDCOMMENTS
UserId = This is an ID
Comments = text

NEW TABLE: Casecomments
COMID = This is the ID of the table, in this case I think irrelevant
CaseID = This will be equal to the "UserId" in the old table
Comments = This will be equal to the "Comments" in the old table
SectionCase = This must be equal to 'Alien'

So, basically I need to insert the values from table 1 into table 2 (The
new
one) using the UserId to insert into CaseId and Comments to insert into
Comments, additionaly for all records field "SectionCase" must be set to
"Alien".

How can this be done ?

Thanks for the help ...

Aleks





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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.