Tuesday, March 20, 2012
Authentication
i want that a user cannot login to EM with windows authentication..
ThankxxxMuhammad Bilal (MuhammadBilal@.discussions.microsoft.com) writes:
> i want that a user cannot login to EM with windows authentication..
Then don't give that user access to SQL Server. There is no way to lock
out a user from accessing SQL Server from a certain application. Thus,
you should never grant a user rights to do things you don't want him to do.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx
Monday, March 19, 2012
Auditing tables
I want to audit some collumns of one of my huge table . I wrote a trigger
for copying updated data and original data in audit table.
But when I try to update multiple rows , it gives error of "cannot update
multiple rows. "
Is there any easy way of auditing tables without using triggers . I donot
want to use C2-audit .
Regards,
Swati
swati
create trigger tru_MyTable on MyTable after update
as
if @.@.ROWCOUNT = 0
return
insert MyAuditTable
select
i.ID
, d.MyColumn
, i.MyColumn
from
inserted i
join
deleted d on d.ID = o.Id
go
"swati" <swati.zingade@.ugamsolutions.com> wrote in message
news:uNbsEK1uEHA.1308@.TK2MSFTNGP09.phx.gbl...
> HI!
> I want to audit some collumns of one of my huge table . I wrote a trigger
> for copying updated data and original data in audit table.
> But when I try to update multiple rows , it gives error of "cannot
update
> multiple rows. "
> Is there any easy way of auditing tables without using triggers . I donot
> want to use C2-audit .
> Regards,
> Swati
>
>
>
|||Thanks!! It works properly .
Regards,
Swati
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:ebvGMQ1uEHA.4084@.TK2MSFTNGP10.phx.gbl...[vbcol=seagreen]
> swati
> create trigger tru_MyTable on MyTable after update
> as
> if @.@.ROWCOUNT = 0
> return
> insert MyAuditTable
> select
> i.ID
> , d.MyColumn
> , i.MyColumn
> from
> inserted i
> join
> deleted d on d.ID = o.Id
> go
> "swati" <swati.zingade@.ugamsolutions.com> wrote in message
> news:uNbsEK1uEHA.1308@.TK2MSFTNGP09.phx.gbl...
trigger[vbcol=seagreen]
> update
donot
>
|||Hi ,
I am trying trigger for after delete /insert and update .
using below trigger , unable to insert data in myaudittable ..
Pls suggest , what changes should I make ?
Regards
"swati" <swati.zingade@.ugamsolutions.com> wrote in message news:...
> Thanks!! It works properly .
> Regards,
> Swati
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:ebvGMQ1uEHA.4084@.TK2MSFTNGP10.phx.gbl...
> trigger
> donot
>
|||What error are you getting? Please post your actual trigger code and table
DDL.
Hope this helps.
Dan Guzman
SQL Server MVP
"swati" <swati.zingade@.ugamsolutions.com> wrote in message
news:O$InOPAvEHA.1520@.TK2MSFTNGP11.phx.gbl...
> Hi ,
> I am trying trigger for after delete /insert and update .
> using below trigger , unable to insert data in myaudittable ..
> Pls suggest , what changes should I make ?
> Regards
>
> "swati" <swati.zingade@.ugamsolutions.com> wrote in message news:...
>
|||Thanks dan . There was some silly mistake I did in coding . Instead of using
full outer joins ,I was using normal joins ,so was not able to get the
deleted records .Now it's working fine.
regards,
Swati.
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:ulLkEBCvEHA.2196@.TK2MSFTNGP14.phx.gbl...
> What error are you getting? Please post your actual trigger code and
table[vbcol=seagreen]
> DDL.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "swati" <swati.zingade@.ugamsolutions.com> wrote in message
> news:O$InOPAvEHA.1520@.TK2MSFTNGP11.phx.gbl...
"cannot
>
Auditing tables
I want to audit some collumns of one of my huge table . I wrote a trigger
for copying updated data and original data in audit table.
But when I try to update multiple rows , it gives error of "cannot update
multiple rows. "
Is there any easy way of auditing tables without using triggers . I donot
want to use C2-audit .
Regards,
Swatiswati
create trigger tru_MyTable on MyTable after update
as
if @.@.ROWCOUNT = 0
return
insert MyAuditTable
select
i.ID
, d.MyColumn
, i.MyColumn
from
inserted i
join
deleted d on d.ID = o.Id
go
"swati" <swati.zingade@.ugamsolutions.com> wrote in message
news:uNbsEK1uEHA.1308@.TK2MSFTNGP09.phx.gbl...
> HI!
> I want to audit some collumns of one of my huge table . I wrote a trigger
> for copying updated data and original data in audit table.
> But when I try to update multiple rows , it gives error of "cannot
update
> multiple rows. "
> Is there any easy way of auditing tables without using triggers . I donot
> want to use C2-audit .
> Regards,
> Swati
>
>
>|||Thanks!! It works properly .
Regards,
Swati
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:ebvGMQ1uEHA.4084@.TK2MSFTNGP10.phx.gbl...
> swati
> create trigger tru_MyTable on MyTable after update
> as
> if @.@.ROWCOUNT = 0
> return
> insert MyAuditTable
> select
> i.ID
> , d.MyColumn
> , i.MyColumn
> from
> inserted i
> join
> deleted d on d.ID = o.Id
> go
> "swati" <swati.zingade@.ugamsolutions.com> wrote in message
> news:uNbsEK1uEHA.1308@.TK2MSFTNGP09.phx.gbl...
trigger[vbcol=seagreen]
> update
donot[vbcol=seagreen]
>|||Hi ,
I am trying trigger for after delete /insert and update .
using below trigger , unable to insert data in myaudittable ..
Pls suggest , what changes should I make ?
Regards
"swati" <swati.zingade@.ugamsolutions.com> wrote in message news:...
> Thanks!! It works properly .
> Regards,
> Swati
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:ebvGMQ1uEHA.4084@.TK2MSFTNGP10.phx.gbl...
> trigger
> donot
>|||What error are you getting? Please post your actual trigger code and table
DDL.
Hope this helps.
Dan Guzman
SQL Server MVP
"swati" <swati.zingade@.ugamsolutions.com> wrote in message
news:O$InOPAvEHA.1520@.TK2MSFTNGP11.phx.gbl...
> Hi ,
> I am trying trigger for after delete /insert and update .
> using below trigger , unable to insert data in myaudittable ..
> Pls suggest , what changes should I make ?
> Regards
>
> "swati" <swati.zingade@.ugamsolutions.com> wrote in message news:...
>|||Thanks dan . There was some silly mistake I did in coding . Instead of using
full outer joins ,I was using normal joins ,so was not able to get the
deleted records .Now it's working fine.
regards,
Swati.
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:ulLkEBCvEHA.2196@.TK2MSFTNGP14.phx.gbl...
> What error are you getting? Please post your actual trigger code and
table
> DDL.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "swati" <swati.zingade@.ugamsolutions.com> wrote in message
> news:O$InOPAvEHA.1520@.TK2MSFTNGP11.phx.gbl...
"cannot[vbcol=seagreen]
>
Thursday, March 8, 2012
audit/history without use of triggers?
I am looking to implement an audit/history table/tables but am looking
at doing this without the use of triggers.
The reason for doing this is that the application is highly
transactional and speed in critical areas is important.
I am worried that triggers would slow things down.
I am more used to other database where by there is a utility to "dump"
the contents of the transaction logs and use this for auditing
purposes. However SQL Server does not have this functionality (unless
there is a sql server tool - 3rd party that I do not know about)
Has anyone implemented something similar? Or used/using a 3rd party
tool that will do this job.
Effectively the clients would like to "look" at what happened - say 15
minutes ago.
thanks
john"John Pan" <panjo03@.hotmail.com> wrote in message
news:dc85ec7c.0311261223.48827012@.posting.google.c om...
> Hi
> I am looking to implement an audit/history table/tables but am looking
> at doing this without the use of triggers.
> The reason for doing this is that the application is highly
> transactional and speed in critical areas is important.
> I am worried that triggers would slow things down.
> I am more used to other database where by there is a utility to "dump"
> the contents of the transaction logs and use this for auditing
> purposes. However SQL Server does not have this functionality (unless
> there is a sql server tool - 3rd party that I do not know about)
> Has anyone implemented something similar? Or used/using a 3rd party
> tool that will do this job.
> Effectively the clients would like to "look" at what happened - say 15
> minutes ago.
> thanks
> john
There's nothing in SQL Server itself, but there is at least one third party
product available which looks like it may meet your requirements:
http://www.lumigent.com/products/entegra/entegra.htm
Simon|||thanks Simon for your reply - I'll have a look at entegra
regards|||John:
Check out these products:
http://www.apexsql.com/index_lognavigator.htm
http://www.lumigent.com/products/le_sql/le_sql.htm
HTH,
BZ
panjo03@.hotmail.com (John Pan) wrote in message news:<dc85ec7c.0311261223.48827012@.posting.google.com>...
> Hi
> I am looking to implement an audit/history table/tables but am looking
> at doing this without the use of triggers.
> The reason for doing this is that the application is highly
> transactional and speed in critical areas is important.
> I am worried that triggers would slow things down.
> I am more used to other database where by there is a utility to "dump"
> the contents of the transaction logs and use this for auditing
> purposes. However SQL Server does not have this functionality (unless
> there is a sql server tool - 3rd party that I do not know about)
> Has anyone implemented something similar? Or used/using a 3rd party
> tool that will do this job.
> Effectively the clients would like to "look" at what happened - say 15
> minutes ago.
> thanks
> john
Thursday, February 16, 2012
Attaching SQL Database in 2005 from CD-ROM
I am trying to attach a database on a CD-ROM using the following command
exec sp_attach_db dbname='dbname',
filename1='d:\dbname.mdf',
filename2='d:\dbname.ldf'
and I am getting the following error
Msg 3415, Level 16, State 1, Line 1
Database 'dbname' cannot be upgraded because it is read-only or has
read-only files. Make the database or files writeable, and rerun recovery.
Any Help would be appreciated.
TIA
-srini
Its working on SQL 2000 Server. I am wondering is there a work-around for
SQL 2005.
-srini
"srini" wrote:
> Hi:
> I am trying to attach a database on a CD-ROM using the following command
> exec sp_attach_db dbname='dbname',
> filename1='d:\dbname.mdf',
> filename2='d:\dbname.ldf'
> and I am getting the following error
> Msg 3415, Level 16, State 1, Line 1
> Database 'dbname' cannot be upgraded because it is read-only or has
> read-only files. Make the database or files writeable, and rerun recovery.
>
> Any Help would be appreciated.
> TIA
> -srini
|||SQL needs upgradte the db and the cdrom is read only,upgrade from hard disk
and then save to cdrom
"srini" <srini@.discussions.microsoft.com> escribi en el mensaje
news:A8B27EC6-2370-4596-8FF2-E505147BB62D@.microsoft.com...
> Hi:
> I am trying to attach a database on a CD-ROM using the following command
> exec sp_attach_db dbname='dbname',
> filename1='d:\dbname.mdf',
> filename2='d:\dbname.ldf'
> and I am getting the following error
> Msg 3415, Level 16, State 1, Line 1
> Database 'dbname' cannot be upgraded because it is read-only or has
> read-only files. Make the database or files writeable, and rerun recovery.
>
> Any Help would be appreciated.
> TIA
> -srini
|||Look at this page from BOL:
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/fd717bec-b389-4b1e-936c-a4ccf75dba77.htm
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"srini" <srini@.discussions.microsoft.com> wrote in message
news:A8B27EC6-2370-4596-8FF2-E505147BB62D@.microsoft.com...
> Hi:
> I am trying to attach a database on a CD-ROM using the following command
> exec sp_attach_db dbname='dbname',
> filename1='d:\dbname.mdf',
> filename2='d:\dbname.ldf'
> and I am getting the following error
> Msg 3415, Level 16, State 1, Line 1
> Database 'dbname' cannot be upgraded because it is read-only or has
> read-only files. Make the database or files writeable, and rerun recovery.
>
> Any Help would be appreciated.
> TIA
> -srini
|||Thanks Geoff for a quick reply.
I read and tried the same it works. Thanks a lot.
Just in case if some one, needs step by step guidelines
Step1:
EXEC sp_create_removable 'exportdb',
'exportdbsys',
'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\exportdbsys.mdf', 2,
'exportdblog',
'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\exportdblog.ldf', 2,
'exportdbdata',
'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\exportdbdata.ndf', 2
Step2:
Exported all objects that I wanted into this db through context menu optoin
"Export "
Step3:
sp_certify_removable exportdb
Step4:
Took the db offline.
Step5:
Copied the files on CD-ROM
Step6:
Deleted exportdb
Step7:
Attached the exportdb as exportdb1 as follows
sp_attach_db @.dbname = 'exportdb1',
@.filename1 = 'd:\exportdbsys.mdf',
@.filename2 = 'd:\exportdbdata.ndf',
@.filename3 = 'd:\exportdblog.ldf'
step8:
Verified the db works with simple select statement.
-srini
"Geoff N. Hiten" wrote:
> Look at this page from BOL:
> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/fd717bec-b389-4b1e-936c-a4ccf75dba77.htm
> --
> Geoff N. Hiten
> Senior Database Administrator
> Microsoft SQL Server MVP
>
> "srini" <srini@.discussions.microsoft.com> wrote in message
> news:A8B27EC6-2370-4596-8FF2-E505147BB62D@.microsoft.com...
>
|||Thanks Luis Tarzia.
My requirement is to use the database on CD-ROM as read-only database and I
want to be able to attach the db to any SQL 2005 and start using the same.
-srini
"Luis Tarzia" wrote:
> SQL needs upgradte the db and the cdrom is read only,upgrade from hard disk
> and then save to cdrom
> "srini" <srini@.discussions.microsoft.com> escribió en el mensaje
> news:A8B27EC6-2370-4596-8FF2-E505147BB62D@.microsoft.com...
>
>
Attaching SQL Database in 2005 from CD-ROM
I am trying to attach a database on a CD-ROM using the following command
exec sp_attach_db dbname='dbname',
filename1='d:\dbname.mdf',
filename2='d:\dbname.ldf'
and I am getting the following error
Msg 3415, Level 16, State 1, Line 1
Database 'dbname' cannot be upgraded because it is read-only or has
read-only files. Make the database or files writeable, and rerun recovery.
Any Help would be appreciated.
TIA
-sriniIts working on SQL 2000 Server. I am wondering is there a work-around for
SQL 2005.
-srini
"srini" wrote:
> Hi:
> I am trying to attach a database on a CD-ROM using the following command
> exec sp_attach_db dbname='dbname',
> filename1='d:\dbname.mdf',
> filename2='d:\dbname.ldf'
> and I am getting the following error
> Msg 3415, Level 16, State 1, Line 1
> Database 'dbname' cannot be upgraded because it is read-only or has
> read-only files. Make the database or files writeable, and rerun recovery.
>
> Any Help would be appreciated.
> TIA
> -srini|||SQL needs upgradte the db and the cdrom is read only,upgrade from hard disk
and then save to cdrom
"srini" <srini@.discussions.microsoft.com> escribi en el mensaje
news:A8B27EC6-2370-4596-8FF2-E505147BB62D@.microsoft.com...
> Hi:
> I am trying to attach a database on a CD-ROM using the following command
> exec sp_attach_db dbname='dbname',
> filename1='d:\dbname.mdf',
> filename2='d:\dbname.ldf'
> and I am getting the following error
> Msg 3415, Level 16, State 1, Line 1
> Database 'dbname' cannot be upgraded because it is read-only or has
> read-only files. Make the database or files writeable, and rerun recovery.
>
> Any Help would be appreciated.
> TIA
> -srini|||Look at this page from BOL:
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/fd717bec-b389-4b1e-936c-a4cc
f75dba77.htm
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"srini" <srini@.discussions.microsoft.com> wrote in message
news:A8B27EC6-2370-4596-8FF2-E505147BB62D@.microsoft.com...
> Hi:
> I am trying to attach a database on a CD-ROM using the following command
> exec sp_attach_db dbname='dbname',
> filename1='d:\dbname.mdf',
> filename2='d:\dbname.ldf'
> and I am getting the following error
> Msg 3415, Level 16, State 1, Line 1
> Database 'dbname' cannot be upgraded because it is read-only or has
> read-only files. Make the database or files writeable, and rerun recovery.
>
> Any Help would be appreciated.
> TIA
> -srini|||Thanks Geoff for a quick reply.
I read and tried the same it works. Thanks a lot.
Just in case if some one, needs step by step guidelines
Step1:
EXEC sp_create_removable 'exportdb',
'exportdbsys',
'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\exportdbsys.mdf', 2,
'exportdblog',
'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\exportdblog.ldf', 2,
'exportdbdata',
'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\exportdbdata.ndf', 2
Step2:
Exported all objects that I wanted into this db through context menu optoin
"Export "
Step3:
sp_certify_removable exportdb
Step4:
Took the db offline.
Step5:
Copied the files on CD-ROM
Step6:
Deleted exportdb
Step7:
Attached the exportdb as exportdb1 as follows
sp_attach_db @.dbname = 'exportdb1',
@.filename1 = 'd:\exportdbsys.mdf',
@.filename2 = 'd:\exportdbdata.ndf',
@.filename3 = 'd:\exportdblog.ldf'
step8:
Verified the db works with simple select statement.
-srini
"Geoff N. Hiten" wrote:
> Look at this page from BOL:
> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/fd717bec-b389-4b1e-936c-a4
ccf75dba77.htm
> --
> Geoff N. Hiten
> Senior Database Administrator
> Microsoft SQL Server MVP
>
> "srini" <srini@.discussions.microsoft.com> wrote in message
> news:A8B27EC6-2370-4596-8FF2-E505147BB62D@.microsoft.com...
>|||Thanks Luis Tarzia.
My requirement is to use the database on CD-ROM as read-only database and I
want to be able to attach the db to any SQL 2005 and start using the same.
-srini
"Luis Tarzia" wrote:
> SQL needs upgradte the db and the cdrom is read only,upgrade from hard dis
k
> and then save to cdrom
> "srini" <srini@.discussions.microsoft.com> escribió en el mensaje
> news:A8B27EC6-2370-4596-8FF2-E505147BB62D@.microsoft.com...
>
>