Hi! I have a problem when i implement your codes..
the stored procedure seems not be working..
the error is unable to save the project because the statement type is not supported. it must begin with CREATE or ALTER
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 Staff
WHERE UserName = @UserName
)
SELECT 'true'
ELSE
SELECT 'false'
END
GO
so, i decided to change it.. but i still have a problem...
the error is invalid object name
the readjusted code is
ALTER PROCEDURE [dbo].[CheckUserAvailability]
@Username VARCHAR(50)
AS
BEGIN
SET ANSI_NULLS ON;
SET QUOTED_IDENTIFIER ON;
SET NOCOUNT ON;
IF NOT EXISTS
(SELECT * FROM Staff
WHERE UserName = @UserName
)
SELECT 'true'
ELSE
BEGIN
SELECT 'false'
END
END