Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 Upgrade from 2000 to 2008 has some issues

Author  Topic 

clay_mckinney
Starting Member

14 Posts

Posted - 2008-12-01 : 18:24:18
Hi there. One of my clients upgraded from SQL 2000 to 2008 about a month ago. Mostly everything worked, but there are some wierd issues. This one's had me scratching my head all day. I have a stored procedure:



ALTER PROCEDURE [dbo].[usp_UpdateEmployee]
/* Public */
@EmployeeID int,
@FirstName nvarchar(20),
@MI nvarchar(1) = NULL,
@LastName nvarchar(25),
@NickName nvarchar(25) = NULL,
@EmployeeTitle nvarchar(100),
@EWorkPh nvarchar(25) = NULL,
@EmailAddress nvarchar(30) = NULL,
@DeptID nvarchar(7),
@InstructorID bit = 0,
@LLInstructorID bit = 0,
@MInstructorID bit = 0,
@AmbassadorID bit = 0,
@EagleSquadID bit = 0,

/* Private */
@LoginName nvarchar(50),
@EmployeeTypeID tinyint,
@ActiveID bit = 0,
@HourlyID bit = 0,
@IsSD bit = 0,
@SDID int,
@DateOfBirth smalldatetime,
@GenderID bit = 0,
@Address1 nvarchar(40),
@Address2 nvarchar(40) = NULL,
@City nvarchar(35),
@State nvarchar(2),
@Province nvarchar(40) = NULL,
@Zip nvarchar(14),
@Country nvarchar(50),
@EHomePh nvarchar(25) = NULL,
@EPagerPh nvarchar(25) = NULL,
@PagerPin nvarchar(14) = NULL,
@ECellPh nvarchar(25) = NULL,
@DateOfHire smalldatetime

AS
BEGIN
UPDATE dbEmployeePublic.dbo.tblEmployeesPublic
SET
nvcEmpFirstName = @FirstName,
nvcEmpMI = @MI,
nvcEmpLastName = @LastName,
nvcEmpNickName = @NickName,
nvcEmpTitle = @EmployeeTitle,
nvcEmpWorkPhone = @EWorkPh,
nvcEmpEmailAddress = @EmailAddress,
nvcEmpDepartmentID = @DeptID,
bitEmpIsInstructor = @InstructorID,
bitEmpLLInstructor = @LLInstructorID,
bitEmpMUInstructor = @MInstructorID,
bitEmpIsAmbassador = @AmbassadorID,
bitIsEagleSquadron = @EagleSquadID

WHERE
intEmployeeID = @EmployeeID

UPDATE dbEmployeePrivate.dbo.tblEmployeesPrivate
SET
nvcEmpLoginID = @LoginName,
intEmployeeType = @EmployeeTypeID,
bitEmpIsActive = @ActiveID,
bitEmpIsHourly = @HourlyID,
bitEmpIsSeniorDirector = @IsSD,
intEmpSeniorDirectorID = @SDID,
sdtEmpDOB = @DateOfBirth,
bitEmpGender = @GenderID,
nvcEmpAddress1 = @Address1,
nvcEmpAddress2 = @Address2,
nvcEmpCity = @City,
nvcEmpState = @State,
nvcEmpProvince = @Province,
nvcEmpZip = @Zip,
nvcEmpCountry = @Country,
nvcEmpHomePhone = @EHomePh,
nvcEmpPager = @EPagerPh,
nvcEmpPagerPin = @PagerPin,
nvcEmpCellular = @ECellPh,
sdtEmpDOH = @DateOfHire

WHERE
intEmployeeID = @EmployeeID

END


This used to work in 2000, but now it doesn't in 2008. The first UPDATE statement still works, but the second UPDATE doesn't. Both databases referenced are in the same SQL Server Instance. The first UPDATE references the same database that the stored procedure lives in.

I've read tons of documentation today, Googled everything I could think of, and stared at the code for hours. Can you help?

- Clay McKinney

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-12-01 : 18:42:05
What error do you get?
Go to Top of Page

clay_mckinney
Starting Member

14 Posts

Posted - 2008-12-01 : 19:13:34
I don't get an error. It acts like it did something, but in fact it completely ignores the second UPDATE.

- Clay McKinney
Go to Top of Page

clay_mckinney
Starting Member

14 Posts

Posted - 2008-12-01 : 20:12:44
Ok, you were right. I wasn't getting an error from my web page code, but when I put a test together for a Management Studio Query window, it told me that execution was halted because a trigger on the table updated by the second UPDATE was trying to use xpsendmail which is disabled by default. I disabled the trigger (for now) and now it works. Thanks!

- Clay McKinney
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-12-01 : 23:08:38
Nice!!! that it was pointed in error .
Go to Top of Page

tomjerryduck
Starting Member

2 Posts

Posted - 2008-12-10 : 19:28:15
Clay,

Can you please tell me what are the important things to keep in mind while doing the SQL 2000 to SQL 2008 Upgrade testing as a QA\Tester.

Thanks,
Tom
Go to Top of Page
   

- Advertisement -