Question: Any ideas why my SQL Server code isn't working? I have to write a user-defined function (I can get it to work with CONCAT but
Any ideas why my SQL Server code isn't working? I have to write a user-defined function (I can get it to work with CONCAT but this is NOT what the question is). Here is the full question: Chapter 7 Part F: Write a SQL statement to create a user-defined function for QACS_CH07 database named FullNameFunction that combines two parameters named FirstName and LastName into a concatenated name field formatted FirstName LastName (including the space). Please use Figure 7-21 as a reference (Database Processing, Kronke)
CREATE FUNCTION dbo.NameConcatenation ( @FirstName CHAR(25), @LastName CHAR(25) )
RETURNS VARCHAR(50) AS BEGIN DECLARE @FullName VARCHAR(50); SELECT @FullName = RTRIM(@FirstName) + ' ' + RTRIM(@LastName); RETURN @FullName;
SELECT dbo.NameConcatenation (FirstName, LastName) AS FullName FROM CUSTOMER;
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
