Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 9th, 2004, 11:04 AM
Registered User
 
Join Date: Dec 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Upgrade from SQL7 to SQL2000 - Problem with an SP

Hi,

I have upgraded a database to SQL 2000 from SQL7. I have a VB 6.0 application developed by a 3rd party (i.e. no source code) that uses this database.

The app uses ADODB for ODBC conncetivity.

My problem is that when the app calls the following stored procedure

exec dp_repCrestSearch N'01 Jan 2001', N'01 Jan 2003', '0307295', 'OAT02KOB1859%', -1
this works fine in the existing SQL7 database, however, nothing is returned when I run it SQL2000

I turned on SQL Profiler and found that the following was occurring when the SP was executed

exec dp_repCrestSearch N'01 Jan 2001

All the other parameters have been dropped. I used a network analyser to see what was in the packet sent from the workstation to the Server and all the data was correct.

I would appreciate it if anybody could provide some insight to this.

Thanks in advance

 
Old December 9th, 2004, 08:56 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

Can you post your store procedure?

Jaime E. Maccou
 
Old December 10th, 2004, 05:20 AM
Registered User
 
Join Date: Dec 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here you go

CREATE procedure dp_repCrestSearch @start varchar(15),
                    @end varchar(15),
                    @sedol varchar(7),
                    @Ref varchar(20),
                    @abs varchar(20),
                    @debug int = 0
as
begin

set nocount on

declare @retVal int,
    @sql varchar(255),
    @where varchar(255),
    @rows int

    select @sql = '', @where = ''

    select @sql = "select 1 'tranid', 1 'id', itemNo,settleDate,settleDateTime,subDepot,subDepot Acc,ISIN,sedol,externalRef,internalRef,DC,qty,netQ ty,credit,debit,cpty,balanceType,escrowAgent,escro wAccId,dropNo,IntendSettDate from crest "

    if charindex('%',@sedol) > 0 and datalength(@sedol) > 1
    begin
        select @where = " sedol LIKE '" + @sedol + "' "
    end
    else if @sedol <> '%'
    begin
        select @where = " sedol = '" + @sedol + "' "
    end

    if charindex('%',@ref) > 0 and datalength(@ref) > 1
    begin
        if @where <> '' select @where = @where + ' AND '
        select @where = @where + " (externalref LIKE '" + @ref + "' OR internalref LIKE '" + @ref + "') "
    end
    else if @ref <> '%'
    begin
        if @where <> '' select @where = @where + ' AND '
        select @where = @where + " (externalref = '" + @ref + "' OR internalref = '" + @ref + "') "
    end

    if convert(decimal(16,4),@abs) >= 0
    begin
        if @where <> '' select @where = @where + ' AND '
        select @where = @where + " qty = " + @abs + " "
    end

    if @where <> '' select @where = @where + ' AND '
    select @where = " WHERE " + @where + " settledate between '" + @start + "' AND '" + @end + "' "

    if @debug <> 0 select @sql
    if @debug <> 0 select @where

    if @debug <> 5 exec (@sql + @where + ' order by settledate')
    select @retVal = @@error, @rows = @@rowcount

    drop table #rep

    return @retVal
end

GO







Similar Threads
Thread Thread Starter Forum Replies Last Post
Access Problem From Upgrade WinNt -> 2003 BrianWren Internet Information Services 0 March 22nd, 2007 11:39 AM
database concurreny problem with vb6 and sql2000 shamimbd17 SQL Server 2000 0 August 21st, 2006 06:03 AM
Access 2000 & 2002 upgrade problem brianharding Access 4 May 3rd, 2004 04:55 AM
Problem with dates in VB6 to SQL7 chiefouko Pro VB Databases 1 June 26th, 2003 05:11 PM
Problem with Dates From VB6 to SQL7 chiefouko VB Databases Basics 2 June 23rd, 2003 10:12 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.