Hi , i want to insert value into table in stored procedure and return true or false based n condition
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE spx_CheckUserAvailability
@UserName VARCHAR(50)
AS
BEGIN
SET NOCOUNT ON;
IF NOT EXISTS
(SELECT * FROM Users
WHERE UserName = @UserName
)
SELECT 'true'
ELSE
SELECT 'false'
END
GO
If output is true then it insert into user table as username into users table and then return true else false