SQLServer2005出現(xiàn)的游標(biāo)錯誤的解決方法

字號:

中文錯誤信息:此游標(biāo)不包括正在修改的表,或該表不能通過此游標(biāo)更新。
    英文錯誤信息:The cursor does not include the table being modified or the table is not updatable through the cursor.
    其原因是由于計算機名和sql server 2005的servername不一致所致。
    解決方法:
    先執(zhí)行
    select @@servername
    查看數(shù)據(jù)庫中的servername
    然后執(zhí)行:
    sp_dropserver ’old_name’
    go
    sp_addserver ’new_name’, local
    其中old_name為select @@servername語句的結(jié)果,new_name為主機名