How To Find Who Is Deleted The Database Or Object?

Aug 5, 2003

Hi,
I wanted find the log information if anybody deleted my database or bojects in my server.
Is it possible we can able to find this details in my previous log or any sys tables ?
Thanks

View 4 Replies


ADVERTISEMENT

Anything That You Find In SQL Object Scripts, You Can Also Find Them In System Tables?

Jul 26, 2005

I tried all the INFORMATION_SCHEMA on SQL 2000 andI see that the system tables hold pretty much everything I aminterested in: Objects names (columns, functions, stored procedures, ...)stored procedure statements in syscomments table.My questions are:If you script your whole database everything you end up havingin the text sql scripts, are those also located in the system tables?That means i could simply read those system tables to get any informationI would normally look in the sql script files?Can i quickly generate a SQL statement of all the indexes on my database?I read many places that Microsoftsays not to modify anything in those tables and not query them since theirstructure might change in future SQL versions.Is it safe to use and rely the system tables?I basically want to do at least fetching of information i want from thesystem tables rather than the SQL script files.I also want to know if it's pretty safe for me to make changes in thesetables.Can i rename an object name for example an Index name, a Stored Procedurename?Can i add a new column in the syscolumns table for a user table?Thank you

View 4 Replies View Related

Find Out Who Deleted Rows?

Jan 20, 2004

Yesterday, I had an occurence where someone (one of our developers :) ) deleted many vital rows in a database. I was able to recover via a backup but I'd like to see what was run to delete those rows, when and who if possible? I have the transaction log and the _log.ldf.

Can I read those somehow to find out this information? I have since added auditing to said tables, but I'd really like to go back and see what happened?

I do know about Lumigent, but is there a different production/solution?

Thoughts?

Thank you

View 2 Replies View Related

How To Find How A Record Was Deleted

Jul 23, 2005

Is there a way to tell who or what process deleted a record in a SQL table.I know you can setup triggers or Profiler - but is there a way to see how arecord was deleted if you DO NOT have a trigger or Profiler already running?This is SQL 2000 Standard, sp3a with default options and configuration.Thanks

View 2 Replies View Related

Find Missing/deleted Records?

Jul 20, 2005

I have 2 tables say table1 and table2 with the same structure. Each recordis identified by a field 'SerialNo'. Now there should be a total of 500000records in both tables with serialno from 1 to 500000. Either a record is intable1 or table2. I want to find records (or SerialNo's) that are inneither table (if deleted by accident etc). What would be the sql query?I'm using SQL 6.5thx

View 2 Replies View Related

SQLServer2000/SP4 Connection To Application Object Failed - Ensure No Program Modules Have Been Deleted

Aug 30, 2007

Hi

I have SQL Server 2000 (SP4) running on an Windows 2003 SP 1 server. I have started to get the error message "Connection to application object failed - Ensure no program modules have been deleted" when I go into Enterprise Manager.

I have tried reinstalled SQL Server and applied SP4 but to no effect. Can anyone help?

Mark

View 4 Replies View Related

SELECT Permission Denied On Object 'database Object', Database 'databasename', Owner 'dbo'.

Mar 27, 2006

I have created a sql login account called "webuser" and has given public role in my database. In my asp.net application i build connection string using above account and its password . We give permission on store procedure for for the above account to execute .We dont give table level permission for the above account . When we run the application with the above settings it runs fine on test server . However Now i have transfered the databse object to live server with its permissions . Now while I executing the aspx page , I am getting above error . I have checked that the store procedure has execute permission for webuser account and dbo(i.e SA) has all the permissions for all database objects . Still why i am getting error ? (Please note , the thing is working fine in test server)



Pl help



Regards

View 4 Replies View Related

Server Error: Object Reference Not Set To An Instance Of An Object. Trying To Upload Image In Database

Dec 17, 2007

Does any one has any clue for this error ? I did went through a lot of articles on this error but none helped . I am working in Visual studie 2005 and trying to upload image in sql database through a simple form. Here is the code
 
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Web.Configuration;
using System.IO;
public partial class Binary_frmUpload : System.Web.UI.Page
{protected void Page_Load(object sender, EventArgs e)
{
}protected void btnUpload_Click(object sender, EventArgs e)
{if (FileUpload.HasFile == false)
{
// No file uploaded!lblUploadDetails.Text = "Please first select a file to upload...";
}
else
{string str1 = FileUpload.PostedFile.FileName;
 string str2 = FileUpload.PostedFile.ContentType; string connectionString = WebConfigurationManager.ConnectionStrings["GSGA"].ConnectionString;
//Initialize SQL Server Connection SqlConnection con = new SqlConnection(connectionString);
//Set insert query string qry = "insert into Officers (Picture,PictureType ,PicttureTitle) values(@ImageData, @PictureType, @PictureTitle)";
//Initialize SqlCommand object for insert. SqlCommand cmd = new SqlCommand(qry, con);
//We are passing Original Image Path and Image byte data as sql parameters. cmd.Parameters.Add(new SqlParameter("@PictureTitle", str1));
cmd.Parameters.Add(new SqlParameter("@PictureType", str2));Stream imgStream = FileUpload.PostedFile.InputStream;
int imgLen = FileUpload.PostedFile.ContentLength;byte[] ImageBytes = new byte[imgLen]; cmd.Parameters.Add(new SqlParameter("@ImageData", ImageBytes));
//Open connection and execute insert query.
con.Open();
cmd.ExecuteNonQuery();
con.Close(); //Close form and return to list or images.
 
}
}
}
 
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.Source Error:



Line 32:
Line 33: string str2 = FileUpload.PostedFile.ContentType;
Line 34: string connectionString = WebConfigurationManager.ConnectionStrings["GSGA"].ConnectionString;
Line 35:
Line 36: //Initialize SQL Server Connection Source File: c:UsersManojDocumentsVisual Studio 2005WebSitesGSGABinaryfrmUpload.aspx.cs    Line: 34  
Stack Trace:




[NullReferenceException: Object reference not set to an instance of an object.]
Binary_frmUpload.btnUpload_Click(Object sender, EventArgs e) in c:UsersManojDocumentsVisual Studio 2005WebSitesGSGABinaryfrmUpload.aspx.cs:34
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102

View 2 Replies View Related

Object Reference Not Set To An Instance Of An Object (Inserting Data Into Database)

Dec 28, 2004

Each time I press submit to insert data into the database I receive the following message. I use the same code on another page and it works fine. Here is the error:


Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


Line 125: MyCommand.Parameters("@Balance").Value = txtBalance.Text
Line 126:
Line 127: MyCommand.Connection.Open()
Line 128:
Line 129: Try


Source File: c:inetpubwwwrootCreditRepairCreditor_Default.aspx.vb Line: 127

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
CreditRepair.CreditRepair.Vb.Creditor_Default.btnSaveAdd_Click(Object sender, EventArgs e) in c:inetpubwwwrootCreditRepairCreditor_Default.aspx.vb:127
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()



Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click

If (Page.IsValid) Then

Dim DS As DataSet
Dim MyCommand As SqlCommand

Dim AddAccount As String = "insert into AccountDetails (Account_ID, Report_ID, Balance) values (@Account_ID, @Report_ID, @Balance)"

MyCommand = New SqlCommand(AddAccount, MyConnection)

MyCommand.Parameters.Add(New SqlParameter("@Account_ID", SqlDbType.Char, 50))
MyCommand.Parameters("@Account_ID").Value = txtAccount_ID.Text

MyCommand.Parameters.Add(New SqlParameter("@Report_ID", SqlDbType.Char, 50))
MyCommand.Parameters("@Report_ID").Value = txtReport_ID.Text

MyCommand.Parameters.Add(New SqlParameter("@Balance", SqlDbType.Char, 50))
MyCommand.Parameters("@Balance").Value = txtBalance.Text

MyCommand.Connection.Open()

MyCommand.ExecuteNonQuery()

Response.Redirect("Customer_Details.aspx?SS='CustHeadGrid.Columns[0].Item.lblSS.Text)")

MyCommand.Connection.Close()
End If

View 2 Replies View Related

HELP! How To Find The Owner Of An Object??

Feb 4, 2005

I need to remove some login ID on a SQL2000 server, but it did not let me
because the login ID owns objects in one or more databases.

How can I find out what objects does the login ID own?

Thank you

View 4 Replies View Related

Object Permissions, Can't Find

Nov 8, 2007

I'm trying to identify the objects in master that the role public has select permissions on, but when I run this query, I get 4 results where the default schema is null and the major_id column does not correspond to any records in the sys.all_objects table. Where else can I look to find what objects these are. DBO is listed as the grantor.

I appreciate your help.

SELECT *
FROM SYS.DATABASE_PERMISSIONS P,
SYS.DATABASE_PRINCIPALS R
WHERE P.GRANTEE_PRINCIPAL_ID=R.PRINCIPAL_ID and
permission_name='SELECT' and class_desc='OBJECT_OR_COLUMN' and
r.name='public'
order by r.name desc

View 1 Replies View Related

Add New Database Error Object Reference Not Set To An Instance Of An Object

Oct 18, 2006

Hi,

I'm new to SQL database.

When I add a new item to project in VS2005: Project-->Add New Item --> Sql Database I got a error msg "object reference not set to an instance of an object" after click "Add" button. The SQL Server Express is running. How do I fix this problem?

Any help would be appreceiated.

CO22006

View 4 Replies View Related

SQL 2012 :: Can't Find Object From Page ID

Sep 17, 2014

I got an error that says to run DBCC CHECKTABLE, but I can't find what table it is. It gives the db id and page Id. I ran DBCC PAGE but I could not figure out what object is using that page. I posted the error and dbcc page results below. Also, Slot 74 is not missing. I could not find m_objId or AllocUnitId in any system tables . Also, I got the same error for this db several other times. When I ran dbcc checkdb I did not get any errors. This is a SQL 2012 db created by SharePoint.

Why is m_nextPage and m_prevPage = (0:0) ?

Does the m_type=3 change how a page is linked?

I found Type 3 – text mix page. A text page that holds small chunks of LOB values plus internal parts of text tree. These can be shared between LOB values in the same partition of an index or heap.

Error2 from log--
Message
The Database ID 7, Page (1:14002), slot 74 for LOB data type node does not exist. This is usually caused by transactions that can read uncommitted data on a data page. Run DBCC CHECKTABLE.

Message
Error: 7105, Severity: 22, State: 6.

[Code] ....

View 2 Replies View Related

SQL 2012 :: Cannot Find Object Because It Does Not Exist

May 5, 2015

I'm trying to run an Insert on tables using a User Login but I keep getting the error above. I ran the insert using my own credentials and it worked. The User LOGIN in question has read & write permission to the database.

View 4 Replies View Related

SQL Server 2012 :: How To Find Whether Object Is Used By Any SP / View

Nov 19, 2013

How to find whether an object is used by any sp , view ?

I need a query which will result the sp , view names which uses the given object name .

View 6 Replies View Related

Cannot Find The Certificate Object When Creating Endpoint

Nov 19, 2007

Hi,

I try to implement mirroring using certificate authentication.
When I do this query :


create certificate Principal_cert with subject = 'Principal certificate', start_date = '2007/11/01', expiry_date = '2020/11/01';
GO

Create endpoint endpoint_Princ state = started

as tcp(listener_port = 7024, listener_ip = all)

for database_mirroring (authentication=certificate Principal_cert, encryption = disabled, role = all);

GO


I have this error :


Msg 1088, Level 15, State 1, Line 1

Cannot find the object "Principal_cert" because it does not exist or you do not have permissions.


I have also noticed that the error does not occured when I try this in the master database.

So, I have two questions:

1. Why SQL server does not find a certificate that just been created ?
2. Should the certificate be in the master database or in the database being mirrored ?

Thanks for any help.

View 4 Replies View Related

Why Don't You Guys Provide A Way To Find Out The Dependancies Of Any Object (SProc, Table, View And Etc...) Within SQL Server...

Nov 15, 2007



Why don't you folks (SQL SERVER Management Studio Team or SQL SERVER Database Engine Team) provide an option by using which I would be in a position to know what all the other objects are depended on a selected object and vice versa. That means:



When I select a Table within the SQL SERVER Management Studio if there is an option for understanding "Which all the objects (tables or views) it is depended on (I mean Foreign key and etc... kind of relations) and also Which all the objects (Tables, Views, Stored Procedures and etc...) are using this table", It would be of great help for all developers.



I can be contacted over kotis@microsoft.com

I BLOG @ http://blogs.msdn.com/kreddy

View 3 Replies View Related

To Know Who Deleted The Database

Dec 11, 2000

Is it possible to know that who has deleted the database

Thanks in advance

View 2 Replies View Related

Deleted Database

Jan 21, 2005

Our past CIO deleted a SQL Server database because he didn't know what it was or if we needed it. Guess what we do! We were able to undelete the backup files but when we try to restore from it we get the error "No a valid backup" Any ideas?

Thank you for any help. :eek:

View 2 Replies View Related

Records Don't Get Deleted From The Database!

Sep 17, 2007

I am using this code to delete records from a table in the database that has two fields (both are primary keys) I am not getting any error, but nothing gets deleted. Thanks for the help.
Code:protected void btnRemove_Click(object sender, EventArgs e)
{
 
Remove();Response.Redirect("RegisteredCompanies.aspx");
 
}protected void Remove()
{
//update database with filename
//Save Changes
connection.Open();using (SqlTransaction trans = connection.BeginTransaction())
{
try
{ SqlHelper.ExecuteNonQuery(trans, CommandType.StoredProcedure, "spRemoveCompany", new SqlParameter("@Userid", getGdUserID(Profile.UserName)),new SqlParameter("@BusinessID", getBusinessID());
}catch (Exception err)
{
// throw exception
trans.Rollback();
 lblStatus.Text = "An error has occurred in the delete process. Please try again.";
}
}
 Here is the stored procedure:ALTER PROCEDURE [dbo].[spRemoveCompany]
 
 
@Userid uniqueidentifier OUTPUT,
@BusinessID uniqueidentifier OUTPUT
 
 
 
ASDELETE FROM Associations2 WHERE Userid = @Userid AND BusinessID = @BusinessID
 
RETURN

View 4 Replies View Related

Deleted The Database But Have A Backup .

Apr 9, 2007

i backed up the database d1 and deleted it off my sql server.
when i innitiate the sql server instante is supposed to run the d1 DB. But since i deleted it, it pops up an error. How can i fix it?

View 4 Replies View Related

Default Database Deleted

Sep 3, 2007

Dear All,
i'm using sql server 2005.
I've one default database named testdb. unexpectedly that was deleted. now i was unable to connect to the server. what is the solution for this

Vinod
Even you learn 1%, Learn it with 100% confidence.

View 2 Replies View Related

Recover Deleted Database

Oct 5, 2007

I have accidentally deleted a Database from SQL server 2005 instance. Is there any chance for me to recover the Database. If yes do let me know the method.

Thanks in advance
Mrinmoy

View 4 Replies View Related

Data Gets Deleted From Database

Apr 20, 2015

I have created a asp.net web api hosted on Azure. A couple of times a day all data from my database get deleted and I see these errors in the log. I have tried to reinstall microsoft sql server spatial types from nuget, but that didnt work. Could not load assembly 'D:homesitewwwrootbinSqlServerT ypesx86SqlServerSpatial110.dll'.

Error received: 'Could not load file or assembly 'file:///D:homesitewwwrootbinSqlServerTypesx86SqlServerSpatial110.dll' or one of its dependencies. The module was expected to contain an assembly manifest.'. 

View 2 Replies View Related

Recovering A Deleted Database.

Aug 2, 2007

I accidentally deleted at SQL 2005 database. Is there any way I can get it back? No, there is no backup.

View 6 Replies View Related

Recover Deleted Database On Sql Server

Feb 12, 2008

hi
Can any body provide me any idea that how to recover database data if i have deleted that database
Bye...... 
 
 

View 2 Replies View Related

Recover A Deleted SQL Express Database

Mar 22, 2006

One of my SQL Express databases was deleted by mistake through MS SQL Server Management Studio Express.  It is not in the Recycle Bin and I have tried to use a tool such a Active@ Undelete to recover the file but it cannot find the deleted file.
I have a backup file *.bak in the ....MSSQLBackup folder I made using MS SQL Server Management Studio Express.   When I try to use the restore database feature in SSMSE I get various errors.
Any Suggestions on how to recover the deleted file or
Any suggestions or documentation on using the restore feature in SSMSE?
Any help at all?
Thanks
George
 

View 6 Replies View Related

Purging Deleted Database Names

Jul 1, 2002

When connecting to an SQL Server (v7 in this case) the log file shows that old and deleted databases are still being opened as part of the process. Further, these db names are now reserved and cannot be reused, even thought I've deleted them.

Is there any way I can purge all traces of these deleted db names?

You might have guessed, I'm a newbie, which is why there are a few dozen deleted DBs.

Thanks for any help
Max
atomax@gmx.net

View 2 Replies View Related

How To Recover Deleted Database Data?

Oct 18, 2006

I accidentally deleted some useful data in my database. I have both .LDF and .MDF files for this database.
Is there a way to recover this database to a point of time?
Thx.

View 5 Replies View Related

Deleted My Database Log File, Can't Reattach

Jul 20, 2005

Hello,A utility I was running caused our database's log file to run out ofhard drive.So, I detached the database, deleted the log file, and tried toreattach.SQL server fails to reattach because it cant find the log file. (Whyit cant just create a new default one is beyond me...but...)EXEC sp_attach_single_file_db @dbname = 'sgvault',@physname = 'c:Program FilesMicrosoft SQLServerMSSQLDatasgvault.mdf''Could not open new database 'sgvault'. CREATE DATABASE is aborted.Device activation error. The physical file name 'C:ProgramFilesMicrosoft SQL ServerMSSQLdatasgvault_log.LDF' may beincorrect.Do you know how I can fix this dilemma? Thanks!

View 2 Replies View Related

Retriving Deleted Record From Database

Aug 2, 2007

Hi friends

I have a bit problem here

Just I want to get back all deleted record of database

How do I perform this task?
If It is possible then plz help me out?

Thanks in Advance

Khan

View 4 Replies View Related

How Do I Clean Up Database Deleted By ClickOnce With T-SQL?

May 12, 2006

I posted this in the SQL Server Express forum as well...

My app deployed via ClickOnce. It ships with a database creation script which creates the database in the ClickOnce data directory. Upon uninstall, the entire data folder is deleted successfully. But if you then reinstall the app, SQL Server Express still thinks the database exists. Right now, to get a re-install to work, I have to go into Management Studio Express, click on the db (get an pop-up error as the physical db file is no longer there) and then click delete.

So my question is... what system proc should I execute in the db creation script before I run the CREATE DATABASE command?

View 1 Replies View Related

Physical Files Can Not Be Deleted After Database Detached

Oct 10, 2007

I have detached the database via sp_detach_db in a job, (I was trying to use a job to detach the database, then make copies of the mdf file, then attach the databases as different copies, somehow the job failed due to file locked) I tried to delete the physical files, but they were still locked. I tried several times, two of them I was able to delete the mdf files, but not the ldf file. The other one both mdf file and ldf file can not be deleted. I was not able to see the database via Management studio.

Can anyone help?

Thanks

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved