SQL server - performs a scalar function without specifying the db name

I have a custom SQL function that I can call from control studio using syntax dbo.Function(arg)

Now, when I need to call this function from C #, if I do not specify **dbname**.dbo.Function(arg), I get an error that the SQL server cannot find this user-defined function. How can I solve this problem without specifying dbname? I am already connecting to the server using a connection string that indicates "initial catalog = dbname"


It seems that I cannot reproduce the mentioned behavior at the moment :-) (either using SQL Server 2005, or in 2008). I have to keep this question

+5
source share
1 answer

, . :

var cn = new SqlConnection(
    "SERVER=SomeServer;DATABASE=SomeDb;Integrated Security=SSPI;"
);

, , master, .

+2

All Articles