Ask a Question related to Dreamweaver AppDev, Design and Development.
-
RobGT #1
SQL: Inserting data from table1 with static data into table 2
Hi,
I'm trying to create an SP in SQL Server 2000 that will read in a load of
row values and insert them, along with two static values, into another
table.
I can't get my head to work right at the moment either, which isn't helping
:)
Here's what I have, which obviously doesn't work - any suggestions
appreciated.
CREATE PROCEDURE dbo.spIssues
@UserID int
AS
BEGIN
INSERT INTO t1 (ID, OtherID, MainValue)
VALUES (1272, 5, (SELECT MainValue
FROM t2
WHERE t2.ID = 1272)
)
END
GO
There must be an easy way to do this, I just can't think straight at the
moment!
Any help appreciated...
Cheers,
Rob
RobGT Guest
-
UPDATE table2 using table1 data
Using 4.0.20a-nt on Win2K, but the query will eventually be run on a Linux box (not sure what MySQL version). I'm trying to pull DISTINCT... -
How to take data out of table, restructure the table and then put the data back in
Hi All Wonder if you could help, I have a bog standard table called STOCKPRICES that has served me well for a while, but now I need to change the... -
static data access
hi, I have a static class for data access. what if i declare some private attribute like this. private static constr =... -
Inserting data into a table
I am quite new to all this but am trying to create a database driven site. I have been able to use information from my sample database but I now... -
Inserting into one table data from 2 tables and some input data.
Alrighty, I pull records from a database table onto a page based on vendor #. On this page I have an input box after each row of data that is just... -
Julian Roberts #2
Re: Inserting data from table1 with static data into table 2
You need to clear you mind of clutter :)
INSERT INTO t1 (ID, OtherID, MainValue)
SELECT 1272,5, MainValue
FROM t2
WHERE t2.ID = 1272
--
Jules
[url]http://www.charon.co.uk/charoncart[/url]
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004
Julian Roberts Guest
-



Reply With Quote

