I'm working on a way to copy most data columns from another row in the
same table to a new row and insert the courseID value from the form
that executes this action (the copy). Is it possible to have both
"values" and "select" in the same Insert Into statement?
Here's what I have (below). The "CopyCourseID" is the id of the
course that is copied to the new row, although the new row will have a
different course ID ("CourseID").
---------------------------------------------------------------
strCourseID=Request.Form("CourseID")
Insert table_a(CourseID,Name,Address)
Values(strCourseID)
Select Name, Address
From table_a
Where Course ID = Request.Form("CopyCourseID")
------------------------------------------------------------------
Thanks,
Louis 2 2148
You can simply include the value in the SELECT list. A simplified
version, using constants, though you would use values from your
application.
INSERT table_a(CourseID,Name,Address)
SELECT 1234, Name, Address
FROM table_a
WHERE Course ID = 5678
Roy Harvey
Beacon Falls, CT
On Mon, 12 May 2008 12:38:51 -0700 (PDT), ll <ba**********@yahoo.com>
wrote:
>I'm working on a way to copy most data columns from another row in the same table to a new row and insert the courseID value from the form that executes this action (the copy). Is it possible to have both "values" and "select" in the same Insert Into statement? Here's what I have (below). The "CopyCourseID" is the id of the course that is copied to the new row, although the new row will have a different course ID ("CourseID"). ---------------------------------------------------------------
strCourseID=Request.Form("CourseID") Insert table_a(CourseID,Name,Address) Values(strCourseID) Select Name, Address From table_a Where Course ID = Request.Form("CopyCourseID") ------------------------------------------------------------------
Thanks, Louis
On May 12, 3:27 pm, "Roy Harvey (SQL Server MVP)"
<roy_har...@snet.netwrote:
You can simply include the value in the SELECT list. A simplified
version, using constants, though you would use values from your
application.
INSERT table_a(CourseID,Name,Address)
SELECT 1234, Name, Address
FROM table_a
WHERE Course ID = 5678
Roy Harvey
Beacon Falls, CT
On Mon, 12 May 2008 12:38:51 -0700 (PDT), ll <barn104_1...@yahoo.com>
wrote:
I'm working on a way to copy most data columns from another row in the
same table to a new row and insert the courseID value from the form
that executes this action (the copy). Is it possible to have both
"values" and "select" in the same Insert Into statement?
Here's what I have (below). The "CopyCourseID" is the id of the
course that is copied to the new row, although the new row will have a
different course ID ("CourseID").
---------------------------------------------------------------
strCourseID=Request.Form("CourseID")
Insert table_a(CourseID,Name,Address)
Values(strCourseID)
Select Name, Address
From table_a
Where Course ID = Request.Form("CopyCourseID")
------------------------------------------------------------------
Thanks,
Louis
Thanks so much! This worked great.
Much appreciated,
Louis This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: PT |
last post by:
I got a problem. And thats.....
First of all, I got these three tables.
------------------- ------------------ ----------------------
tblPerson tblPersonSoftware ...
|
by: Richard |
last post by:
Hi,
I have a form based on a table. When I filter the form I want to run a
report based on the same table with the same filter as the form. No problem
until I want to filter a combo box where...
|
by: Ryan McLean |
last post by:
Hi everyone! What is happening is the method: sub_btnSubmitClicked is
being executed every time any other object with a Handler is executed.
I am trying not to use the withevents and handles...
|
by: Junior |
last post by:
Hi All,
I haven't got a response for this question lately and i really need to
get this done ASAP.
I have a .aspx page that has table two column four rows on it.
1. How do i use codebehind C#...
|
by: srneu71 |
last post by:
I have a project that requires a dynamically generated matrix table.
The table is setup with 4 quadrants (N,S,E,W) with checkboxes to "link"
the data in adjacent quadrants. The table has to be...
|
by: Hemang Shah |
last post by:
I think what i'm trying to do is passing by value.
Here is the scenario:
Main Form - which calls a Search form.
- I pass Mainform as a reference so that I can pass data between the two.
Code:...
|
by: Nirmala123 |
last post by:
hi...
I want to sort the table using combobox values. I give the code here.
address.html:
<html>
<head>
<title>Add a new entry</title>
</head>
|
by: omerbutt |
last post by:
AJAX PROB WITH MULTIPLE RECORDS
helo iam having problem in ma code will any body look out an help, i am trying t add sale record in the database and the checkthe quantity of the part slod and...
|
by: thatcollegeguy |
last post by:
Below are my 3php and 2js files.
I create a table using ajax/php and then want to change the values in the tables add(+ number for teamid) id's for each specific td in the table. I don't know...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |