Reputation: 2402
I've created a new database project to group together all my useful stored procedures and functions so they can be easily deployed to any of my servers.
I'd like to add a couple of CLR UDFs. I tried adding a CLR project to my solution but this wants to be given a specific database to deploy to which is in conflict with the rest of the solution as the point is I want to be able to deploy anywhere!
Am i missing something?!
Sam : )
Upvotes: 1
Views: 1244
Reputation: 2402
The solution was this...
That was it, now when I deploy my database project it includes the CLR functions wherever I choose to deploy it.
Luckily some guy had documented the whole process so go check it out here
Upvotes: 1
Reputation: 1574
We added a normal class library to our solution, containing a class with static methods for our UDFs.
eg:
[SqlFunction(IsDeterministic = true, IsPrecise = true)]
public static bool MyMethod(string x)
{
...
}
Then add a reference to this project from the database project.
Upvotes: 0