c# - Type 'StoredProcedures' already defines a member called 'AddNumber' with the same parameter types -
i have created visual c# sql clr database project. added 2 stored procedure: test1.cs
, test2.cs
. have function in test1.cs
addnumber
.
in test2.cs
, want have function same name else, error after rebuild it:
type 'storedprocedures' defines member called 'addnumber' same parameter types.
the code test1 looks this:
public partial class storedprocedures { [microsoft.sqlserver.server.sqlprocedure] public static void test1(string path) { // put code here } private static void addnumbers(int a, int b) { } };
test 2
public partial class storedprocedures { [microsoft.sqlserver.server.sqlprocedure] public static void test2(string path) { // put code here } private static void addnumbers(int a, int b) { } };
i not want change names have multiple other functions same name. also, there many variables same name in both files, too.
i tried adding namespace in 1 of file while deploying error "incorrect syntax" code deploy them in sql server is:
create procedure add_number ( @path nvarchar(400) ) external name test.storedprocedures.test1 go
i'm not sure why removed bit question. if class storedprocedures
in namespace namespace
, in assembly test
, can use external name test.[namespace.storedprocedures].test1
. full type name needs single identifier far sql concerned, , since full type name includes dot, needs quoted.
note cause multiple different types have same name storedprocedures
. there no problem that, has same effect renaming storedprocedures
separate classes storedprocedure1
, storedprocedure2
, , renaming 1 thing wanted avoid (although not see why).
Comments
Post a Comment