Tuesday, March 27, 2012
Automating Capacity planning of the disks
procedure of checking the total space available on the
disks on the server toavoid running out of space and to
avoid manual intervention. Any help please.See if this helps: http://www.sqldbatips.com/showcode.asp?ID=4
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"Aboki" <hcokoli@.yahoo.com> wrote in message
news:c24301c47a34$4a90d3f0$a301280a@.phx.gbl...
I will like to write a short code to automate the
procedure of checking the total space available on the
disks on the server toavoid running out of space and to
avoid manual intervention. Any help please.
automatically send a notice after 6 months (was "Date Question")
I'm trying to write a query that will do the following... I'll give a quick background:
When a machine is installed, I record an installation date. We would like to automatically send a notice to our customers 6 months past this install date regarding scheduled maintenance.
Right now all I have is the notice, which is a report in Access with a query attached that pulls all machine sales that have install dates.
I'm not sure how to reference this situation... or how to start addressing the problem.
Basically:
Customer(CustomerID, CustomerName, CustomerEmail)
MachineDetail(DetailID, CustomerID, ModelID)
MachineModel(ModelID,ModelName)
InstallInfo(InstallID, DetailID, InstallComplete)
Please help :( Thanks,
CherishTry looking here (http://www.1keydata.com/sql/sql.html) or here (http://www.geocities.com/SiliconValley/Vista/2207/sql1.html) or here (http://www.w3schools.com/sql/default.asp).
;)|||use the DATEADD function
select ...
from ...
where InstallComplete
between dateadd("m",-6,date())
and dateadd("m",-5,date()) this will pull all installs between 5 and 6 months old
that way you can prepare the notices manually
sorry, no idea how to set up access to do this automatically
perhaps ask in the access forum|||Create a stored procedure starting with the code posted by r937, that selects the customers you want to send a notice to and either send an e-mail or write the notices to a file.
Create a batch script to execute this procedure ONCE per month, depending on your OS use:
1) Dos cmd and Win2K(XP) task scheduler or 2) Unix KSH and crontab or 3) Oracle jobs.
There have been many posts in this and other forums on how to send e-mail from either Oracle or MS SQL.
:rolleyes:
PS: Ooops, just noticed you mentioned Access...
I beleive you can e-mail the notices by having Access 'write' to Outlook.
Good Luck.|||LKBrwn_DBA, Access doesn't support stored procs|||LKBrwn_DBA, Access doesn't support stored procs
Yeah, I just noticed it was Access, but he can create a VB 'Procedure' or something like that. :(|||PS: Check these links:
MS Email FAQ (http://www.granite.ab.ca/access/email.htm) and MS ACCESS VB script (http://www.febooti.com/products/command-line-email/online-help/send-email-ms-access.html)
;)|||She, and thanks for all your help, I'll try out the suggestions today :)
Thursday, March 22, 2012
Automatically Delete Snapshots
snapshots based on age.
I know I could write code to do this. I was hoping there might be a setting
you could manage that said to remove all snapshots in this folder older then
30 days everyday at midnight.
DaveDo you mean execution snapshots? Why do you want to delete them? Or are you
taking about aging of history snapshots? If so, this one is on the feature
list for a future version but in the meantime you can write some code to do
it yourself.
--
Brian Welcker
Group Program Manager
Microsoft SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
"Dlloyd" <Dlloyd@.discussions.microsoft.com> wrote in message
news:29A9EA76-A6C3-45D4-9EDB-6F8A45215C34@.microsoft.com...
> Does anyone know of a way to set up the Report Server to automatically
> delete
> snapshots based on age.
> I know I could write code to do this. I was hoping there might be a
> setting
> you could manage that said to remove all snapshots in this folder older
> then
> 30 days everyday at midnight.
> Dave|||Thanks Brian...
I know I can write code to do it. I was hoping there might be a way to
configure the Report Server itself to remove reports older than a configured
number of days.
I'll do it myself and wait for the feature in another release.
Dave
"Brian Welcker [MS]" wrote:
> Do you mean execution snapshots? Why do you want to delete them? Or are you
> taking about aging of history snapshots? If so, this one is on the feature
> list for a future version but in the meantime you can write some code to do
> it yourself.
> --
> Brian Welcker
> Group Program Manager
> Microsoft SQL Server
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "Dlloyd" <Dlloyd@.discussions.microsoft.com> wrote in message
> news:29A9EA76-A6C3-45D4-9EDB-6F8A45215C34@.microsoft.com...
> > Does anyone know of a way to set up the Report Server to automatically
> > delete
> > snapshots based on age.
> >
> > I know I could write code to do this. I was hoping there might be a
> > setting
> > you could manage that said to remove all snapshots in this folder older
> > then
> > 30 days everyday at midnight.
> >
> > Dave
>
>sql
Monday, March 19, 2012
AUtomatic mail alert
HI,
I have to send an automatic e-mail based on database table .Could any body help me
how to write stored procedure and where to execute it.How to send an automatic e-mail through sql server?
Thanks in advance.
Regards,
Raja.
Hi Raja,
To send an email in a stored procedure in SQL Server, you can call xp_sendmail directly.
http://msdn2.microsoft.com/en-us/library/ms189505(SQL.90).aspx
Before this, you have to configure an extended MAPI mail profile. Here is a link for how to do it.
http://msdn2.microsoft.com/en-us/library/ms175189(SQL.90).aspx
However, you can also read data from the database table and do this in your .net application, using the System.Net.Mail.MailMessage class.
http://msdn2.microsoft.com/en-us/library/system.net.mail.mailmessage.aspx
HTH. If this does not answer your question, please feel free to mark the post as Not Answered and reply. Thank you!
Thursday, March 8, 2012
Automated client report rendering
certain reports. Is there a .NET client report rendering library that
is not dependent on IIS (as the SOAP/URL apis are), nor WinForms (as
the ReportViewer is)?
Thanks,
EvaAfter some research I've found one third-party product called the RDL
Project that renders RDL into HTML, PDF, and some other formats. It's
found at http://www.fyiReporting.com. I played with it, and its version
1.0.1 can't yet parse a report that I built in VS2005, although I think
it could if I removed a few unsupported things from the report and if I
studied its code a bit more (documentation seems lacking).
Hope this post helps someone else, and of course if you know of any
other options please let me know!
Wednesday, March 7, 2012
Automate SQL login account creation?
script that will create new SQL Server logins, passwords, and assign role
membership based on a table that contains all of the potential users? I was
hoping this would be possible for it to go through a table and automate this
instead of creating all of the SQL login accounts manually. Thanks in
advance.
JYou can use several system stored procedures below example.
EXEC sp_addlogin 'loginid', 'password', 'default database'
"J"?? ??? ??:
> Hello. Does anyone know if it's possible to write a stored procedure or
> script that will create new SQL Server logins, passwords, and assign role
> membership based on a table that contains all of the potential users? I w
as
> hoping this would be possible for it to go through a table and automate th
is
> instead of creating all of the SQL login accounts manually. Thanks in
> advance.
> J
>
>|||Thanks for your quick reply Hongju :-)
"hongju" <hongjujung@.hotmail.com.korea> wrote in message
news:D35AB19B-86E3-4A9E-A8E2-5CE0C157BC70@.microsoft.com...[vbcol=seagreen]
> You can use several system stored procedures below example.
> EXEC sp_addlogin 'loginid', 'password', 'default database'
>
> "J"' ? ':
>
Sunday, February 12, 2012
auto increase text!
I have an initial value like this:
'TEST0001'
I want to write a sql script that will automatically take that initial value
and keep adding 1 to it and insert into a table for me until it get to
'TEST9999'.
my table should now store:
TEST0001
TEST0002
...
...
TEST0010
TEST0011
...
...
TEST9999
How do I do this?
Thanks,
Tom ddeclare @.seed int
set @.seed = 1
while @.seed < 10000
begin
insert into tableName select 'TEST' + right('000' + cast(@.seed as
varchar(4)), 4)
set @.seed = @.seed + 1
end
"tom d" <tomd@.discussions.microsoft.com> wrote in message
news:1DB51C59-3F93-476E-91CE-6E7B4C7E7259@.microsoft.com...
> Hi,
> I have an initial value like this:
> 'TEST0001'
> I want to write a sql script that will automatically take that initial
> value
> and keep adding 1 to it and insert into a table for me until it get to
> 'TEST9999'.
> my table should now store:
> TEST0001
> TEST0002
> ...
> ...
> TEST0010
> TEST0011
> ...
> ...
> TEST9999
> How do I do this?
> Thanks,
> Tom d
>