[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

MSSQL 2008 Express Stored Procedure Migrating MSSQL 2005

Posted on 2013-12-26
2
Medium Priority
?
782 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 2000 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

656 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