Multiple choice technology databases

How will you call a function in sql server 2005

  1. DatabaseName.fun.FunctionName()

  2. DatabaseName.dbo.FunctionName()

  3. Exercise.fun.GetFullName();

  4. Exercise.dbo.GetFullName();

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

SQL Server functions are called using schema qualification: DatabaseName.SchemaOwner.FunctionName(). The default schema owner is dbo, so DatabaseName.dbo.FunctionName() is correct syntax. The schema qualification is required for UDFs (User-Defined Functions) when calling from outside the function's database.