Upgrade SQL Server 2008 from Std to r2, web app no longer working correctly - why?

  • I have a web application that was developed using sql express. Once complete, this application was loaded onto a Windows server 2008 standard, SQL Server 2008 developers edition server and is working fine.

    I purchased some better hw/sw and now have a server running Windows server 2008 Enterprise R2, SQL Server 2008 Enterprise R2,

    and the application now has some weird errors.

    When i do a record search via the web app, each time i press the enter button i get a different result!

    Everything work fine on the old server.

    Any ideas?

    Thanks

    Old Working Server details

    Microsoft SQL Server Management Studio10.0.2531.0

    Microsoft Analysis Services Client Tools10.0.1600.22

    Microsoft Data Access Components (MDAC)6.0.6002.18005

    Microsoft MSXML3.0 4.0 5.0 6.0

    Microsoft Internet Explorer8.0.6001.18928

    Microsoft .NET Framework2.0.50727.4200

    Operating System6.0.6002

    New Non-working Server details

    Microsoft SQL Server Management Studio10.50.1600.1

    Microsoft Analysis Services Client Tools10.50.1600.1

    Microsoft Data Access Components (MDAC)6.1.7600.16385

    Microsoft MSXML3.0 5.0 6.0

    Microsoft Internet Explorer8.0.7600.16385

    Microsoft .NET Framework2.0.50727.4927

    Operating System6.1.7600

  • There is no way to say without seeing the code that is failing. Without that I would guess that you have search queries without ORDER BY in it that return a subset of data (i.e. TOP 250); without the ORDER BY the data returned would be random.

  • declare @Query as varchar(8000)

    declare @Name as varchar(250)

    declare @Name1 as varchar(250)

    declare @Stateid as int

    declare @CityId as int

    declare @Industryid as int

    declare @Degree as varchar(250)

    declare @Skillsid as int

    declare @FutureSkillsid as int

    declare @ExpectedSalary as int

    declare @Position as varchar(250)

    declare @Phrase as int

    declare @fromRec as int

    declare @toRec as int

    set @Name = ''

    set @Name1 = ''

    set @Stateid = 32

    set @CityId = 0

    set @Industryid = 29

    set @Degree = 'Associate''''s Degree'

    set @Skillsid = 0

    set @FutureSkillsid = 0

    set @ExpectedSalary = 0

    set @Position = 'marketing manager'

    set @Phrase = 4

    set @fromRec = 1

    set @toRec = 10

    set @Query = 'Begin

    WITH Res AS

    (

    select top 10000 p.id as Id,p.regionid,p.cityid,p.countryid,

    (select top 1 i.id from industries i inner join workexperiences w on i.id = w.industryId where p.id = w.profileid) as IndustryId,

    (select top 1 pa.degree from profileacademics pa where p.id=pa.profileid) as degree,

    w.position,

    (select top 1 we.salaryminid from workexpectations we where we.profileid=p.id) as salaryminid,

    p.HomePhone,p.CellPhone,p.WorkPhone,p.PrimaryEmailAddress,p.SecondaryEmailAddress,

    isnull((select [Name] + '' '' from salutationtypes st

    where p.SalutationId=st.id),'''') + isnull(p.FirstName,'''') + '' '' + isnull(p.MiddleName + '' '','''') + isnull(p.LastName,'''') as UserName,

    ROW_NUMBER() OVER (ORDER BY p.id DESC) AS RowNumber

    from profiles p left outer join workexperiences w on w.ProfileId=p.id

    left outer join documents dc on p.id = dc.profileid

    where p.allowrecruiters=1 and dc.documentstatusid=1 '

    if (@Name <> '')

    Begin

    set @Query = @Query + ' and contains(dc.doccontent,''' + @Name1 + ''') '

    End

    if (@Position <> '')

    Begin

    if (@Phrase = 1)

    Begin

    set @Query = @Query + ' and contains(Position,''' + @Position + ''') '

    end

    else if (@Phrase = 2)

    Begin

    set @Query = @Query + ' and contains(Position,''' + @Position + ''') '

    end

    else if (@Phrase = 3)

    Begin

    set @Query = @Query + ' and contains(Position,''' + @Position + ''') '

    end

    else if (@Phrase = 4)

    Begin

    set @Query = @Query + ' and Position = ''' + cast(@Position as varchar(250)) + ''''

    end

    End

    set @Query = @Query + '),

    Resumes AS

    (

    SELECT p.id,

    p.UserName,

    isnull((select c.[Name] + '', '' from cities c where c.id=p.cityid),'''') +

    isnull((select r.[Name] + '', '' from regions r where r.id=p.regionid),'''') +

    isnull((select co.[Name] from countries co where co.id=p.countryid),'''') as Location,

    (select sum(endyear - startyear) from workexperiences w where w.ProfileId=p.id) as Experience,

    p.Position,

    (select w.Degree from profileacademics w where w.ProfileId=p.id and w.endyear = (select max(endyear) from profileacademics pa where pa.ProfileId = p.id)) as Degree,

    cast((select s.value from salaries s inner join workexpectations w on w.SalaryMinId = s.id where w.ProfileId=p.id ) as varchar(10)) + '' to '' +

    cast((select s.value from salaries s inner join workexpectations w on w.SalaryMaxId = s.id where w.ProfileId=p.id ) as varchar(10)) as Salary,

    (select i.name from industries i inner join workexperiences w on w.industryid = i.id where w.ProfileId=p.id and w.endyear = (select max(endyear) from workexperiences we where we.ProfileId = p.id)) as Industry,

    p.HomePhone,p.CellPhone,p.WorkPhone,p.PrimaryEmailAddress,p.SecondaryEmailAddress,

    ROW_NUMBER() OVER (ORDER BY p.id DESC) AS RowNumber

    FROM Res p

    WHERE 1=1 '

    if (@Stateid <>0)

    Begin

    set @Query = @Query + ' and p.regionid =' + cast(@Stateid as varchar(10))

    End

    if (@Industryid <>0)

    Begin

    set @Query = @Query + ' and p.IndustryId =' + cast(@Industryid as varchar(10))

    End

    if (@Degree <> '')

    Begin

    set @Query = @Query + ' and p.degree =''' + cast(@Degree as varchar(250)) + ''''

    End

    if (@ExpectedSalary <> 0)

    Begin

    set @Query = @Query + ' and p.salaryminid < ' + cast(@ExpectedSalary as varchar(10))

    End

    set @Query = @Query + ')

    select *,(select max(rownumber) from Resumes) as TotalCount from Resumes

    WHERE RowNumber BETWEEN ' + cast(@fromRec as varchar(10)) + ' AND ' + cast(@toRec as varchar(10)) +

    ' ORDER BY RowNumber ASC

    End

    '

    exec (@Query)

  • Could this happen with a faulty o/s installation?

    Thanks

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply