February 9, 2012 at 12:56 pm
I created a function that will parse the domain out of an email address.
I'dl like to apply that function within a stored procedure to a select statement.
The function name is Trim_Mobile_Phone_Domain.
Below is what I have so far (but can't get to work).
SELECT
Att_EMA_ID,
dbo.Trim_Mobile_Phone_Domain(Att_EMA_Email_Address),
Att_EMA_Attorney_ID
FROM
Attorneys_Email_Addresses
WHERE
Att_EMA_Attorney_ID = @Employee_ID AND
Att_EMA_Email_or_Txt_Address='Txt Address'
What would be the correct syntax?
February 9, 2012 at 1:21 pm
Looks like the syntax is correct. Are you getting any error messages?
Also, an inline UDF like is prone to horrible performance if your resultset is anything more than a few rows.
Before anybody has much of a chance of helping you are going to have to provide some details. Take a look at the first link in my signature for best practices on posting questions.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply