question

rudrapbiswas avatar image
rudrapbiswas asked

How to add a persisted computed column

I have a requirement to add a persisted computed column to a table having 138 million of records. My questions are: 1. When I am trying to add the column, it's throwing me the below error: Msg 1935, Level 16, State 1, Line 1 Cannot create index. Object 'table_name' was created with the following SET options off: 'ANSI_NULLS'. 2. How can I update existing data with minimum table lock/block. Thanks in advance, --Rudra
computed-column
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
ThomasRushton avatar image
ThomasRushton answered
According to [Books On Line - SET Options that affect results][1], your column needs to be created in a way that will provide consistent results across all connections. The article mentions the various settings that need to be in place before you an create computed columns. See also [BOL - Indexes on Computed Columns][2] So this means that your computed column was attempted by a connection that didn't have those settings configured in the appropriate way. Check your connection settings. [1]: http://msdn.microsoft.com/en-us/library/ms175088.aspx [2]: http://msdn.microsoft.com/en-us/library/ms189292.aspx
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.