lyric0n
Technical User
- Dec 28, 2005
- 74
Hello,
I would like to pass 3 variables to a Stored Procedure, then query a table on one of those variables, and if there are no results in that table, then insert the data, if there is data, I need to update the data. I have pasted what I have below but ran into issues checking my results, any help is appreciated.
Thanks,
Chris
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE dbo.SP
@IPAddr Varchar(50),
@Int Varchar(50),
@MACAddr Varchar(50)
AS
BEGIN
SELECT MACAddr FROM dbo.Table WHERE MACAddr = '@MACAddr'
--Here is where I draw a blank...
END
GO
I would like to pass 3 variables to a Stored Procedure, then query a table on one of those variables, and if there are no results in that table, then insert the data, if there is data, I need to update the data. I have pasted what I have below but ran into issues checking my results, any help is appreciated.
Thanks,
Chris
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE dbo.SP
@IPAddr Varchar(50),
@Int Varchar(50),
@MACAddr Varchar(50)
AS
BEGIN
SELECT MACAddr FROM dbo.Table WHERE MACAddr = '@MACAddr'
--Here is where I draw a blank...
END
GO