Forums Neueste Beiträge
 

Call a function without Username as Identifier

27/11/2007 - 10:42 von Fudzzi | Report spam
Call a function without Username as Identifier

I write a function, which adds a real (Seconds) to a datetime

CREATE FUNCTION get_datetime( @p_d datetime, @p_n real)
RETURNS datetime
as
begin
return (@p_d + (@p_n / 86400.0));
end

I can call the function only with the User "dbo":
select dbo.get_datetime(mydate, mytime) from mytable;
on a table with was created by, create mytable (mydate dateime, mytime
integer);

In my application i have to ommit the user "dbo":
select get_datetime(mydate, mytime) from mytable;
How can I do that in SQLSERVER 2000?

Thanx in advance
Majus Hinterberger
 

Lesen sie die antworten

#1 Frank Kalis
27/11/2007 - 11:35 | Warnen spam
"Fudzzi" wrote:

Call a function without Username as Identifier

I write a function, which adds a real (Seconds) to a datetime

CREATE FUNCTION get_datetime( @p_d datetime, @p_n real)
RETURNS datetime
as
begin
return (@p_d + (@p_n / 86400.0));
end

I can call the function only with the User "dbo":
select dbo.get_datetime(mydate, mytime) from mytable;
on a table with was created by, create mytable (mydate dateime, mytime
integer);

In my application i have to ommit the user "dbo":
select get_datetime(mydate, mytime) from mytable;
How can I do that in SQLSERVER 2000?



Why do you think that you need a function instead of using the built-in
DATEADD function?

...and why do you write in English in the German SQL Server newsgroup? ;-)
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.de

Ähnliche fragen