Showing posts with label corresponding. Show all posts
Showing posts with label corresponding. Show all posts

Friday, March 30, 2012

Problem in importing data from excel to sql2005

Hi
I have to import data from a number of excel files to corresponding tables in SQL 2005. The excel files are created using excel 4.0. I have created an excel connection manager and provided it with the path of the excel sheet.Next i have added an excel source from the toolbox to the dataflow. I have set the connection manger, data access mode, and the name of the excel sheet (the wizard detects the sheet correctly) in the dialog window i get when i double click the excel source. Every thing goes fine till here. Now when i select the 'columns' in this dialog window or the preview button, i get this error

TITLE: Microsoft Visual Studio

Error at Data Flow Task [Excel Source [1]]: An OLE DB error has occurred. Error code: 0x80004005.
Error at Data Flow Task [Excel Source [1]]: Opening a rowset for "test4$" failed. Check that the object exists in the database.

ADDITIONAL INFORMATION:
Exception from HRESULT: 0xC02020E8 (Microsoft.SqlServer.DTSPipelineWrap)

Any ideas about why is this happening?
UmerDid you specify the Excel 4.0 as the version in the connection manager?|||yes i have specified the version 4.0 in the connection manager

Monday, March 12, 2012

Problem due to locking in MSSQLServer 2000

Insert or update statements seems to be locking entire
page or table rather than locking
the corresponding row to be inserted or updated.
lets assume the table with 3 rows.
scenario 1)
In transaction A, I'm updating the 3'rd row. and in
another transaction B I'm reading
row 1.
Transaction B seems to be waiting for transaction A to
finish before returning the select results.
Scenario 2)
In transaction A, I'm inserting new row (4'th row) and in
another transaction B I'm reading
row 1.
here as well trasaction B does not return the row 1 unless
transaction A is complete.
Select operation is blocked due to insert.
Ideally in both the scenarios , read operation should have
returned the results without waiting
for update/insert to finish. As the read is being done on
different rows than that of being updated
or inserted.
I have tried both the insert/update as well as select
queries with all the possible locking hints
such as ROWLOCK, READCOMMITED, UPDLOCK etc...
The only way select query returns the row without blocking
is by using the NOLOCK locking hint. But then this is
not the proper solution as it gives us the dirty read.
Please suggest me any solution or workaround for above
issue.Adding to Tony's comments (the DDL/DML will be useful), you might find the
problem is that it's the index page that's locked during the update/insert
which is blocking the select. How many rows are in the table we're
discussing?
Depending on the WHERE clause and the optimizer query plans, sometimes row
locks are NOT released until the entire statement has finished, and
sometimes these can be escalated to table locks. See
http://www.hanlincrest.com/SQLServerLockEscalation.htm for a description.
I couldn't quite figure it out from your note, but is it the same process
attempting to execute two separate transactions on two SQL Server sessions
and thus blocking itself? If this is the case it would be wise to rethink it
so only one transaction is active from the process ar once.
Kind Regards, Howard
"Sangram Deshmukh" <sangram@.savvion.com> wrote in message
news:0c2e01c34ad9$841875a0$a301280a@.phx.gbl...
> Insert or update statements seems to be locking entire
> page or table rather than locking
> the corresponding row to be inserted or updated.
> lets assume the table with 3 rows.
> scenario 1)
> In transaction A, I'm updating the 3'rd row. and in
> another transaction B I'm reading
> row 1.
> Transaction B seems to be waiting for transaction A to
> finish before returning the select results.
>
> Scenario 2)
> In transaction A, I'm inserting new row (4'th row) and in
> another transaction B I'm reading
> row 1.
> here as well trasaction B does not return the row 1 unless
> transaction A is complete.
> Select operation is blocked due to insert.
>
> Ideally in both the scenarios , read operation should have
> returned the results without waiting
> for update/insert to finish. As the read is being done on
> different rows than that of being updated
> or inserted.
> I have tried both the insert/update as well as select
> queries with all the possible locking hints
> such as ROWLOCK, READCOMMITED, UPDLOCK etc...
> The only way select query returns the row without blocking
> is by using the NOLOCK locking hint. But then this is
> not the proper solution as it gives us the dirty read.
> Please suggest me any solution or workaround for above
> issue.