Solved

MSSQL 2008 Express Stored Procedure Migrating MSSQL 2005

Posted on 2013-12-26
2
698 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
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…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

746 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

12 Experts available now in Live!

Get 1:1 Help Now