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

字號(hào):

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