How can i change collation for a table function

  • Hi guys,

    I know table functions inherit the collation setting of the actual columns, I am wondering if there is a way to change collation for table functions without dropping and re-creating it.

    Thanks

  • Specify the COLLATE clause, either on the select or on the definition of the table.

    Without seeing at least the form of the function in question, I can't really be more specific.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thanks for the reply, what I have is just a database which the collation settings requires changing, because the table functions needs to be recompiled in order to reflect the new collation thats why the alter database collate command fails.

    The workaround so far is to drop the function, alter table collate statement, then alter database collation settings and re-create the functions back.

    I dont want to specify collate within the code as that would be changing the schema and hardcoding collation which i dont want to do, i want to maintain db default.

    Thanks

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply