显示标签为“method”的博文。显示所有博文
显示标签为“method”的博文。显示所有博文

2012年3月19日星期一

Any way logging or tracking method for dropped tables

Most of my tables is dropped after they are created. I cannot tell when this
happen. This include stored procedures as well. I checked the maintenance job
and none are dropping tables or stored procedures.
The funny part is my tables and stored procedure which is published out as
articles remain and not dropped as others. Why?
Is there any logs or tracking that can be put in place to find out who
deleted my tables?
Paul,
I'm using SQL Server 2000 so I guess I would need to use the log explorer
tool. Are there any recommendation which I can try first?
Another question which hopefully can narrow down my suspect here is..Do you
think replication dropped the tables?
Cheers,
Philip
"Paul Ibison" wrote:

> If you're on SQL Server 2005 you could set up ddl triggers to log who/what
> is performing the drops. Alternatively a 3rd party log explorer tool will
> have the info in it.
> HTH,
> Paul Ibison
>
>
|||Replication by default will drop tables on the subscriber, but never on the
publisher so i'd look elsewhere. The reason replicated objects haven't been
dropped is probably because once they're published, they have to be removed
from the publication to be allowed to be dropped, so that distinguishes them
from your other objects. (this is a bit of guesswork, but it makes sense).
Lumigent Log Explorer will audit DDL commands to help you figure out who did
the drop (http://lumigent.com/products/le_sql_faq.html#_I_do_not). If it
happens regularly then you could use profiler yourself to monitor for these
drops.
HTH,
Paul Ibison

2012年2月25日星期六

any method find the objects changed

i want to know is there any way to check any objects (table schema, sp,
trigger) changed at a period of time. say 5 days before.
i want to prepare the scripts for those modified objectsMullin wrote:
> i want to know is there any way to check any objects (table schema,
> sp, trigger) changed at a period of time. say 5 days before.
> i want to prepare the scripts for those modified objects
Not really... The crdate column in the sysobjects table always contains the
create date, not the last updated date.
But see:
Compare SQL Server Databases with sp_CompareDB
http://www.sql-server-performance.c...mparison_sp.asp
There is also a bunch of tools avaliable on the market for database
comparing, from www.apexsql.com or www.red-gate.com
sincerely,
--
Sebastian K. Zaklada
Skilled Software
http://www.skilledsoftware.com
This posting is provided "AS IS" with no warranties, and confers no rights.|||Sounds to me like you need change management for your SQL source code...
There are alot of tools out there that will compare, but for what you describe DB Ghost
is the solution. Check out www.dbghost.com|||Hi,
Try dbMaestro. It's a product that allows comparison, migration and archivin
g of database schema and data, and display the changes in tables with beauti
ful gui.
You can find it here:
http://www.extreme.co.il|||Have a look at this
http://www.nigelrivett.net/DMOScriptAllDatabases.html
It will give you the day things changed - depending on how often you run
it.
and this
http://www.nigelrivett.net/SQLServerReleaseControl.htm
Which will save you heving to do the previous one.
Nigel Rivett
www.nigelrivett.net
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!

2012年2月16日星期四

Any easy Class method to update about 100 fields of a database using stored procedure?

Hi all,

I am using C# for ASP.NEt 2003.

I would like to know if there is any easy method to update a database with about 100 fields in it.

At present, I pass all the values of the controls on the web form to the stored procedure as parameters like :-

myCommand.Parameters.Add("@.CustomerID", SqlDbType.Int).Value = txtCustomerID.text

Like this, I add all 100 parameters.

Is there any easy method to do it using a class or any other methods?

Thanking you in advance,

Tomy

I my opinion not, this is why Microsoft developed LINQ in C# 3.0.

To be able to create objects that can be passed as parameters.

|||

I assume that you have win form. It is possible to have a table in your application which will have field for each input data field on your form, you can bound your form controls to data so they will be automatically updated. Next you can use data adapter with insert and/or update statements(it can be your stored procedure) defined to run with parameters based on your table. I do not know if it will work for you but it is probably the only solution where you do not have to pass all your values to parameters of stored procedure.

Thanks