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.
Author |
Topic |
christer100
Starting Member
6 Posts |
Posted - 2005-11-13 : 09:33:07
|
I am getting this error on MSDE SP4, but it is working on SQL 2000 Standard/Developer/Enterprise SP3A. Invalid object name 'getType'.DECLARE @v_accrec VARCHAR(10),@v_type VARCHAR(10),@v_old_accrec VARCHAR(10),@v_string VARCHAR(400),@v_ml VARCHAR(10) UPDATE ACCOUNTINFOSET TYPEML=''set @v_ml= (SELECT MLTYPEFROM dbo.ProgramConf) DECLARE c1 CURSOR FOR SELECT rec2,typeFROM getType(@v_ml) aORDER BY a.rec2OPEN c1SET @v_old_accrec = 0SET @v_accrec = 0SET @v_type = ''SET @v_string = ''FETCH NEXT FROM c1 INTO @v_accrec, @v_typeWHILE @@FETCH_STATUS = 0BEGINIF (@v_old_accrec != @v_accrec)BEGINUPDATE AccountInfo SET typeml = case when @v_string is not null then substring(@v_string, 1, len(@v_string) - 1) else NULL endWHERE accrec = @v_old_accrecSET @v_string = '' SET @v_string = @v_string + @v_type + '|'SET @v_type = ''SET @v_old_accrec = @v_accrecSET @v_accrec = 0ENDELSEBEGINSET @v_string = @v_string + @v_type + '|'ENDFETCH NEXT FROM c1 INTO @v_accrec, @v_typeENDUPDATE AccountInfo SET typeml = case when @v_string is not null then substring(@v_string, 1, len(@v_string) - 1) else NULL endWHERE accrec = @v_old_accrecCLOSE c1DEALLOCATE c1 |
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2005-11-13 : 10:31:15
|
What's getType.Is it a udf that you need to create on oyur new system?==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
|
|
christer100
Starting Member
6 Posts |
Posted - 2005-11-13 : 15:56:23
|
No, it is not a user definined function. I don't know where it is coming from, but apparently it is somewhere in SQL 2000, but not in MSDE. Could it be a system function just like getDate(), but where is it stored so I can copy it to MSDE. It is not a user defined function and I have never created it in the first place. It just exists in SQL 2000 but not MSDE. I have tried 2 different SQL 2000 servers and two different MSDE servers and the same problem on MSDE (but not SQL 2000) |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2005-11-13 : 16:58:36
|
It's not a system function. It's a method on some objects but not a tsql statement.On the database where it works tryselect * from sysobjects where name = 'getType'sp_helptext getType==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
|
|
christer100
Starting Member
6 Posts |
Posted - 2005-11-13 : 22:26:45
|
Thanks, I figured out. |
|
|
|
|
|
|
|