开发者

'The default schema does not exist' on deploy of SQL CLR assembly onto SQL Server 2008

开发者 https://www.devze.com 2022-12-23 14:52 出处:网络
I\'m deploying an example SQL CLR stored procedure which has a SQL CLR type as parameter using Visual Studio 2008 and menu Project -&g开发者_如何学运维t; Deploy.

I'm deploying an example SQL CLR stored procedure which has a SQL CLR type as parameter using Visual Studio 2008 and menu Project -&g开发者_如何学运维t; Deploy.

public partial class StoredProcedures
{
    [Microsoft.SqlServer.Server.SqlProcedure]
    public static void TakeTariff(TariffInfo tariffInfo) { }
}

public class TariffInfo
{
    public SqlDecimal Amount { get; private set; }
}

but getting next strange error:

The default schema does not exist.

How can I fix that?

My user was created this way:

CREATE USER myUser FOR LOGIN myLogin_mod WITH DEFAULT_SCHEMA = mySchema


You'll need to run this to create the schema before you add objects to it...

CREATE SCHEMA mySchema AUTHORIZATION myUser --or dbo

CREATE USER does not check this:

...DEFAULT_SCHEMA can be set to a schema that does not currently exist in the database...

0

精彩评论

暂无评论...
验证码 换一张
取 消