Showing posts with label regards. Show all posts
Showing posts with label regards. Show all posts

Wednesday, March 28, 2012

Is there a place where i can find the events that takes place in sql server?

Is there a place where i can find events that takes place in the sql server? Like adding data to a database or something like that....

Regards

Karen

Sure. Triggers. What did you have in mind?

>L<

|||something like a log file that keeps track of things that have inserted, updated or deleted from the Dbase|||

You can write triggers on both a table- and database- level for that. You decide what events you want to capture, and what detail. I typically write to a table, I suppose most people do. If you have a targeted requirement (IOW, you don't just want "every" event, you have a goal in mind), you should look into doing this. If you have trouble understanding how to write the trigger when the event applies across multiple rows, holler, although this is really not the right forum for that discussion <s>.

Events that change data are also logged automatically, even if they are not in transactions. You can get some information out using third party tools -- see this thread http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1423816&SiteId=1.

You can also use DBCC LOGINFO (see an old article http://www.mssqlcity.com/Articles/KnowHow/ViewLog.htm and a slightly better one here http://www.sqlservercentral.com/columnists/achigrik/sqlserver7someusefulundocumenteddbcccommands.asp#part_2_8) but it may not get you where you're going.

>L<

Monday, February 20, 2012

Is Null

Hi,
I have a silly doubt. Please tell me whether "Is Null" is a contraint
or not? If yes then why it does not show in sysconstraints view?
Regards
Arijit ChatterjeeOn May 2, 11:11 am, arijitchatterjee...@.yahoo.co.in wrote:
> Hi,
> I have a silly doubt. Please tell me whether "Is Null" is a contraint
> or not? If yes then why it does not show in sysconstraints view?
> Regards
> Arijit Chatterjee
Sorry little modification instead of "Is Null" I want to say "Not Null"|||It depends on who you ask. Technically, NOT NULL is not a constraint in SQL Server, if we by
"constraint" mean what syntax we used for other constraints, like:
ALTER TABLE ... ADD CONSTRAINT...
So, in SQL Server, NOT NULL is more like a column attribute. Of course, NOT NULL does constraint
what you are allowed to put in that column, so seen from that viewpoint, NOT NULL is a constraint.
I believe that in ANSI SQL, NOT NULL is indeed a "constraint" similar to CHECK and FOREIGN KEY,
possibly represented in the system catalog as such.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
<arijitchatterjee123@.yahoo.co.in> wrote in message
news:1178086362.445723.175660@.q75g2000hsh.googlegroups.com...
> On May 2, 11:11 am, arijitchatterjee...@.yahoo.co.in wrote:
>> Hi,
>> I have a silly doubt. Please tell me whether "Is Null" is a contraint
>> or not? If yes then why it does not show in sysconstraints view?
>> Regards
>> Arijit Chatterjee
> Sorry little modification instead of "Is Null" I want to say "Not Null"
>|||On May 2, 11:49 am, "Tibor Karaszi"
<tibor_please.no.email_kara...@.hotmail.nomail.com> wrote:
> It depends on who you ask. Technically, NOT NULL is not a constraint in SQL Server, if we by
> "constraint" mean what syntax we used for other constraints, like:
> ALTER TABLE ... ADD CONSTRAINT...
> So, in SQL Server, NOT NULL is more like a column attribute. Of course, NOT NULL does constraint
> what you are allowed to put in that column, so seen from that viewpoint, NOT NULL is a constraint.
> I believe that in ANSI SQL, NOT NULL is indeed a "constraint" similar to CHECK and FOREIGN KEY,
> possibly represented in the system catalog as such.
> --
> Tibor Karaszi, SQL Server MVPhttp://www.karaszi.com/sqlserver/default.asphttp://sqlblog.com/blogs/tibor_karaszi
> <arijitchatterjee...@.yahoo.co.in> wrote in message
> news:1178086362.445723.175660@.q75g2000hsh.googlegroups.com...
>
> > On May 2, 11:11 am, arijitchatterjee...@.yahoo.co.in wrote:
> >> Hi,
> >> I have a silly doubt. Please tell me whether "Is Null" is a contraint
> >> or not? If yes then why it does not show in sysconstraints view?
> >> Regards
> >> Arijit Chatterjee
> > Sorry little modification instead of "Is Null" I want to say "Not Null"- Hide quoted text -
> - Show quoted text -
Thanks a bunch...