2016-06-09 66 views

回答

1

我沒有SQL Server 2000的實例,所以無法測試結果。 我發現的唯一的解決辦法是檢查與

OBJECTPROPERTY(object_id,'ExecIsQuotedIdentOn') 

例如:

SELECT 
    SCHEMA_NAME(s.schema_id) + '.' + s.name AS name, 
    s.create_date, 
    s.modify_date, 
    OBJECTPROPERTY(s.object_id,'ExecIsQuotedIdentOn') AS IsQuotedIdentOn 
FROM sys.objects s 
WHERE 
    s.type IN ('P','TR','V','IF','FN','TF') 
    AND OBJECTPROPERTY(s.object_id,'ExecIsQuotedIdentOn') = 0 
ORDER BY SCHEMA_NAME(s.schema_id) + '.' + s.name DESC 

希望這有助於。

0

我了信貸,但安德烈的人誰需要在2000上運行這個地方(SYSOBJECT不存在sys.objects中等等),這是工作的代碼:

SELECT 
    s.name AS name, 
    OBJECTPROPERTY(s.id,'ExecIsQuotedIdentOn') AS IsQuotedIdentOn 
FROM sysobjects s 
WHERE 
    s.type IN ('P','D', 'K','S','U','V') 
    AND OBJECTPROPERTY(s.id,'ExecIsQuotedIdentOn') = 1 
ORDER BY s.name DESC 
相關問題