[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 790
  • Last Modified:

MSSQL 2008 Express Stored Procedure Migrating MSSQL 2005

im transferring my project from development to production. before starting my project, i did not check my development and production is not same anyway.  My production is MSSQL 2005 and my Development is 2008. i Wrote some stored procedures some im able to transfer some are giving error.

USE [Registration]
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[createUser]
    @firstName varchar(50),
	@lastName varchar(50),
	@emailAddress varchar(50),
	@UserName varchar(50),
	@passWord varchar(50),
	@userType varchar(50),
	@id				INT	= NULL OUT


	
AS 

BEGIN

	IF EXISTS (SELECT * FROM [TBL_ADMINUSER] WHERE ADEMAIL = @EMAILADDRESS)
	SET @ID = -1
	ELSE
	


	insert into tbl_AdminUser
        (ADFirstName,ADLastName,ADEmail,ADUserID,ADPassword,ADUserType,ADUserStatus,ADLastLogin)
	values
		(@firstName,@lastName,@emailAddress,@UserName,@passWord,@userType,'True',getdate())
		 SET @id = SCOPE_IDENTITY();
END

Open in new window



ERROR

Msg 137, Level 15, State 2, Procedure createUser, Line 17
Must declare the scalar variable "@EMAILADDRESS".
Msg 137, Level 15, State 1, Procedure createUser, Line 18
Must declare the scalar variable "@ID".

Open in new window

0
xeondxb
Asked:
xeondxb
1 Solution
 
onlyamir007Commented:
it look like you're  installation case sensitive.....

USE [Registration]
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[createUser]
    @firstName varchar(50),
      @lastName varchar(50),
      @emailAddress varchar(50),
      @UserName varchar(50),
      @passWord varchar(50),
      @userType varchar(50),
      @id                        INT      = NULL OUT


      
AS

BEGIN

      IF EXISTS (SELECT * FROM [TBL_ADMINUSER] WHERE ADEMAIL = @emailAddress) /*  change this ... @EMAILADDRESS */
      SET @id       = -1
      ELSE
      


      insert into tbl_AdminUser
        (ADFirstName,ADLastName,ADEmail,ADUserID,ADPassword,ADUserType,ADUserStatus,ADLastLogin)
      values
            (@firstName,@lastName,@emailAddress,@UserName,@passWord,@userType,'True',getdate())
             SET @id = SCOPE_IDENTITY();
END
0
 
xeondxbAuthor Commented:
yes true my installation is case sensitive .... it is working :)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now