views:

227

answers:

1

I'm deploying an example SQL CLR stored procedure which has a SQL CLR type as parameter using Visual Studio 2008 and menu Project -> 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
A: 

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...

gbn