Deploy CLR UDF to a different SQL Schema

C

cpnet

I have written a SQL Server (2005) scalar UDF in VS 2005. When I deploy my
UDF, it always creates it in the dbo schema in my database. Is there a way
to have it deploy to a different schema?

I tried using

SqlFunctionAttribute(Name="[MySchema].[MyUDFName]")

but that leaves me with a UDF named

[dbo].[[MySchema].[MyUDFName]]

in SQL server.
 
C

Charles Wang [MSFT]

Hi cpnet,
Welcome to Microsoft MSDN Managed Newsgroup. My name is Charles Wang[MSFT].
It is my pleasure to work with you on this post.

Regarding this issue, it is by design. SQL CLR project does not provide a
way to specify a schema qulifier for a clr object. So the name you
specified in a CLR project is just for the function name not including the
schema name. You have to manually handle the schema issue in T-SQL. One
expert from our product team talked about this design issue in this forum
post:
http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/a8203317-3ca8-48
77-b06f-92fb4210d333

Hope this helps. Please do not hesitate to let me know if you have any
other questions or concerns. I will do my best to help.

Best regards,
Charles Wang
Microsoft Online Community Support
=========================================================
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: (e-mail address removed).
=========================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
=========================================================
 
C

Charles Wang [MSFT]

Hi cpnet,
Welcome to Microsoft MSDN Managed Newsgroup. My name is Charles Wang[MSFT].
It is my pleasure to work with you on this post.

Regarding this issue, it is by design. SQL CLR project does not provide a
way to specify a schema qulifier for a clr object. So the name you
specified in a CLR project is just for the function name not including the
schema name. You have to manually handle the schema issue in T-SQL. One
expert from our product team talked about this design issue in this forum
post:
http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/a8203317-3ca8-48
77-b06f-92fb4210d333

Hope this helps. Please do not hesitate to let me know if you have any
other questions or concerns. I will do my best to help.

Best regards,
Charles Wang
Microsoft Online Community Support
=========================================================
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: (e-mail address removed).
=========================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
=========================================================
 
C

Charles Wang [MSFT]

Dear cpnet,
Good morning!

I am writing to check what everything is going on regarding this issue.If
you have any other questions or concerns, please do not hesitate to let me
know. I will do my best to help.

Thank you!

Best regards,
Charles Wang
Microsoft Online Community Support
=========================================================
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: (e-mail address removed).
=========================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
=========================================================
 
C

Charles Wang [MSFT]

Dear cpnet,
Good morning!

I am writing to check what everything is going on regarding this issue.If
you have any other questions or concerns, please do not hesitate to let me
know. I will do my best to help.

Thank you!

Best regards,
Charles Wang
Microsoft Online Community Support
=========================================================
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: (e-mail address removed).
=========================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
=========================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top