Solved

MSSQL 2008 Express Stored Procedure Migrating MSSQL 2005

Posted on 2013-12-26
2
709 Views
Last Modified: 2013-12-26
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
Comment
Question by:xeondxb
2 Comments
 
LVL 4

Accepted Solution

by:
onlyamir007 earned 500 total points
ID: 39739753
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
 

Author Closing Comment

by:xeondxb
ID: 39739754
yes true my installation is case sensitive .... it is working :)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now