Solved

MSSQL 2008 Express Stored Procedure Migrating MSSQL 2005

Posted on 2013-12-26
2
732 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

749 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