Friday, March 9, 2012

function naming and execution

Hi,

I am converting a database from Oracle to SQL-Server 2005 and in that context I needed to implement a function in the database. My database default uses the dbo schema and the function is there too. I define a function called "Translate" and wanted to use it like this :

SELECT
translate(Phonenumber, '0123456789 ()+-', '0123456789') as Phonenumber
FROM
Customer

but what pussled my was that in order to make this work I had to prefix the translate method with "dbo." like this :

SELECT

dbo.translate(Phonenumber, '0123456789 ()+-', '0123456789') as Phonenumber

FROM

Customer

as all "objects" I'm using resides in the dbo schema - why must I prefiks only the function and not the table?Yes, functions will defintely need the owner / schema prefix.

HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

|||Why not use SQL Server Migration Assistant (SSMA) for Oracle ?|||Howcome tables and views does not? - this seems inconsistent to me when they are all in the same schema...

No comments:

Post a Comment