Database Object Comparision Script

Feb 6, 2004

does any one have a script.. to compare objects(tables, views, sps, func etc) between two different databases.


thanks

View 5 Replies


ADVERTISEMENT

Database Comparision

Dec 22, 2006

Language : VB.NET
Database : MSSQLserver2000
i have developed a tool to compare two databases, but it is taking long time to compare. First it will take the whole table into main memory(order by primary key). Same procedure for table2 of second database. Then it will start comparison by taking row by row. i tested with one third party tool, which is taking only 2 min to compare 800000 records of a table. My tool is taking 1 hour,40 mins to do that. Is there any other optimized method?


Regards,

Loka

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

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

Table Comparision

Aug 15, 2000

I need to compare two tables and output everything that doesn't match.
The tables are joined by the "domainname" column, and I need to output everything in both tables where the "domainname" doesn't match.
Any ideas?

View 3 Replies View Related

Date Comparision

May 3, 2008

I am using SQL Server 2005 Express Edition. One table contains field docdate having format dd/MM/yyyy hh:mm:yyyy. Here hours & mins are also required.

I am working on VB6.0. User will input date on form in format 'dd/MM/yyyy'. I just want to check this with SQL Server date considering only dd/MM/yyyy.

How to do this?

View 2 Replies View Related

Query Performance Comparision

Jan 19, 2000

How could I tell the performance difference between two queries:

One is:
select * from table
where Lower(colomnname) = 'value'

The other is:
select * from table
where colomnname = 'value'

Basically the difference is in lower() function, how much this function will affect the query performance.
Is there a formal way to test it out, or by any logic.
Thanks, Mike

View 2 Replies View Related

Tools For Db Structures Comparision

Jul 10, 2002

Hi,Does any of u folks used any tools for database structures comparision??

I have used DBDIFF(from DKGAS.com) ChangeManager from Embarcadaro and SQL COMPARE from Redgate.

I did have have some problem in each of these tools AND am looking for some good tools which are economical also.

Thx in advance
Ravi

View 2 Replies View Related

Table Schema Comparision

Jun 12, 2006

Hi Gurus,

I am looking for a script which lists me the differences between two table schemas.

Thanks in advance

Srini

View 3 Replies View Related

Comparision Of Sql Server && Mysql

May 19, 2006

whats the difference betwwen mysql and sql server2000 in terms of usingstoredprocedures,stored functions and views.

View 3 Replies View Related

Performance Comparision Of Different Connection Types

Apr 2, 2006

Do you know some performance differences between reading data from a stored procedure using:

1. OLE DB Connection and OLE DB Source

2. ADO.NET Connection and DatareaderSource

Przemo

View 1 Replies View Related

Developer Edition Feature Comparision

Jan 31, 2007

I am trying to compare developer edition and Express edition. I almost purchased the developer edition and wanted to compare it with other editions. no info to be found. Would greatly appreciate it, if someone could direct me to a resourse that shows this comparision.

thanks

ps.The product comparision page doesnt show developer edition.

View 1 Replies View Related

Case Sensitive String Comparision ??

May 2, 2008

Dear all,

I have building an authitication mecanism through a database standard login table as :

UserName varchar
PassWord varchar
UserId Identity

From my client application I need to validate the username and the password.
For that I have a store procedure with the following statement :


SELECT @loginID = Id from [NomosConfig].[dbo].Users

WHERE [UserName]=@UserName

AND [PassWord] = @pw

From that point this works well except that for the passowrd, whre of course there will be no difference between:

PassWor = myPassw or MYPASSW

How can I check in password field in order that it is case sensitive....?

Later on, the password will be encrypted of course, will it behaves similar ?

thnaks for help
regards
serge

View 6 Replies View Related

Comparision Of SSRS With Crystal Reports

Apr 23, 2008


1) Crystal Reports provides extensive parameter support. The types of parameters supported are: single value, multi-value, and range value (e.g. Start date to End date), or a combination of all three.
2) SSRS parameters only support entry of a single value. It doesn't support multi-value parameters or range parameters. For example, the user can't be presented with a list of Employees and select more than one for reporting on. Doing so requires writing custom code and writing more complex SQL queries

View 5 Replies View Related

Update SQL Column With Comparision Between Last And Current Records

Jun 13, 2006

My question is concerned with the three columns below (customerID, RepairDate, CompletedRepair (Yes or No). The column name "CompletedRepair " is blank initially. I need to update the CompletedRepair column with this logic below:

- A customer comes to our store to fix their car, if we fix their problem on the first time and they don’t return later for this same issue, then the
•CompletedRepair column = Y

- If a customer needs to come back to our store to re-fix the same issue within 7 days windows based on the RepairDate on the previous transaction then
•On the last return transaction: CompletedRepair = Y (example: RepairDate =6/12/2006)
•On all previous transactions: CompletedRepair = N (example: RepairDate =6/8/2006, 6/9/2006, 6/10/2006)

- If a customer needs to come back to our store to re-fix the same issue but out of the 7 days windows based on the RepairDate then
•On the last return transaction: CompletedRepair = Y (RepairDate =6/12/2006)
•On the previous transaction: CompletedRepair = Y (RepairDate =6/1/2006)

Every time customer comes to for car repair shop for a new issue or an old issue, we create a new repair transaction in our SQL db. The update on the "CompletedRepair " column will be run every day. Today's records will be run against with last 7 days records (based on Repair Date) to check when customer has been really fixed: the last fix counted Y, the previous fix counted as N but comparison in only 7 days. In other words, a repair today is considered as a completed repair when comparing with last 7 day repairs but it might become not a completed repair if this same customer would come back within next 7 days for the same issue.

The CompletedRepair column is dynamic column and is updated daily by using the logic above.

Below is the expected outcome after we update the Completed Repair column:

CustomerID Repair DateCompleted Repair

ab1 06/12/06 Y
ab1 05/28/06 Y
ab1 05/18/06 Y
ab105/15/06 N
ab1 05/12/06 N

Initially 5/12/06 had Y, when 5/15/06 transaction came, it took the Y and made the 5/12/06 become N. The 5/18/06 transaction did the same to 5/15/06 transaction, made itself Y and converted 5/15/06 into N. The 5/28/06 is Y because comparing with 5/18/06, it is out of 7 days window. The 6/12/2006 is Y because comparing with 5/28/06, it is out of 7 days window.

ab2 06/02/06 Y
ab2 05/28/06 N
ab2 04/19/06 Y
ab2 04/14/06 N

The 4/14/06 transaction initially was Y, it became N when new transaction on 4/19/06 came. Same thing with transactions on 5/28/06 and 6/2/06

ab3 05/11/06 Y
ab3 03/29/06 Y
ab3 03/23/06 N
ab3 03/12/06 Y

The 3/23/06 was Y, when new transaction on 3/29/06 came, it became N and the new transaction is Y. The 5/11/06 is Y because comparing back to 3/29/06, they are out of 7 days window.

ab4 05/11/06 Y

This ab4 customer came to fix her car only one time and don't come back. We supposed the fix was sucessfully and so we mark the CompletedRepair as Y.


I think that I would need to use SQL cursor or case statement for this but I really don't know how to start. Please advice and help me out. Any ideas and suggestion are really appreciated! If you need more information, please let me know!

Thank you!

Tracy

View 4 Replies View Related

How To Do Pair-wise Comparision Like Oracle In MS Sql Server 2000?

Apr 18, 2008



How can we do pair wise comaprission using Sub query as generally can be done in Oracle?


Thanx

View 4 Replies View Related

Performance Comparision - Stored Procedures VS SQL (Inside SSIS)

Mar 23, 2007

I am working on a technical design of data integration ETL package which will be moving data from SQL Server Source to DB2 destination. I currently have two options, when moving data to DB2(IBM AS400). I can call a AS400 Stored Procedure, and pass in the data to the stored procedure, and perform the insert processing within the AS400 environment or I could do inserts from SSIS in a DFT and write individually to AS400 tables. My question is from a performance and good practice perspective, which method should I move forward with. I need a possible list of pros- and cons when using AS400 Sproc vs using SQL within SSIS? I would really appreciate response from individuals who have done something similar in the past. Thanks a lot and I am really looking forward to responses.

View 1 Replies View Related

SELECT Permission Denied On Object 'TableID', Database 'Database', Schema 'dbo'

Mar 21, 2007


The error message:

An error has occurred during report processing. (rsProcessingAborted)
Query execution failed for data set 'TestID'. (rsErrorExecutingCommand)
For more information about this error navigate to the report server on the local server machine, or enable remote errors

The log file reads:

---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Query execution failed for data set 'TestID'. ---> System.Data.SqlClient.SqlException: SELECT permission denied on object 'TableID', database 'Database', schema 'dbo'.

***Background***

General Users got an error message when trying to access any reports we have created.
All admin have no problems with the reports. Users (Domain Users) are given rights (Browser) to the reports and the Data Sources (Browser) and yet cannot view the reports.

An error has occurred during report processing. (rsProcessingAborted)
Cannot create a connection to data source 'DS2'. (rsErrorOpeningConnection)
For more information about this error navigate to the report server on the local server machine, or enable remote errors


I'll add this from the report logs...

w3wp!processing!1!3/20/2007-11:43:25:: e ERROR: Data source €˜DS2€™: An error has occurred. Details: Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Cannot create a connection to data source €˜DS2€™. ---> System.Data.SqlClient.SqlException: Cannot open database €œDatabase€? requested by the login. The login failed.
Login failed for user €˜DOMAINUsername€™.

The user has rights via a local group to the report and data source (Browser rights) and the local group has been added as a SQL login.


I gave rights to the databases themselves instead of just to SQL and the error changed (Ah-ha...progress, but why!?!?)

View 3 Replies View Related

Comparing Values In Two Tables In Order To Do Insert -- Comparision Is Not Working!!

Jul 23, 2005

I have the following insert statement in place:Insert WPHPayments(constituentID, constituentName, campaignYear, fundID, fundDescription, dateAndTimeEntered, amount)Select gt.constituentID, gt.constituentName, gt.campaignYear, gt.fundID, gt.fundDescription, gt.dateAndTimeEntered, gt.amountFrom GTPROCENTERFUNDPAYMENTEXTRACT gt, WPHExtractWhere gt.constituentID = WPHExtract.wph_constIDI want to insert all of the values that are in the GTPROCENTERFUNDPAYMENTEXTRACT table that have the same constituentID that as the records in the WPHExtract table.  Am I just missing something becasue the syntax is showing that everytihing is correct however there is nothing comming back in the result set.  Thanks in advance everyone.  Regards,RB

View 1 Replies View Related

Granting Permission To Object In X Database From A Store Procedure In Y Database

May 16, 2000

I need to grant select, insert, update, and delete permission to an object residing in Database "X" from a store procedure in database "Y". I have already tried USE database statement. Any suggestion.
Thanks
Maroof Khan

View 1 Replies View Related

The Database Name Component Of The Object Qualifier Must Be The Name Of The Current Database

Apr 7, 2006

Guys,1st of all.. sorry about my english ok? Im from Brazil...Im trying to get a RS connecting through 2 databases with the querybelow:SELECTscar..osbalcao.numeroos,ccell.dbo.atrib_os.osFROMccell.dbo.atrib_osJOIN scar.dbo.osbalcao on ccell.dbo.atrib_os.os =scar.dbo.osbalcao.numeroosWHERE scar.dbo.osbalcao.localprod = '257'AND scar.dbo.osbalcao.status in ('EM')On a SQL IDE i got a good RS, but, when i try to use that same query onDelphi + ZEOS, the SQL Server tells me that "The database namecomponent of the object qualifier must be the name of the currentdatabase".I really dont understand why. I can only tell that the error isreturned from SQL Server.Have anyone got the same trouble?[]'sTiago Gigli

View 1 Replies View Related

How Can I Return A Database From The DataBase Explorer Of VB 2005 Express To The Object Explorer Of SQL Server Management Studio

Mar 3, 2008

Hi all,

I just realized recently that a database "XYZ" in the Object Explorer of my SQL Server Management Studio Express (SSMSE) is put in the Database Explorer of my VB 2005 Express for processing a Stored Procedure in executing the SELECT statements (not by using Input and/or Output Parameters) during the ADO.NET 2.0-VB 2005 Express programming, then the content of the database "XYZ" is not in the SSMSE. How can I return the database "XYZ" from the DataBase Explorer of VB 2005 Express back to the Object Explorer of SQL Server Management Studio Express (SSMSE) safely? Please help and advise.

Thanks in advance,
Scott Chang

View 6 Replies View Related

Database...Object Transfer In SQL 6.5

Jul 28, 2000

Hi
All,
I am using Databaseobject transfer wizard to transfer objects and data
between two sql server 6.5 servers on schedule basis.unfortunately i specified non existing log directory for transfering these objects.Is there a way to change this this directory in 6.5 or to modify existing object transfer package..
I created several object transfers packages it will take lot of time for deleting and recreate them..

Thanks For your Help,

Kris

View 1 Replies View Related

Database/Object Transfer In SQL 7?

Sep 24, 1999

SQL 7.0 seems to be missing Database/Object Transfer tool, which allows to transfer single objects or whole database from one to another.
Also I couldn't find Backup/Restore one single object option eigther.

Could anyone can comment this, pls?

Michael Gladshteyn

View 1 Replies View Related

Database Object Transfer

May 28, 1999

When I am trying to transfer a database from one server to another everything comes over fine except the Stored Procedures and views. What am I doing wrong?
I'v tried just transfering the SP and views and I am still having the problem.

Thanks

View 1 Replies View Related

TempTable:There Is Already An Object ...in The Database

Dec 10, 1998

I have a stored procedure in which I create a temporary table : ##xyz

The stored procedure runs fine, however if I try to run it again later on
I get the following message:

"Msg 2714, Level 16, State 1
There is already an object named '##xyz' in the database."

If I issue the drop table ##xyz I get the following message:

"Msg 3701, Level 11, State 1
Cannot drop the table '##xyz', because it doesn't exist in the system catalogs

Help!

Thanks in advance...Marisa

View 1 Replies View Related

Database .....Object Transfer

Jul 28, 2000

Hi
All,
I am using Databaseobject transfer wizard to transfer objects and data
between two sql server 6.5 servers on schedule basis.unfortunately i specified non existing log directory for transfering these objects.Is there a way to change this this directory in 6.5 or to modify existing object transfer package..
I created several object transfers packages it will take lot of time for deleting and recreate them..

Thanks For your Help,

Kris

View 2 Replies View Related

Database Object Deployment

Feb 8, 2006

I have a Visual Studio 2005 Database Project, with SQL Server 2005 scripts in it.

How do I make a deployment package with it?

How do guys deploy your database objects/scripts?

 

View 4 Replies View Related

Store Image Object Into Database????

Feb 1, 2005

Hi,

How to insert image into database?Anyone know how to do this, please kindly lead me and give me the solution to solve this problem. Thanks a lot.

p@ywen

View 5 Replies View Related

Invalid Object Name When Trying To Reference A Database

Mar 19, 2006

Hi There
Let me start by explaining what I am trying to achieve as there may be a better way to perform this. I have two databases and I want to refer to four tables - one in one database and three in the other in a sql select statement.
When I use the query builder in VWD I can only see tables for the database that is defined in the connection string - so therefore how do I add tables from another database? After reading a few posts I realized that all I have to do is use the syntax: database.owner.table (or [database].[owner].[table]). Unfortunately this didn't work and came up with the error "Invalid Object Name".
Assuming that I must have got the owner incorrect I used the Query Tool in SQL Server Express Edition and it worked perfectly! So my sql must be correct, but why will it not work inside VWD?
The two databases are named assessment and aspnetdb - the assessment database contains the table reviews and the aspnetdb database contains the tables TutorDetails, EmployerDetails and StudentDetails.
Here is the connection string and sql:
Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|Assessment.mdf;Integrated Security=True;User Instance=True
SELECT Reviews.Programme, aspnetdb.dbo.TutorDetails.Tutor_DisplayName AS [Tutor Name],
aspnetdb.dbo.EmployerDetails.DisplayName AS [Employer Name], aspnetdb.dbo.StudentDetails.Student_DisplayName AS [Student Name]
FROM Reviews INNER JOIN
aspnetdb.dbo.StudentDetails ON Reviews.StudentID = aspnetdb.dbo.StudentDetails.Username INNER JOIN
aspnetdb.dbo.EmployerDetails ON Reviews.EmployerID = aspnetdb.dbo.EmployerDetails.UserName INNER JOIN
aspnetdb.dbo.TutorDetails ON Reviews.TutorID = aspnetdb.dbo.TutorDetails.UserName
WHERE (Reviews.ReviewID = 15)
Disregard the value of '15' in the WHERE statement as this was just put in to ensure I got some valid data back, this will be replaced with a variable eventually.
I know the sql statement works properly, I think the problem may be something to do with either the connection string - any ideas would be much appreciated.
Regards
Stuart

View 7 Replies View Related

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 View Related







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