By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,265 Members | 1,333 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,265 IT Pros & Developers. It's quick & easy.

SPs from SQL 2000 to SQL 2005

P: 1
Okay, I've spent the last day working on moving our SQL 2000 to SQL 2005 data over. My last step was to test our web application. Well, no one could login. I am using a stored procedure and have narrowed it down to it. What's happening is that I am passing 3 strings and of course comparing them to the DB. Well, I had it return the values passed and they would all be truncated to 1 char long even though I have them as varchar(15).

Here's my test SP:

/****** Object: Stored Procedure dbo.Login Script Date: 3/27/01 2:35:01 PM ******/
CREATE PROCEDURE TESTLogin
@arg_strUsername nvarchar(15) = NULL,
@arg_strPassword nvarchar(15) = NULL,
@arg_strDirectingURL nvarchar(255) = NULL
AS
SET NOCOUNT ON

DECLARE @intUserID int
DECLARE @intPrivilegeID int
DECLARE @intPartnerID int
DECLARE @strPartnerName varchar(40)
DECLARE @strPassword varchar(15)
DECLARE @strDirectingURL varchar(255)

SELECT @strPassword = l.Password, @intUserID = l.UserID, @intPrivilegeID = u.PrivilegeID
FROM Logon l
JOIN Users u ON u.UserID = l.UserID
WHERE l.Username = @arg_strUsername

IF @strPassword = @arg_strPassword
BEGIN
IF @intPrivilegeID = 1
BEGIN
SELECT @intPartnerID = NULL, @strPartnerName = NULL, @strDirectingURL = DirectingURL
FROM Users
WHERE UserID = @intUserID

SELECT @intUserID AS UserID, @arg_strUsername As UserName, @arg_strPassword As Password, @arg_strDirectingURL As UDURL, @strDirectingURL As DURL
END

IF @arg_strDirectingURL LIKE @strDirectingURL
BEGIN
UPDATE Users
SET LastLoginDate = GETDATE()
WHERE UserID = @intUserID

SELECT @intUserID AS UserID, @intPrivilegeID AS PrivilegeID, @intPartnerID AS PartnerID, @strPartnerName AS PartnerName
END
END
ELSE
BEGIN
SELECT @arg_strUsername, @arg_strPassword As INPass, @arg_strDirectingURL As INURL
END
May 11 '06 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.