Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
somu_p
Starting Member
13 Posts |
Posted - 2008-02-26 : 08:54:46
|
I'm calling a function with its full qualifiers.That means servername.dbname.schemaname.functionnameI'm getting an error like thisInvalid column name 'servername'.Is it possible to call a function name with its server name?ThanksSomu |
|
ranganath
Posting Yak Master
209 Posts |
Posted - 2008-02-26 : 09:02:03
|
Hi,CREATE FUNCTION fx_SumTwoValues( @Val1 int, @Val2 int )RETURNS intASBEGIN RETURN (@Val1+@Val2)ENDSELECT dbo.fx_SumTwoValues(1,2) AS SumOfTwoValues |
 |
|
somu_p
Starting Member
13 Posts |
Posted - 2008-02-26 : 09:46:32
|
No. I want to call the function name with its server name.ex: Server.DB.Schema.functionName() |
 |
|
talleyrand
Starting Member
35 Posts |
Posted - 2008-02-26 : 10:08:11
|
I had never tried it but I get the same results--invalid column name 'server' Which is interesting as I can do SELECT TOP 1 * FROM server.db.schema.table no problem so it's not a question of whether I can use the database remotely. I then repeated with calling a table value function on a different serverSELECT * FROM Server.DB.Schema.TableValueFunction('2008-01-01') and it failed out with Remote table-valued function calls are not allowed.Makes me wish I had an aggregate function to see what error message it returns when it's invoked remotely.Executing a stored procedure through a remote server works just fine. Interesting, interesting, I'll have to check BOL over lunch to see if I can understand why it is so. |
 |
|
hamtek
Starting Member
1 Post |
Posted - 2008-02-27 : 06:39:20
|
Hi.Perhaps you could call a remote stored procedure which could then call and return results from the remote function?I know its not the perfect solution, but hope it gives you an idea :) |
 |
|
|
|
|