M
martinharvey via DotNetMonster.com
This is probably a very simple question but i am having problems with a
stored procedure syntax.
I want to insert fields with preset values (DateCreated/OrderVerified)
and two values (Name/ Address1) from a databletable called
"Customer" and insert both of these into a datatable called "Orders"
I have tried the following syntax but it is not working. Can anyone tell me
where i am going wrong
CREATE PROCEDURE SP_CreateOrder
(@CustomerID Varchar(50))
AS
INSERT INTO Orders (DateCreated, Verified)
VALUES ( GETDATE(), 0,)
AND INSERT Into Orders (Name, Address)
SELECT (Customer.Name, Customer.Address)
FROM Customer
WHERE CustomerID = @CustomerID
Many thanks martin
stored procedure syntax.
I want to insert fields with preset values (DateCreated/OrderVerified)
and two values (Name/ Address1) from a databletable called
"Customer" and insert both of these into a datatable called "Orders"
I have tried the following syntax but it is not working. Can anyone tell me
where i am going wrong
CREATE PROCEDURE SP_CreateOrder
(@CustomerID Varchar(50))
AS
INSERT INTO Orders (DateCreated, Verified)
VALUES ( GETDATE(), 0,)
AND INSERT Into Orders (Name, Address)
SELECT (Customer.Name, Customer.Address)
FROM Customer
WHERE CustomerID = @CustomerID
Many thanks martin