Showing posts with label assume. Show all posts
Showing posts with label assume. Show all posts

Sunday, March 11, 2012

Auditing Status of a Trigger in SQL Server 2005

I need to know when a DML trigger changes state (from enabled to disabled, and disabled to enabled).

I **assume** this info is not in any of the standard SQL Server 2005 loags and find no entry relating to triggers being enabled/disabled.

Therefore I also *assume* the best way to do this is create a DDL Trigger and populate a table when a trigger status is changed.

Am I on the right track?

Has anyone done this? Code samples/links to solution?

Is there a simplier way <i'm all about simple>?

Thanks in advance.

Thats exactly the right direction, if you need a quikc sample for using DDL events, take a look at the DDL event definition in the BOL and perhpas at the slightly different samples on my website: http://sqlserver2005.de/articles/2/

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

Sunday, February 12, 2012

attaching a .mdf file to the MSSQL 2000 using commandline

Hi ,

we have a requirement to create a database of our application in client's system. and we assume that already MS Sql server is installed.

we have a .mdf file of our database. Is there any way I can attach .mdf file to the database using command line. so that I can write a batch file and run that batch to create the database in our client's system.

-regards

GRK

you can use SQL scripting method. If it is sql server 2005 then use SQLCMD -q and if it is sql server 2000 then use OSQL -q option.

Madhu

|||

Look in Books Online about the usage of [ sp_attach_single_file ].

|||

thanks Arnie,

its working. I used the [sp_attach_single_file] with osql from the command prompt and created a database.

-regards

GRK