Thanks Thom,
Interestingly it did find two columnsname name collation_name
tblAlarmHistory AlarmMessage SQL_Latin1_General_CP1_CI_AS
tblAlarmHistory Note SQL_Latin1_General_CP1_CI_AS
As I Said earlier the stored procedure that errorsos is created 'on the fly'as part of the changing containment level process. The good thing is that either as a result of the error or not bothering the stored procedure is left behind. so I though just for fits and giggles lets have a look at what it contains
CREATE PROCEDURE apspuRackUpNextUsed
AS
BEGIN
declare @tablecnt integer
declare @tablename char(30)
declare @keyfields char(128)
declare @nexttablestr nvarchar(4000)
declare @tablecode int
declare tnames_cursor cursor for
select
rt.tablename, rt.keyfields, rt.tablecode
from
dbo.tblRosterTable rt,
sysobjects o,
syscolumns c
where
upper(o.Name) = upper(rt.TableName) and
upper(c.Name) = upper(rt.KeyFields) and
o.id = c.id and
c.type <> 61 and
o.id = object_id(o.name)
open tnames_cursor
set @TableCnt = 0
fetch next from tnames_cursor into @tablename, @keyfields, @tablecode
while (@@fetch_status <> -1) and @tablecnt < 1000
begin
if (@@fetch_status <> -2)
begin
set @tablecnt = @Tablecnt + 1
set @nexttablestr = 'if ((select max(' + rtrim(@KeyFields) + ') from ' + rtrim(@tablename) + ') > (select LastKey from tblRosterTable where TableCode = ' + CAST(@tablecode AS varchar(12)) + '))'
set @nexttablestr = @nexttablestr + N' update dbo.tblRosterTable set LastKey = (10 + (select max(' + rtrim(@KeyFields) + ') from ' + rtrim(@tablename) + ')) where TableCode = ' + CAST(@tablecode AS varchar(12))
execute sp_executesql @nexttablestr
end
fetch next from tnames_cursor into @tablename, @keyfields, @tablecode
end
deallocate tnames_cursor
END
Not sure if it helps though as neither of the two tables with the alternative collation are in the procedure, in fact it doesn't help as executing the procedure as it exists doesn't cause any errors, so I think it's when it is trying to create procedure for the next object??