title: Default constraint with synonym or UDF from other database
body: <p>Is it possible to add default constraint with synonym or UDF from other database?</p>
  
  <pre><code>Create table TestTable (
  ID int identity(1,1), 
  SData varchar(100), 
  UserName varchar(100) default [OtherDatabaseName].dbo.fn_Test('value'))
  </code></pre>
  
  <p>Below is the error message, while I am trying to add default constraint</p>
  
  <blockquote>
    <p>The name "OtherDatabaseName" is not permitted in this context. Valid
    expressions are constants, constant expressions, and (in some
    contexts) variables. Column names are not permitted.</p>
  </blockquote>
  
  <p>We can add UDF from same database but I want add UDF from other database. Because it is used in multiple databases on same server.</p>
  
  <p>And I do not want to create that UDF in all database and prevent duplicate code.</p>
  
  <p>Please let me know if there is any other/better way. Thank you.</p>