Automated Birthday Email
Apr 13, 2006I have a SQL server 2005 database. I want to send a user an email when it's his birthday. His birthdate is stored in the "birthdate" column...
How can I automate this?
I have a SQL server 2005 database. I want to send a user an email when it's his birthday. His birthdate is stored in the "birthdate" column...
How can I automate this?
I have an EmployeeReviews table...and basically..when the date is 14 days before their review date..I want to have an automated email sent out to the Reviewer.
View 1 Replies View Relatedpossible to send Pivot query results as automated database email ?
View 3 Replies View RelatedHi ,
I'm just new in this SQL 2005, and I do not reallly sure the subject is right or not but as example in this link below
http://msdn2.microsoft.com/en-us/library/ms190307.aspx
I want updated to few of person of any changes in database just by sending to their emails in every 2 hours as an example. I go through the example given but I do not know the step how to run stored procedures. The Information that I want to give to them is like as:
Date From : 23/02/2008
Date To: 24/02/2008
Number of user : 3
My draft table is like this
Sequence_No Submitted_Dt Name
-------------------- ------------------- ------------------------
1 2/21/2008 4:16:45 PM John
2 2/22/2008 4:16:45 PM Dean
3 2/23/2008 4:16:45 PM Rick
4 2/24/2008 4:16:45 PM Van
thanks to all of your corcern to help me
Regards;
I want to do a calc using the closest birthday...
declare @bday datetime ,@past_bday int ,@next_bday int ,@age int
set @bday = '12/25/1973'
--
-- some code goes here to assign values to past & next bday
--
if @past_bday < @next_bday
set @age = @age
else if @past_bday > @next_bday
set @age = @age + 1
TIA
JeffP...
Hi,
I have a datetime field in sql database in which dates are stored in format 'mm/dd/yyyy'.
What i want is to send them BD greetings checking with the current date.
How can i acheive this in query ?
Thanks in advance.
Hi, i have a table users which contains a birthday field, i would like to have a query that displays the users birthdays for the coming 7 days. Can someone help me with this.
Thanx allot.
Wimmo
With reference to this topic, http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=74462
you can now easy calculate if someone has a birthday within any time period!
If there is a birthday, the function returns how many years the subject will be, otherwise it returns NULL.CREATE FUNCTION dbo.fnHasBirthday
(
@DoB DATETIME,
@FromDate DATETIME,
@ToDate DATETIME
)
RETURNS INT
AS
BEGIN
DECLARE@From INT,
@To INT
IF @DoB IS NULL OR @FromDate IS NULL OR @ToDate IS NULL OR @FromDate > @ToDate
RETURN NULL
SELECT@From =CASE
WHEN DATEPART(DAY, @DoB) >= DATEPART(DAY, @FromDate) THEN DATEDIFF(MONTH, @DoB, @FromDate) - 1
ELSE DATEDIFF(MONTH, @DoB, @FromDate)
END,
@To =CASE
WHEN DATEPART(DAY, @DoB) > DATEPART(DAY, @ToDate) THEN DATEDIFF(MONTH, @DoB, @ToDate) - 1
ELSE DATEDIFF(MONTH, @DoB, @ToDate)
END
RETURNNULLIF(@To, @From) / 12
ENDThis is an example of how you can use the functionSELECTDateOfBirth,
dbo.fnHasBirthday(DateOfBirth, '20070225', '20070303')
FROMEmployees
Peter Larsson
Helsingborg, Sweden
I have a report that gets sends out through a subscription and sometimes the report has multiple pages and all those pages appear within one email.Is it possible to set the subscription in such a way that an email is sent per page when the subscription executes.
View 2 Replies View RelatedUnder IIS SMTP I can set bounced email redirect etc. how to do that with dbmail, the idea is I can get the list of bounced emails somewhere so I can create a report.
Any idea?
thanks
need help
split list of email add comma for evry email
i have tabe "tblLogin" and in this table i have field emall
like this
emall
-----------------------------------------
aaa@hhhh.mm
nnn@hhhh.mm
mmm@hhhh.mm
need to do ilke this
Code Snippet
@list_email = (SELECT emall FROM tblLogin)
--------------------------i get this
-----------------------@list_email=aaa@hhhh.mm ; nnn@hhhh.mm ; mmm@hhhh.mm
@recipients = @list_email
Code Snippet
IF EXISTS( SELECT * FROM [db_all].[dbo].[taliB] )
BEGIN
DECLARE @xml NVARCHAR(MAX)DECLARE @body NVARCHAR(MAX)
SET @xml =CAST(( SELECT
FirstName AS 'td','',
LastName AS 'td','' ,
Date_born AS 'td','' ,
Age AS 'td','' ,
BirthdayToday AS 'td','' ,
BirthdayThisWeek AS 'td'
FROM [Bakra_all].[dbo].[taliB] ORDER BY LastName FOR XML PATH('tr'), ELEMENTS ) AS NVARCHAR(MAX))
SET @body ='<html><H1 align=center>aaaaaaaaaaaaaaaaaaaaaa</H1><body ><table border = 1 align=center dir=rtl>
<tr>
<td>name</td>
<td>fname</td>
<td>date</td>
<td>age</td>
<td>aaaaaaaaa</td>
<td>bbbbbbbbbbbbbbb</td>
</tr>'
SET @body = @body + @xml +'</table></body></html>'
EXEC msdb.dbo.sp_send_dbmail
@recipients =N'rrr@iec.co.il',
@copy_recipients='rrrrr@iec.co.il',
@body = @body,
@body_format ='HTML',
@subject ='ggggggggggggggggggggg',
@profile_name ='ilan'
END
ELSE
print 'no email today'
Hello ALL
what I want to achieve is to load a text file that has email addreses from disk and using the email addresses in the text file look it up against the email addresses in the database table then once matched delete all the users in the table whose email address were in the text file.
I also want to update some users using a different text file.
Please help me with the best way to do this
Thanks in advance
Hi everyone,i'm new to ado.net and need some help. My problem:got one DB with real bad tablestructureand one new DB (structured!)i need do do an automated import from the old to the new DB, with check if the data row is new or updated.I try to do it this way-> 2 datasets merged together ->Problem: new entries in destination dataset have row state unchangedother way i tryed add rows from source to destination with add funktion -> problem no check if data exist and maybe is changedSo how can i get the merge working or how can i implemt an effective funktion to solve this problem. Thanks in advance!
View 5 Replies View RelatedHi, looking for some paths to take on this one. I have to backup the database to a LS120 floppy
drive. It has to be automated so the user can just click on a desktop icon and away it goes. Probably
an easy script buy i sure would appreciete some help on this one.
Thanks
Troy
Hi. I am using SQL 7.0.
Here is the situation... there are random (.csv) files being dropped into a specific directory on a daily basis. Is it possible to have SQL server automatically pick up this file and run it through the Import/Export data option so that it creates a SQL table from the original data? I need this whole sequence to be automated. Is this possible? Somebody please help... I will appreciate it greatly. Thanks a lot!
Alan
I am trying to automate the installation process of our Help
Desk software `Expert Advisor`. It uses a MS SQL Server 6.5
database. I can figure out the automation of Expert Advisor,
but is it possible to automate the installation of the
SQL drivers for each workstation? I don`t want or need any of the
utilities such as ISQL/w installed along with the driver--just the
SQL driver itself. Is there a runtime version of the database I should
use? I`m fairly new to SQL so please forgive me if I seem naive.
Any suggestions? Any help would be appreciated.
Toni
I don't know what happened on that first thread, but here it is again.
Thanks for your help.
Hello,
I have set up a .bat file to automatically export all of my server logs to a directory on my SQL server. From there I am trying to import those files into an event_log table that I have set up. (from there I am going to use Cold Fusion to parse the table each day and e-mail me with anything I should look at) The estimated ROI for my company is roughly $14.5k, it's easy so if you don't already have an error log monitoring solution, check this out!
Anyway I tried to use BCP in my .bat file but it keeps coming back with an unexpected end of file error.
Can I get some help with either:
1. Find a command line tool to import these .txt files with
-or-
2. Help me with the BCP issue?
Thanks in advance.
I am an intern at a university and we are looking for a way to automatically document tables, queries, etc. ColdFusion is the platform used, and SQL Server 2000. Is there a way to have the documentation performed that will capture tables, constraints, etc.? I have found some, but so far, none are working. Please help if you can!!! :confused:
View 4 Replies View RelatedHi,
I have 2 databases, one called "ManagementDB" and the other called "ManagementDBYesterday".
Basically I get asked very frequently to look at yesterdays data for various reasons and I thought it'd be a good idea to always have yesterdays data to hand instead of restoring all the time.
I have tried DTS but this takes too long, I've also thought of replication however the database is modified too frequently for this to be easliy implemented.
Restoring from a backup is quite quick so I thought if I could somehow automate this, I'd have a readily available copy of yesterdays data to hand.
I have a mon-sun daily backup so I need to write some SQL script to restore from the correct backup to the "yesterday" database.
I've only used restore via the enterprise manager and I was wondering if anyone here could help.
kind regards,
Mike,
I have a customer who insists on emailing an excel spreadsheet to me to be uploaded to a sql database. I came across a script at one point that laid out how I would script this out. Basically it was in parts, 1. open email program and get attachment. 2.After saving attachment closing email program in order to be used the next day or next time an attachment was sent. 3. import the attached spreadsheet into SQL database. I would also like to be able to schedule this to run with the built in Windows 2000 scheduler.
Can anyone help me out on this one??
Thanks,
Will
Hi,
I'm working on a program that is some kind of organizer for all the tasks that employees have to carry out. A part of this program should check the deadline from the tasks, and send a mail if the deadline is in less than 5 days.
I'm using asp .net 2.0 & sql server 2000
Can anyone tell me how I can do that, or put me on track with some key words to google for?
thx.
Hi guys,
I'm pretty new in SQL Server and trying to build up a BI Solution for my firm. We have got monthly data about revenue headcounts and so, which should be integrated into a DW.
I was wondering whether there is an automated way to import this csv data in SQL like in a batch, because the users are not familiar with SQL Server at all. The structure of the data will be the same all the time, since it comes from legacy systems.
YOur help would be highly appriciated:)
demon
Hi All,
I have around 80 databases in my one of sql server instance.
we hve to regularly send the database wise health report to the client.
The following fields mentioned by the client in excel sheet
Name of database
Logical file name of .MDF
.Mdf File location drive
Size of the file in MB
Physical file location(full path of .mdf file)
Maxsize
Growth
Now a days we have to check databases one by one.
Could anyone provide me the script which automatically fetch all of required fields information from all of the databases.
Urgent help will be appreciable.
Frozen
Was unsure where to place this post.
Windows Server 2003R2 w/ Sp2
MS SQL 2005
I currently use MS SQL 2005 to host my Citrix Datastore DB. I manually run a daily back up (Tasks>Backup).
How difficult would this be to automated? I have googled this without luck.
Any insight appreciated.
Thanks,
Kerry
Unfortunately don't I know, how I can adjust this or whether SQL code is needed and if, where?? I do not know myself unfortunately yet so well with the subject out, from therefore am grateful I for each assistance. Many greetings M-l-g
Hello,
I have a problem with an integration services project of SQL server 2005. I have a text file with various data, which can be read out easily with a dataflow task and a flat file source. The data shall be transferred into a target database which I developed according to a star pattern. The fact table can be generated automatically if and only if all data belonging to a dimension table is inserted by myself. Of course, this procedure is not reasonable while having a vast amount of data. That is the reason why I want to generate the dimension tables automatically, too. A dimension is build e.g. like this: ApplicationID | ApplicationName. So, only two columns are available. But I don't know how to insert an automated ID.
I would be thankful for any help.M-l-G
Hi,
how would i unzip a password protected file after downloading it from sftp server.
thanks
We have automated the process of backing up and restoring the databases. But the problem is One database is restoring from several hrs ..though it is supposed to take only a few mins. So there is some issue with it and I want to find out how I can stop the restoring process.
Its not a command am running in query analyser or Enterprise manager, but its automated so i cant see the command to stop it.
Any ideas?
Hi
I am using asp.net framwork 2 with sql 2005 express edition. Can anyone please provide me any sample of sending automated emails (like welcoming people when they register to my website, or if their personal details have been updated....). or any e-book/website ref will do. I am not very expert in sql/db and smtp (or other email) stuffs. So please help me.
With thanks
Where can i learn about making the sql server execute task when a certain situation happens. Like lets say make the server delete all entrys older than 40 days? Or have a entry deleted automatically when a certain situation happens like lets say it take 4 votes and a entry get deleted how do i make it do that automatically
View 2 Replies View RelatedI need to create an Automated DTS package. At present I am running it manually each morning to import our phone switch data to an SQL table. The reason I had to go this route is this.
Because the Access tables are locked, I have a System DSN that connects to the System.mda file, this in turn gives me access to the locked tables to extract the data I need into Excel. I then drop the existing SQL table and run the DTS package recreating the SQL table with the data from the Excel file. I do not want to use OLEDB to connect to the Access table from within my application because it changes each month and of course the traffic load, I have as many 150 clients hitting the DB at one time.
I actually need the DTS package to update the SQL table with the latest data.
I'm no DTS guru, so how can I do this automagically?
Here's my process:
1. I have a form where someone enters certain criteria for some data…
2. The form than populates a record in a table with all the criteria…
3. I create a query based on the selected criteria for exporting…
How can I automate the process (maybe using DTS) where SQL server will automatically export the data for me using a stor proc? Create a file, populate the file etc…. or will I need to create an external App to do this?
I have been playing around with the enterprise manager and selected Backup Database from the action menu and schedule this task for an odd time for testing.
How do I go about removing this task?
Whenever I go to the same menu item again, it just starts over .. like I don't have the task already setup.
In general, how do you remove automated tasks?
Thanks,
bf
I wish to select processes from sysprocess that are SLEEPING and more than a certain time old (say 10 minutes) so that I may KILL them. I can get the query to do the select, but how do I KILL the process? I have tried selecting the SPID into a local variable and then trying KILL @var_name, but I get "Incorrect syntax near '@var_name'".
I have tried all of the resources that I can find, but without success. Is this possible? If so, how do I go about doing it?
Thanks in advance.
Matthew