Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Schema for CLR Stored Procedure During Deployment

I'm interested in configuring Visual Studio (2010) so that when deploying C# CLR Database projects, it puts stuff in schemas other than DBO. I understand I can update the function/procedure/etc... wrappers it creates manually to make this happen: CLR Stored Procedures: how to set the schema/owner?

However, I'd really like to automate the process somehow. If anybody knows, I'd really appreciate the answer!

like image 420
bopapa_1979 Avatar asked Nov 30 '10 20:11

bopapa_1979


People also ask

What is schema in stored procedure?

A schema is a collection of database objects like tables, triggers, stored procedures, etc. A schema is connected with a user which is known as the schema owner. Database may have one or more schema. SQL Server have some built-in schema, for example: dbo, guest, sys, and INFORMATION_SCHEMA.

Does schema include stored procedures?

Schema refers to database tables and how them are related to each other. Stored procedures are also part of the database, but not of the schema. UPDATED: Stored procedures are incorrectly mentioned as not part of a database schema.

Where are CLR stored procedures stored?

The stored procedures are compiled and stored in the database. The CLR stored procedures are the combination of the CLR and stored procedure. CLR SPs are the . Net objects which run in the SQL Server memory of the SQL Server database.


2 Answers

You can change stored procedure from one schema to another using

ALTER SCHEMA Org TRANSFER dbo.spUdpateCompany
like image 112
TechDo Avatar answered Sep 19 '22 00:09

TechDo


It should be mentioned that this question is obsolete as of Visual Studio 2012 which has a "Default Schema" configuration field for the generated T-SQL wrapper objects. This has also been noted in the "Update" section at the top of the following answer ;-) :

CLR Stored Procedures: how to set the schema/owner?

like image 43
Solomon Rutzky Avatar answered Sep 21 '22 00:09

Solomon Rutzky