Update user-defined function used by computed column

jstangroomejstangroome Posts: 26
edited October 3, 2006 5:05PM in SQL Compare Previous Versions
We have a table containing a computed column that uses an expression calling a scalar user-defined function.

When we alter our user-defined function we temporarily change the table's computed column expression to (0) or ('') as appropriate for the column data type. We can then alter the user-defined function without dependency errors and then change the table's computed column back to the original expression.

SQL Compare 5.1 apparently cannot currently handle altering user-defined functions in use by computed columns. Perhaps SQL Compare could use the temporary column expression method above or atleast report this dependency as a warning in the Synchronize wizard.

Thanks,

- Jason

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 New member
    Having a computer column based on a UDF has been tested and should work perfectly. Maybe if you can post the UDF code, we can see if the problem reveals itself?
  • I've just remembered that the computed column is persisted and has an index on it. Could this be causing problems?

    The UDF itself is quite boring. It takes a few varchar parameters as input and performs some string manipulation to return a varchar result.

    - Jason
  • Brian DonahueBrian Donahue Posts: 6,590 New member
    Following up it seems SQL Compare (5.2) still has a problem synchronizing a view when a column in the view is taken from a table's column that uses a UDF or UDT. This could be responsible for the problem.
Sign In or Register to comment.