Showing posts with label sql-server. Show all posts
Showing posts with label sql-server. Show all posts

Tuesday, March 27, 2012

Auto deletion of records sqlserver

Hi

I am not sure if I am at right place, anyhow I hope I am :)


Now the question: I am using an ASP.net Application with SQL-Server. I want to make a page so that it set the expiration time (date) for certain record and once that time reaches, it deletes those records, or make any updates to the record (what ever applicable). I also want to control this auto deletion from my application, means that turn this On/Off whenever needed. I am not sure how to start this. I was told by a friend that I need to use triggers from SQL-server but I need some help. Can anyone help me out on this?


Regards
Mykhan

A trigger will not expire the record; you will need to create a windows service or create a SQL job to delete the expired records. Alternatively you could add the following clause to your list select

AND (ExpiryDate is Null OR ExpiryDate > GetDate())

The latter would not delete the record but would achieve the same effect.

sql

Sunday, March 11, 2012

Auditing on SQL-server.

Hello Readers,
I am looking for ways of auditing in SQL-server.
Using Google I am a bit overwhelmed with solutions.
At the moment we are looking at limited auditing, where
the following has to be audited :
user, date_time, some specific database mutations.
Offcourse we want it :
Fast, Good, Cheap.
My thought up to now :
1. Logging of SQLserver (not too suitable for reading).
2. Profiler (not too suitable for continues use and rather limited for
data).
3. Triggers (Expensive in resources ?)
4. Special tools. (This is the part I am overwhelmed with).
Any good pointers ?
(Google search words, specific sites, solutions ?)
Thanks,
Ben BrugmanFound this link :
http://www.akadia.com/services/sqlsrv_table_auditing.html
More suggestions are welcome.
Ben
"ben brugman" <ben@.niethier.nl> wrote in message
news:uLqgP4d5FHA.4076@.tk2msftngp13.phx.gbl...
> Hello Readers,
> I am looking for ways of auditing in SQL-server.
> Using Google I am a bit overwhelmed with solutions.
> At the moment we are looking at limited auditing, where
> the following has to be audited :
> user, date_time, some specific database mutations.
> Offcourse we want it :
> Fast, Good, Cheap.
> My thought up to now :
> 1. Logging of SQLserver (not too suitable for reading).
> 2. Profiler (not too suitable for continues use and rather limited for
> data).
> 3. Triggers (Expensive in resources ?)
> 4. Special tools. (This is the part I am overwhelmed with).
> Any good pointers ?
> (Google search words, specific sites, solutions ?)
> Thanks,
> Ben Brugman
>|||Depends on exactly what you need to audit. Some of the less expensive 3rd
party tools such as
http://www.red-gate.com/products/SQL_Log_Rescue/index.htm
are quick and easy. At those prices you can't develop a comparable auditor
yourself for the price. In SQL 2005 it gets even easier with the new DDL
triggers and information available via triggers. Here are some more
options:
http://www.aspfaq.com/show.asp?id=2496
http://www.aspfaq.com/show.asp?id=2448
Andrew J. Kelly SQL MVP
"ben brugman" <ben@.niethier.nl> wrote in message
news:uLqgP4d5FHA.4076@.tk2msftngp13.phx.gbl...
> Hello Readers,
> I am looking for ways of auditing in SQL-server.
> Using Google I am a bit overwhelmed with solutions.
> At the moment we are looking at limited auditing, where
> the following has to be audited :
> user, date_time, some specific database mutations.
> Offcourse we want it :
> Fast, Good, Cheap.
> My thought up to now :
> 1. Logging of SQLserver (not too suitable for reading).
> 2. Profiler (not too suitable for continues use and rather limited for
> data).
> 3. Triggers (Expensive in resources ?)
> 4. Special tools. (This is the part I am overwhelmed with).
> Any good pointers ?
> (Google search words, specific sites, solutions ?)
> Thanks,
> Ben Brugman
>

Auditing on SQL-server.

Hello Readers,
I am looking for ways of auditing in SQL-server.
Using Google I am a bit overwhelmed with solutions.
At the moment we are looking at limited auditing, where
the following has to be audited :
user, date_time, some specific database mutations.
Offcourse we want it :
Fast, Good, Cheap.
My thought up to now :
1. Logging of SQLserver (not too suitable for reading).
2. Profiler (not too suitable for continues use and rather limited for
data).
3. Triggers (Expensive in resources ?)
4. Special tools. (This is the part I am overwhelmed with).
Any good pointers ?
(Google search words, specific sites, solutions ?)
Thanks,
Ben Brugman
Found this link :
http://www.akadia.com/services/sqlsr..._auditing.html
More suggestions are welcome.
Ben
"ben brugman" <ben@.niethier.nl> wrote in message
news:uLqgP4d5FHA.4076@.tk2msftngp13.phx.gbl...
> Hello Readers,
> I am looking for ways of auditing in SQL-server.
> Using Google I am a bit overwhelmed with solutions.
> At the moment we are looking at limited auditing, where
> the following has to be audited :
> user, date_time, some specific database mutations.
> Offcourse we want it :
> Fast, Good, Cheap.
> My thought up to now :
> 1. Logging of SQLserver (not too suitable for reading).
> 2. Profiler (not too suitable for continues use and rather limited for
> data).
> 3. Triggers (Expensive in resources ?)
> 4. Special tools. (This is the part I am overwhelmed with).
> Any good pointers ?
> (Google search words, specific sites, solutions ?)
> Thanks,
> Ben Brugman
>
|||Depends on exactly what you need to audit. Some of the less expensive 3rd
party tools such as
http://www.red-gate.com/products/SQL...scue/index.htm
are quick and easy. At those prices you can't develop a comparable auditor
yourself for the price. In SQL 2005 it gets even easier with the new DDL
triggers and information available via triggers. Here are some more
options:
http://www.aspfaq.com/show.asp?id=2496
http://www.aspfaq.com/show.asp?id=2448
Andrew J. Kelly SQL MVP
"ben brugman" <ben@.niethier.nl> wrote in message
news:uLqgP4d5FHA.4076@.tk2msftngp13.phx.gbl...
> Hello Readers,
> I am looking for ways of auditing in SQL-server.
> Using Google I am a bit overwhelmed with solutions.
> At the moment we are looking at limited auditing, where
> the following has to be audited :
> user, date_time, some specific database mutations.
> Offcourse we want it :
> Fast, Good, Cheap.
> My thought up to now :
> 1. Logging of SQLserver (not too suitable for reading).
> 2. Profiler (not too suitable for continues use and rather limited for
> data).
> 3. Triggers (Expensive in resources ?)
> 4. Special tools. (This is the part I am overwhelmed with).
> Any good pointers ?
> (Google search words, specific sites, solutions ?)
> Thanks,
> Ben Brugman
>

Auditing on SQL-server.

Hello Readers,
I am looking for ways of auditing in SQL-server.
Using Google I am a bit overwhelmed with solutions.
At the moment we are looking at limited auditing, where
the following has to be audited :
user, date_time, some specific database mutations.
Offcourse we want it :
Fast, Good, Cheap.
My thought up to now :
1. Logging of SQLserver (not too suitable for reading).
2. Profiler (not too suitable for continues use and rather limited for
data).
3. Triggers (Expensive in resources ?)
4. Special tools. (This is the part I am overwhelmed with).
Any good pointers ?
(Google search words, specific sites, solutions ?)
Thanks,
Ben BrugmanFound this link :
http://www.akadia.com/services/sqls...e_auditing.html
More suggestions are welcome.
Ben
"ben brugman" <ben@.niethier.nl> wrote in message
news:uLqgP4d5FHA.4076@.tk2msftngp13.phx.gbl...
> Hello Readers,
> I am looking for ways of auditing in SQL-server.
> Using Google I am a bit overwhelmed with solutions.
> At the moment we are looking at limited auditing, where
> the following has to be audited :
> user, date_time, some specific database mutations.
> Offcourse we want it :
> Fast, Good, Cheap.
> My thought up to now :
> 1. Logging of SQLserver (not too suitable for reading).
> 2. Profiler (not too suitable for continues use and rather limited for
> data).
> 3. Triggers (Expensive in resources ?)
> 4. Special tools. (This is the part I am overwhelmed with).
> Any good pointers ?
> (Google search words, specific sites, solutions ?)
> Thanks,
> Ben Brugman
>|||Depends on exactly what you need to audit. Some of the less expensive 3rd
party tools such as
http://www.red-gate.com/products/SQ...escue/index.htm
are quick and easy. At those prices you can't develop a comparable auditor
yourself for the price. In SQL 2005 it gets even easier with the new DDL
triggers and information available via triggers. Here are some more
options:
http://www.aspfaq.com/show.asp?id=2496
http://www.aspfaq.com/show.asp?id=2448
Andrew J. Kelly SQL MVP
"ben brugman" <ben@.niethier.nl> wrote in message
news:uLqgP4d5FHA.4076@.tk2msftngp13.phx.gbl...
> Hello Readers,
> I am looking for ways of auditing in SQL-server.
> Using Google I am a bit overwhelmed with solutions.
> At the moment we are looking at limited auditing, where
> the following has to be audited :
> user, date_time, some specific database mutations.
> Offcourse we want it :
> Fast, Good, Cheap.
> My thought up to now :
> 1. Logging of SQLserver (not too suitable for reading).
> 2. Profiler (not too suitable for continues use and rather limited for
> data).
> 3. Triggers (Expensive in resources ?)
> 4. Special tools. (This is the part I am overwhelmed with).
> Any good pointers ?
> (Google search words, specific sites, solutions ?)
> Thanks,
> Ben Brugman
>