Jhovyn Marcos
asked on
PHP - How to insert data using sqlsrv on stored procedure?
Good Day! Do you have any basic tutorials or idea on "How to insert data using SQLSRV on stored procedure?"..I did search on this but no luck..
Please help me :(
Please help me :(
Search:
What is SQLSRV? SQL Server?
If so, explain why do you need a stored procedure and not a simple INSERT command?
If so, explain why do you need a stored procedure and not a simple INSERT command?
Here is a simple Stored Procedure that inserts data. Please provide more information
CREATE PROCEDURE dbo.InsertExample
@data1 VARCHAR(30) = NULL ,
@data2 VARCHAR(30) = NULL
AS
BEGIN
SET NOCOUNT ON
INSERT INTO dbo.SomeData
(
Data1 ,
Data2
)
VALUES
(
@data1 ,
@data2
)
END
GO
ASKER
What is SQLSRV? SQL Server?Yes sir..PHP to SQL via sqlsrv on stored procedure approach
Ok. Now the 2nd part of my question:
"explain why do you need a stored procedure and not a simple INSERT command? "
"explain why do you need a stored procedure and not a simple INSERT command? "
ASKER
Thank you sir @Vitor Montalvão
Because I need to do some UPSERT(Update Insert) using sqlsrv wich is not availbale in ms sql...I do search some of these but it was very complex for me..Unlike mysql there is ON DUPLICATE KEY used for UPSERT...
"explain why do you need a stored procedure and not a simple INSERT command? "
Because I need to do some UPSERT(Update Insert) using sqlsrv wich is not availbale in ms sql...I do search some of these but it was very complex for me..Unlike mysql there is ON DUPLICATE KEY used for UPSERT...
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.