T-SQL (SS2K8) :: Stripping First And Last Name From Email Address
Mar 12, 2015
I'm trying to strip out the First & Last Name from an Email Address. The email address is formatted as "FirstName.LastName@emailaddress.com" but sometimes a middle initial is used (ex: "First.M.Last@emailaddress.com").
I can locate the '@' sign and the first '.' period(from left to right) but need to find the first '.' from the left of the '@' sign.
I'm doing this in a view.
Here's some sample data and what I've tried:
CREATE TABLE dbo.Table1
(EmailAddr VARCHAR(255))
INSERT INTO dbo.Table1 (EmailAddr)
SELECT 'Andy.Smith@gmaddr.com'
UNION ALL
SELECT 'Betty.Lee-Jones@gmaddr.com'
[Code] .....
View 3 Replies
ADVERTISEMENT
May 8, 2008
We have an identifier of who has performed an ection which populates a table with their email address in the format firstname.surname@domain. I am looknig for some code to split out the first name and surname (and, if possible, capitalise both) so uor audit report can show the actual name instead of the email address.
Has anyone encountered this issue previously and know a solution?
Many thanks in anticipation.
View 6 Replies
View Related
Dec 9, 2004
Is there a handy-dandy way for me to be able, from a stored procedure, to capture the notification email address for a user associated with a job?
I need to send an email out from a stored procedure, and I want it to be set up to send to the same user that is set up in the job that calls the stored procedure.
the same notification stored proc will be used in multiple jobs, but the jobs are already set up with a notification email to be sent to the defined users "on completion" (error or not). I want a separate email to be sent, but I want to use xp_Sendmail because I have to perform a select who's output I want to appear in the body of the email (and unless I am missing something, I have no control over the body of the standard "job completion" email).
I would prefer to NOT have to "hard code" the user email address in the stored proc that calls xp_sendmail, OR to put it in some user table in the database, when the user I want to send it to will always be the same one defined in at the JOB level in Enterprise Manager.
Any thoughts? Thanks in advance for your instantaneous and informative answer-packed responses! ;)
View 2 Replies
View Related
May 14, 2008
Hello,
I will like to know the best practice for grouping email addresses in a table.
We have a basic table that has email address for admin users. Which goes thus
CLIENTS EMAIL
emailID int
username: varchar 20
Client_email varchar 150
The Above table is for our admin users. Enabling them to send out emails to clients. Based on their bills.
We have a second table for mass mailing. Which has emails in groups. Each group is based on the above entry. And groups could range from 5 users up to 100,000 users.
Whats the best way to implement this.
Do I create a seperate column for each email entry, knowing that this table would be extremely big, with a lot of repeated values, ie username etc. Or group them TOGETHER as varchar(max)
PLEASE ADVICE, best practices
thanks
Mary
Yes O !
View 1 Replies
View Related
Jan 28, 2014
There is a Table DISPLAY_DETAILS in which a Column - DISPLAY_NAME, which displays data in it as :
Joe Barnard(123456);Paul Johnson(114454); - Display as Name(Employee Id).
There is a EMployee Master Table EMP_MASTER Which contains Employee Id and Email Address Columns.
From this: Joe Barnard(123456);Paul Johnson(114454); I need to get the Email Address for these Employee Ids - 123456 and 114454
View 3 Replies
View Related
Jul 4, 2007
Hi,I have 2 fields in a database: 'email' and 'website'.In the majority of cases, the website field is not populated even though theemail address is. In 90% of cases, the website will be 'www.' followed bywhatever is after the '@' symbol in the email address.Would anyone be able to help me with the SQL that would take whatever isafter the '@' sign in the email address, add it to 'www.' and populate the'website' field?Thanks!
View 3 Replies
View Related
Aug 2, 2007
Hi
do you know incase a script which extracts domain names from an email address?
like foreg. we have xyz@dmc.com or abce@dmc-int.com
should give
dmc and
dmc-int
View 7 Replies
View Related
Feb 13, 2008
i ve a filed named "Email" of datatype .i ve created this field to insert email address in this field.but when i insert an email address like "bilal@yahoo.com" from a textbox wh is in an ASP.net webpage then in the filed i see this "System.Web.UI.WebControls.TextBox".
can u plz tell me how to fix this
Regards
Ahmed Bilal Jan
View 3 Replies
View Related
Oct 1, 2007
Could this query be made more efficient?
It takes ages to run it. It strips of everything from an email address and keeps only the domain.
SUBSTRING(Mailaddress, CHARINDEX('@', Mailaddress) + 1, CHARINDEX('.', SUBSTRING(Mailaddress, CHARINDEX('@', Mailaddress) + 1, 100)) - 1) AS mail_domain
View 4 Replies
View Related
Nov 30, 2006
this is what i am looking for,
A client with an email address that does not end in uk cannot make a room booking
Any ideas
View 9 Replies
View Related
May 10, 2007
ms sql server
data:
idno Email Category
1 a@a.com c
2 b@b.com c
3 b@b.com c
4 b@b.com c
only unique email address record are requierd.
1 a@a.com c
2 b@b.com c
what could be the query for such requirements.
View 5 Replies
View Related
Apr 11, 2007
(NOTE: FROM a NON-IT PERSON) We've implented SQL 2005 and Reporting Services, but our subscriptions only work internally: when we try to send reports via subscriptions to valid external email addresses, we get a message: invalid email address and the entire subscription does not work.. PLEASE ADVISE. IT WILL BE GREATLY APPRECIATED!
View 1 Replies
View Related
Jun 26, 2007
I would like to use ISS to extract the user name and email address out of the active directory. I would like to put it in an MS-SQL 2005 table that I can use stored procedures on. I am hoping I can use a query to do it but I understand there is a 1000 entry limit on the extraction of the Active Directory and I have more than 1000. Could someone point me in the right direction please. Thanks.
View 1 Replies
View Related
Sep 21, 2015
I just moved our SSRS server from one machine to another. It was sending our report emails from a service account. So when my end users get the emailed report it was from a service account (reports@blah.com) .
Now that I moved the DB to another server - the reports get emailed successfully - but they are being sent from my email address!
I have checked the rsreportserver config file. I also checked in the report server smtp setup and they both show the service account. I even checked the subscription owners and accounts.
SSRS is using my account, but I can't find where it's getting it from. Where else can I look?
View 3 Replies
View Related
Aug 15, 2002
how do I set up a SQL2000 server to send an alert to both an email address and a pager when a specific event occurs..please help!!! The server is in a different location and we need notification of problems!! thanks
View 1 Replies
View Related
Mar 11, 2014
i have a situation where is need to get email address from a varchar column. Here is some sample data for five records; The format can be change.
dummy text;
Tel: +44 (0)1234 566788;
Email: bbc@co.uk
Admissions dummy text;
T: +44 (0)1234 4444;
E: xyz@co.uk;
dummy text;
dummy text;
Tel: +123 32323 33;
Email: test@yahoo.com;
dummy text;
t: +88 (0) 115 333 5553;
f: +99 (0) 115 222 8888
e: dummy@gmail.com;
dummy text;
t: +11 (0) 222 222 2222;
e: myemail@test.com;
w:http://www.yahoo.com/faqs;
View 4 Replies
View Related
Oct 30, 2014
I am trying to retrieving all email address using particular domain extension for e.g. gmail.com
I wrote the below query
Select policyid,emailaddress from policyholder
WHERE policyholder.EmailAddress like '%gmail.com%'
It works fine, but i want to use the LIKE condition against ‘emailaddress’ column in email table as I have more than 100 domain extensions
I wrote something like
WHERE policyholder.EmailAddress like (select emailaddress from email) but I am getting the below error
Msg 512, Level 16, State 1, Line 1
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
View 4 Replies
View Related
Jul 23, 2005
Dear Mr Portas and Mr Sommarskog,Cause I am a newbie in sql, can I ask for your email address?My email Address is Join Bytes!ThanxBest RegardsMichael--Message posted via http://www.sqlmonster.com
View 3 Replies
View Related
Dec 27, 2005
Hi,
The Browser role has the task Manage Individual Subscriptions. Fine, the user can create a subscription. The problem is that the reportserver populate the email address text box with the Windows User ID and does not let the user change this to put his email address instead. The text box is greyed out.
I found that to enable the text box I have to add the task Manage all subscriptions to the role "Browser".
This is a major security problem because with this setting any user can edit any subscription.
I suspect that I could work at the Active Directory level to populate a field that would in turn populate the email address with the correct data., however this is not an option for me. I have absolutely no way to do it or get it done. Does anybody has an idea on how I could allow a user to edit his email address in his subscriptions and not let him tamper with other users subscriptions?
Thanks
Philippe
View 5 Replies
View Related
Feb 5, 2015
I am implementing a fax solution (Right Fax) and pulling email information from a table and passing into a variable. In order to send out a fax via email, the syntax is in the following example below:
Example:
To send a fax from Outlook to Jane Doe at 555-1212, enter:
[RFAX:Jane Doe@/FN=555-1212]
When the following syntax gets passed into the Send Mail Task, into the "To" line and the package is executed I'm receiving the following.
[Send Mail Task] Error: An error occurred with the following error message: "The specified string is not in the form required for an e-mail address.".
[Send Mail Task] Warning: The address in the "To" line is malformed. It is either missing the "@" symbol or is not valid.
I realize it’s a malformed email address. Is it possible to create a group and instead of the fax syntax pass the group name?
View 8 Replies
View Related
Aug 8, 2006
I have subscription by email problem on the following configuration:
Windows XP prof.
SQL Server 2005 Enterprise
Configured Database Mail with remote SMTP server to send email successfully
Configured SSRS to use remote SMTP server
Edited the Rsreportserver.config file as following (by the instructions from MSDN)
<Configuration>
<RSEmailDPConfiguration>
<SMTPServer>smtp.broadband.rogers.com</SMTPServer>
<SMTPServerPort>25</SMTPServerPort>
<SMTPAccountName></SMTPAccountName>
<SMTPConnectionTimeout></SMTPConnectionTimeout>
<SMTPServerPickupDirectory></SMTPServerPickupDirectory>
<SMTPUseSSL></SMTPUseSSL>
<SendUsing>2</SendUsing>
<SMTPAuthenticate>0</SMTPAuthenticate>
<From>My email Address</From>
<EmbeddedRenderFormats>
<RenderingExtension>MHTML</RenderingExtension>
</EmbeddedRenderFormats>
<PrivilegedUserRenderFormats></PrivilegedUserRenderFormats>
<ExcludedRenderFormats>
<RenderingExtension>HTMLOWC</RenderingExtension>
<RenderingExtension>NULL</RenderingExtension>
<RenderingExtension>RGDI</RenderingExtension>
</ExcludedRenderFormats>
<SendEmailToUserAlias>True</SendEmailToUserAlias>
<DefaultHostName></DefaultHostName>
<PermittedHosts></PermittedHosts>
</RSEmailDPConfiguration>
</Configuration>
I scheduled my subscription and tested it. I didn't receive any mail from the setting email address, but got an error message in ReportServerService log file as following.
Error sending mail, CDO error -2147220978, will not resend
Error sending email. System.Runtime.InteropServices.COMException (0x8004020E): The server rejected the sender address. The server response was: 530 authentication required - for help go to http://help.yahoo.com/help/us/mail/pop/pop-11.html
I did a little search, but couldn't find any solution for it. Is anybody successfully to get the Reporting Services subscription by email function working through MS SQL Server Management Studio or if you have a solution for this issue, would you mind to share the experience with me. I will be very appreciated.
View 5 Replies
View Related
Sep 9, 2014
I have written a simple routine to do some address checking between sources. The business owner wanted the check done to the address as a whole and to report the address' that did not return a match. The comparison works perfectly fine.
Well, now the customer has come back wanting to know what element(s) of the address make the match fail
Here's the basic address compare:
SELECT *
FROM Full_Address_Map fam
WHERE fam.StreetName + ' ' + fam.RoadType + ' ' + fam.CityName + ' ' + fam.StateName + ' ' + fam.Country COLLATE Cyrillic_General_CI_AI NOT IN
(
SELECT s.base_name + ' ' + s.road_type + ' ' + p.name + ' ' + v.name + ' ' + v.country_name COLLATE Cyrillic_General_CI_AI
[Code] ....
You can see that we are building the address by sticking the 5 columns together with a space in between to create a single string. We are then doing the same thing with the other source data and simply comparing the string. This worked perfectly and was nice and simple... until the customer decided he wanted to see the element(s) causing the issue.
For example, let's say there is an address of '123 Main ST Dallas Texas United States' in one source, but it's '123 Main Dallas Texas United States' in the other. The customer wants to know that it is the road type (ST) that caused the mismatch.
Now, I wrote a bunch of queries to try and single out each element in order to determine if it is the one causing the issue or not. It seems to work partially, but I don't believe it is the best approach and it doesn't work if more than one column is the culprit.
View 3 Replies
View Related
Mar 3, 2008
Hi
everybody.
I am new to VBA,.,, I Have created a folder under inbox in Outlook 2007 which stored the receipients information
like name, E-mail, which is not present in the address book of outlook.
I have imported this folder in access 2007. My problem is ... it does not display the email address.
Rest of the informations is displayed... Is there any way i could do this.??
is there any way i could get the email addresses to appear(import/get) in to the access table???
Is there any module i mite have to create??
Plz help...
thanks a million
View 1 Replies
View Related
Jan 18, 2007
I doubt this is possible, but can someone think of a way to change the email address used for sending report subscriptions based on the report or subscription?
It's a need that I've heard from a number of different clients. Scenario: a company has one reporting services server with reports running from numerous departments. Report subscriptions are sent to internal and external email addresses and there's a business need to use different "from" addresses based on the report (or audience).
View 1 Replies
View Related
Oct 17, 2015
I have created a trigger like this below:
CREATE TRIGGER TriggerName ON Table_Name AFTER INSERT AS
DECLARE @SERVICE varchar(40)
DECLARE @STATUS varchar(3)
SET @SERVICE=(SELECT [SERVICE] FROM inserted)
SET @STATUS=(SELECT [STATUS] FROM inserted)
[Code] ....
When I added some a new record to Table_Name with Status='X' nothing happened. I have tried to exec only script below:
EXEC msdb.dbo.sp_send_dbmail @recipients=N'moj_adres', @body= 'test', @subject = 'Subject!!!!', @profile_name = 'profil'
and I received email notification.
View 7 Replies
View Related
Dec 2, 2014
I have a job below, which takes the results and send to the users in email.But I have a question, how can I send only one email with all rows, not to send the for every row on table separated email.
DECLARE @Body VARCHAR(MAX)
DECLARE @StartDate DATETIME
DECLARE @EndDate DATETIME
DECLARE @RowCountINT
DECLARE@idINT
declare@departmentnvarchar(30)
[code]....
View 2 Replies
View Related
Jun 25, 2014
What I am trying to do, Extract the data from SQL table and Insert in Email Body and email to user. I got good article on Internet, I follow all steps as it is, but still I am getting error.
Here is the link : [URL] ....
But I am getting Error:
Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args)
at System.String.Format(IFormatProvider provider, String format, Object[] args)
at ST_7f59d09774914001b60a99a90809d5c5.csproj.ScriptMain.Main()
[Code] ....
View 4 Replies
View Related
Feb 23, 2004
I want to strip off the last three characters from an item number. The only thing is tht every item number is not the same lenght. The last three characters of this number are packing codes that I do not need. Fore example I can have all these numbers:
EFJ50701033
EFW1546066
RFM4925156
70561033
89541899
How would I remove the last three characters and only remain with whatever is in front of those three characters?
Any help is greatly appreciated!
View 6 Replies
View Related
Sep 25, 2007
Does anyone know how to get rid of rtf tags that are stored in the table? I need to filter out the data and wondering if there is a utility on the SQL Server that can do it.
View 16 Replies
View Related
Oct 24, 2005
Has anyone had to deal with removing punctuation (commas, apostrophes,etc.) from a column? What is the most efficient way to have thesecharacters automatically removed from the column?
View 3 Replies
View Related
May 23, 2006
Hi everyone,
I have a sql quey that selectes phoneNumbers from the database. Problem is some phone numbers have hypens in it and some doesn't. Is there any way in sql so that I can remove hyphens from the phone numbers
some numbers are like this
213-456-9999
and some are
2136789999
Please let me know if this is possible.
Thanks.
View 2 Replies
View Related
Apr 28, 2008
I am trying to Strip off the Numbers witha Delimited List and just retain the Name of the Persons. but unable to do it. is there any function or code to do that in SQL
932908` James Fleser,935992` Prakash Sinha
Stripping off Numbers for the Above and Just retain the Names..
thanks
View 4 Replies
View Related
May 29, 2008
Question - if you had to completely strip all permissions from all databases in an instance and reset them, assuming you have metadata to support rebuilding the permissions, what steps would you follow? I can handle the iterating through each database, but at the database level, what steps would you take?
The reason I inquire on this is I currently have a job that I inherited that does just this. But it's buggy and was also written in for SQL Server 2000. With some of the changes in 2005, a few bugs have crept in, etc. And I would like to confirm my thoughts this. Or, if your opinion is why are you wasting your time on this? Then that's fine to and I'll review any constructive comments you may have.
View 4 Replies
View Related