Probelm With Transaction

Jun 7, 2005

hi,I wrote this sp :CREATE PROCEDURE ins_AddOrder( @CartId NVARCHAR(50), @CustomerId INT, @OrderDate DATETIME, @OrderId INT OUTPUT)AS

DECLARE @ins_error INT, @sel_error INT, @var_rowcount INT

BEGIN TRAN AddOrder

INSERT INTO tbl_orders( customerId, orderDate)VALUES( @CustomerId, @OrderDate)

-- SET THE @@ERROR VALUE TO @ins_errorSELECT @ins_error =@@ERROR

/*IF INS_ERROR != 0BEGIN ROLLBACK TRAN RETURNEND*/

SELECT  @OrderId = @@identity

INSERT INTO tbl_orderDetails( orderId, productId, quantity, productPrice)SELECT  @OrderId, tbl_product.productId, quantity, tbl_product.productPriceFROM tbl_shoppingCartINNER JOIN tbl_product ON tbl_shoppingCart.productId = tbl_product.productIdWHERE  cartId = @CartId

-- SET THE @@ERROR VALUE TO @sel_errorSELECT @sel_error = @@ERROR

-- SET THE @@ROWCOUNT TO @var_rowcountSELECT @var_rowcount = @@ROWCOUNT

IF  @sel_error <>  0  OR  @var_rowcount = 0 BEGIN  ROLLBACK TRAN AddOrder  RETURN ENDELSE BEGIN  EXEC del_EmptyShoppingCart @CartId  COMMIT TRAN AddOrder ENDGOIn the last few lines i try to prevent adding new row to tbl_orders (first statement), while the SELECT (second statement)  does not return any row .It still not work.Can anyone help please?thanks.

View 1 Replies


ADVERTISEMENT

Sql Operator(OR) Probelm

Apr 11, 2005

strsql = " select * from dic where english='" & SearchBox.Text Or TextBox4.Text & "'"The machine said Input string was not in a correct format. How can i select database with or operator in asp.net .Is it possible to select database in sql from more textbox ?

View 1 Replies View Related

SQL Trigger Probelm

Dec 1, 2005

I Have create a trigrer for my table transhd to update something in my detail table..

when i updated one record the trigger works fine..

but when i run command to update a batch of record in header
using command [update XXXX where cont] the trigger only fire for the last record in the batch..

is this the ms sql default behavior.. anyway to the around it

thanks in advance

View 1 Replies View Related

SQL Trigger Probelm

Dec 1, 2005

I Have create a trigrer for my table transhd to update something in my detail table..

when i updated one record the trigger works fine..

but when i run command to update a batch of record in header
using command [update XXXX where cont] the trigger only fire for the last record in the batch..

is this the ms sql default behavior.. anyway to the around it

thanks in advance

View 1 Replies View Related

Sql Login Probelm

Mar 19, 2004

I have a login in my sql server with windows authentication.When i tried to connet to the sql server with that login its not allowing me to connect even though I was logged on into my system.What should be the reason and what should i do?

View 2 Replies View Related

A Probelm With SqlConnection Command ....

Apr 19, 2005

I have met a problem in the ASP.NET project creation with SQL Server Database Connection.
"Can't Login to My ServerName/ASPNET
How to solve the problem?

View 1 Replies View Related

Probelm Accessing Sql Instance

May 31, 2006

Hi , I just put my files up on a web server. I can view my aspx pages..but when I try to login to the website I get the following;
An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
Can you help? I can understand that it cannot find the specified instance of sql server, however I don't remember ever configuring it look to at a specific sql server. When i created the site in web dev express edition and added the login controls and set the asp config tool to use internet security it created the database itself and so I didn't have to put  a connection string in. I also cannot see a connection string in tthe web.config file.
The aspnetdb.mdf file is there on the server. is this something i need to configure with the hosting company or do i set it in my webconfig file.
Thanks

View 4 Replies View Related

Character Len Probelm With Executesql

Jun 15, 2007

I need to create some tables dynamically using sp_executesql. But the problem is the length of sql string is more the 4000 characters. How can I solve this problem?
Thanks

View 3 Replies View Related

Probelm In Installing Mysql On Win Xp M/c

Jul 20, 2005

hello ![color=blue]>>> I am trying to intstall Mysql binary version with installor in Windows> XP machine . But it is not working . i have installed in the default> path ,in windows service componenet its showing server is running,since> it is mysqld-nt so name-piped servr is also running.>> But still client is able to connect to server.>> when i am tring to instal manually it is showing>> " service already exists;> the currect server intstalled is c:mysqlinmysqld-nt.exe>> when trying to connect to server> C:> c:mysqlinmysql test> ERROR 2003 : cannot connect to MYSQL server on localhost <10061>>> C:> telnet localhost 3306> connecting to localhost.......> could not open connection to host,on port 3306No connection shb ne made> because the target machine actibvely refused it.>> plz help me in installing ,pls clarify the problem.> pls reply soon.>>> regards> Smita[/color]

View 1 Replies View Related

Probelm Using For Each Loop Container

May 18, 2007


We have a config table which has columns like pollingfolder, cop to folder etc.
Data looks like this
Config id polling folder
1 d:dataloadacn
2 d:dataloadship
under ACN and Ship folders we can have more than 1 source files which had to be loaded into target
the load process has to be repeated for each file in all the folders like ACN and ship
I have used for each loop container to poll the folder.
Can we set the directory to be polled at runtime taking from config table.
For doing this I have used the property Directory in expression editor of for each loop. But it is not working.
If I hard code the variable value in variables section , then its working.
How to change the directory to be polled value at runtime?

View 1 Replies View Related

Probelm With Export To Excel

May 15, 2008

I had installed SQL server 2005 4 bit version. I created on SSIS package through export wizard.

the SSIS packages will transfer data from database to Excel file. But it is giving the below error.

Message
Executed as user: XXXXXSYSTEM. ... Utility Version 9.00.3042.00 for 64-bit Copyright (C) Microsoft Corp 1984-2005. All rights reserved. Started: 07:00:00 Error: 2008-05-14 07:00:00.51 Code: 0xC0202009 Source: Interface Connection manager "DestinationConnectionExcel" Description: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040154. An OLE DB record is available. Source: "Microsoft OLE DB Service Components" Hresult: 0x80040154 Description: "Class not registered". End Error Error: 2008-05-14 07:00:00.51 Code: 0xC00291EC Source: Preparation SQL Task Execute SQL Task Description: Failed to acquire connection "DestinationConnectionExcel". Connection may not be configured correctly or you may not have the right permissions on this connection. End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 07:00:00 Finished: 07:00:00 Elapsed: 0.344 seconds. The package execution failed. The step failed.


please any one guide me to reolve this issue.

View 4 Replies View Related

Probelm With Report Charts

Sep 20, 2007



I have two data sets but from the same data source. I created two different tables from these two data sets. Now I want to include a chart too. But When I insert the chart, it gives a erorr message.

The dinfinition of the report/my report name is invalid.
More than one data set, data region or grouping in the report has the name'chart1_seriesgroup1'. data set, data region and grouping names must be unique within a report.


Does any body know why this happen?

Thanks

View 3 Replies View Related

SQLDataSource Stored Procedure Probelm

Dec 16, 2005

Someone, please help me understand:
I have the following code:
Dim conString As String = ConfigurationManager.ConnectionStrings("WebAllianceConnectionString").ConnectionStringDim dsrc As New SqlDataSource()dsrc.ConnectionString = conStringdsrc.SelectCommandType = SqlDataSourceCommandType.StoredProceduredsrc.CancelSelectOnNullParameter = Falsedsrc.SelectCommand = "sp_GetCustomerInvoiceList"dsrc.SelectParameters.Clear()dsrc.SelectParameters.Add("@QueryType", "DATE")dsrc.SelectParameters.Add("@CustCode", "BAM7")dsrc.SelectParameters.Add("@OrdNumber", " ")dsrc.SelectParameters.Add("@InvStartDate", "1/1/2005")dsrc.SelectParameters.Add("@InvStopDate", "1/31/2005")dsrc.SelectParameters.Add("@PONumber", " ")Return dsrc.Select(DataSourceSelectArguments.Empty)
When this runs, it throws an exception:Prodecure or Function 'sp_GetCustomerInvoiceList' expects parameter '@QueryType', which was not supplied.
I'm confused... I clearly added that using the .Add method?What am I doing wrong?
 

View 5 Replies View Related

Probelm Restoring 2000sp1 To 2000 Not Sp1

Jul 3, 2001

has anyone had a problem restoring a SQL 2000 without sp1 to a SQL 2000 sp1 box or vice versa? I have had 2 failures telling me to call MS support in the message?

View 1 Replies View Related

Probelm With Extended Stored Procedure

Feb 17, 2004

Hi

Can i be able to use the DLL which is created in VB for Extended Stored Procedures.
if so how?

View 1 Replies View Related

Probelm With Global Variable DataType....need Help

May 30, 2007

hi everyone,
How do i declare a global variable in my package which takes a numeric value like User::VAR1 = 200402 and later on work on it

Later in the properties of the Dataflow i want to have this expression..

"select * from " + "TAB1" + " where Date=" + @[User::VAR1]

Here i want to subtract 190000 from @[User::VAR1] to get it in to myformat i.e the DATE format in the table


I can only see String datatype and othe datatypes wont allow me to to do any kind of manipulation in the expression:
and to be more specific what are
Int16
Int32
Int64
Double

I tried to use all of the above but the expression doesnt allow me as once i use any of the above it says :



TITLE: Microsoft Visual Studio
------------------------------

Nonfatal errors occurred while saving the package:
Error at Extract: The data types "DT_WSTR" and "DT_I8" are incompatible for binary operator "+". The operand types could not be implicitly cast into compatible types for the operation. To perform this operation, one or both operands need to be explicitly cast with a cast operator.


Any help would be appreciated..

thanks,
ravi

View 8 Replies View Related

Probelm With Connection To Databse Engine

May 21, 2007

Hi,



I have the same problem like Ben. Trying to connect to database engine but failed all the time. I use a SQL 2005 Enterprise Eval version. When I connect to database engine, I put <my computer name>SQLEXPRESS, it gives me this message:



An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (.Net SqlClient Data Provider)



I checked the sqlbrowser and it's running. I also enabled port 1434 in Firewall. But it still doesn't work. However, when I connect to analysis service using just <my computer name>, it lets me connected. I tried many ways to fix this problem but still no luck. Could anyone help me solve this problem please? Thanks so much.



Carl

View 6 Replies View Related

Error 8525: Distributed Transaction Completed. Either Enlist This Session In A New Transaction Or The NULL Transaction.

May 31, 2008

Hi All

I'm getting this when executing the code below. Going from W2K/SQL2k SP4 to XP/SQL2k SP4 over a dial-up link.

If I take away the begin tran and commit it works, but of course, if one statement fails I want a rollback. I'm executing this from a Delphi app, but I get the same from Qry Analyser.

I've tried both with and without the Set XACT . . ., and also tried with Set Implicit_Transactions off.

set XACT_ABORT ON
Begin distributed Tran
update OPENDATASOURCE('SQLOLEDB','Data Source=10.10.10.171;User ID=*****;Password=****').TRANSFERSTN.TSADMIN.TRANSACTIONMAIN
set REPFLAG = 0 where REPFLAG = 1
update TSADMIN.TRANSACTIONMAIN
set REPFLAG = 0 where REPFLAG = 1 and DONE = 1
update OPENDATASOURCE('SQLOLEDB','Data Source=10.10.10.171;User ID=*****;Password=****').TRANSFERSTN.TSADMIN.WBENTRY
set REPFLAG = 0 where REPFLAG = 1
update TSADMIN.WBENTRY
set REPFLAG = 0 where REPFLAG = 1
update OPENDATASOURCE('SQLOLEDB','Data Source=10.10.10.171;User ID=*****;Password=****').TRANSFERSTN.TSADMIN.FIXED
set REPFLAG = 0 where REPFLAG = 1
update TSADMIN.FIXED
set REPFLAG = 0 where REPFLAG = 1
update OPENDATASOURCE('SQLOLEDB','Data Source=10.10.10.171;User ID=*****;Password=****').TRANSFERSTN.TSADMIN.ALTCHARGE
set REPFLAG = 0 where REPFLAG = 1
update TSADMIN.ALTCHARGE
set REPFLAG = 0 where REPFLAG = 1
update OPENDATASOURCE('SQLOLEDB','Data Source=10.10.10.171;User ID=*****;Password=****').TRANSFERSTN.TSADMIN.TSAUDIT
set REPFLAG = 0 where REPFLAG = 1
update TSADMIN.TSAUDIT
set REPFLAG = 0 where REPFLAG = 1
COMMIT TRAN


It's got me stumped, so any ideas gratefully received.Thx

View 1 Replies View Related

SSIS, Distributed Transaction Completed. Either Enlist This Session In A New Transaction Or The NULL Transaction.

Feb 22, 2007

I have a design a SSIS Package for ETL Process. In my package i have to read the data from the tables and then insert into the another table of same structure.

for reading the data i have write the Dynamic TSQL based on some condition and based on that it is using 25 different function to populate the data into different 25 column. Tsql returning correct data and is working fine in Enterprise manager. But in my SSIS package it show me time out ERROR.

I have increase and decrease the time to catch the error but it is still there i have tried to set 0 for commandout Properties.

if i'm using the 0 for commandtime out then i'm getting the Distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction.

and

Failed to open a fastload rowset for "[dbo].[P@@#$%$%%%]". Check that the object exists in the database.

Please help me it's very urgent.

View 3 Replies View Related

Distributed Transaction Completed. Either Enlist This Session In A New Transaction Or The NULL Transaction.

Feb 6, 2007

I am getting this error  :Distributed transaction completed. Either enlist this session in a new
transaction or the NULL transaction. 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.Data.OleDb.OleDbException: Distributed transaction completed. Either
enlist this session in a new transaction or the NULL transaction.have anybody idea?!

View 1 Replies View Related

Distributed Transaction Completed. Either Enlist This Session In A New Transaction Or The NULL Transaction.

Dec 22, 2006

i have a sequence container in my my sequence container i have a script task for drop the existing tables. This seq. container connected to another seq. container. all these are in for each loop container when i run the package it's work fine for 1st looop but it gives me error for second execution.

Message is like this:

Distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction.

View 8 Replies View Related

Distributed Transaction Completed. Either Enlist This Session In A New Transaction Or The NULL Transaction. (HELP)

Jan 8, 2008

Hi,

i am getting this error "Distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction.".

my transations have been done using LINKED SERVER. when i manually call the store procedure from Server 1 it works but when i call it through Service broker it dosen't work and gives me this error.



Thanks in advance.


View 2 Replies View Related

SQL Server Admin 2014 :: Restore Lost Transaction From Transaction Log File

Jun 10, 2015

I have Full database backup upto previous day and transaction logfile of Today transaction. my database has crashed. I have restored previous day's Full backup. I have faced difficulty to restore today's transaction from today's transaction log. What are the steps to restore full database back and one day's transaction log file. Note: there is no differential database backup and transaction backup.

View 8 Replies View Related

I Need Away To Show The Pending Transaction From Transaction Replication In A User Friendly Format.

Jul 11, 2007



I want to list out the pending transaction for transaction replication by publication.



Help needed.

View 1 Replies View Related

TRANSACTIONS In SSIS (error: The ROLLBACK TRANSACTION Request Has No Corresponding BEGIN TRANSACTION.

Nov 14, 2006

I'm receiving the below error when trying to implement Execute SQL Task.

"The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION." This error also happens on COMMIT as well and there is a preceding Execute SQL Task with BEGIN TRANSACTION tranname WITH MARK 'tran'

I know I can change the transaction option property from "supported" to "required" however I want to mark the transaction. I was copying the way Import/Export Wizard does it however I'm unable to figure out why it works and why mine doesn't work.

Anyone know of the reason?

View 1 Replies View Related

Analysis :: Find Amount Distribution Across Different Transaction Types Under Spend Transaction

Jul 27, 2015

I created a Calculated measure in cube something like this : ([TransType].[TransTypeHierarchy].[TransTypeCategoryParent].&[SPEND],[Measures].[Transaction Amount]). To get only spend transactions. Now, I want to slice this measure with same hierarchy to find the amount distribution across different transaction types under spend transaction. But this query behaving like the measure doesn't have relation with measure.

you can think this as below query:
WITH
MEMBER SPEND AS ([TransType].[TransTypeHierarchy].[TransTypeCategoryParent].&[SPEND],[Measures].[Transaction Amount])
SELECT NON EMPTY {SPEND} ON 0
,NON EMPTY ([TransType].[TransTypeHierarchy].[TransTypeCategoryParent]) ON 1
FROM [CUBE]

View 6 Replies View Related

How Do I Make Use Of Begin Transaction And Commit Transaction In SSIS.

Jun 1, 2007

Hi



How do I make use of begin transaction and commit transaction in SSIS.

As am not able to commit changes due to certain update commands I want to explicitly write begin and commit statements. but when i make use of begin and commit in OLEDB commnad stage it throws an error as follows:

Hresult:0x80004005

descriptionyntax error or access violation.



its definately not an syntax error as i executed it in sql server. also when i use it in execute sql task out side the dataflow container it doesnt throw any error but still this task doesnt serve my purpose of saving/ commiting update chanages in the database.



Thanks,

Prashant

View 3 Replies View Related

Sql2005:Cannot Use SAVE TRANSACTION Within A Distributed Transaction

Oct 10, 2005

Error returned when trying to commit the transaction to a database that is a replication distributor. (sql2005 ctp16)

View 10 Replies View Related

Problem With SSIS Transaction...Transaction Scope

Jun 1, 2006



Hi,

I am having some problem with SSIS transaction. Eventhought I tried to imitate the concept that Jamie presented at http://www.sqlservercentral.com/columnists/jthomson/transactionsinsqlserver2005integrationservices.asp

. My workflow is as followed

*********************************
For Each ADO.Record in Oracle (transaction=not supported)

If (Certain_Field_Value = 'A')


Lookup Data in SQL DB with values from Oracle (transaction=not supported)

DO Sequence A (Start a Transaction , transaction=required)


INSERT/UPDATE some records in SQLDB(transaction=supported)
Finish Sequence A ( transaction should stop here)
UPDATE Oracle DB ( Execute SQLTask, transaction=not supported)
If (Certain_Field_Value = 'B')


Lookup Data in SQL DB with values from Oracle (transaction=not supported)

DO Sequence B (Start a Transaction , transaction = required)


INSERT/UPDATE some records in SQLDB (transaction=supported)
Finish Sequence A ( transaction should stop here)
UPDATE Oracle DB ( Execute SQLTask, transaction=not supported)
If (Certain_Field_Value = 'C')

------------
------------
End ForEach Loop
*************************************
My requirements are that I want separate transaction for each Sequence A, B, C, etc... If Sequence A transaction fails, the other should still be continuing with another transaction.
But I am getting an error regarding the OLEDB Error in next Task (e.g in Certain_Field_Value = 'B') "Lookup Data in SQL DB with values from Oracle ", the error message is ".......Distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction. ".
What is it that I am doing wrong?
Regards
KyawAM

View 12 Replies View Related

New Transaction Cannot Enlist In The Specified Transaction Coordinator

Nov 28, 2004

I'm getting this error:

The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction.
[OLE/DB provider returned message: New transaction cannot enlist in the specified transaction coordinator. ]
OLE DB error trace [OLE/DB Provider 'SQLOLEDB' ITransactionJoin::JoinTransaction returned 0x8004d00a].

http://support.microsoft.com/kb/839279 this didn't help

any suggestions?

View 3 Replies View Related

BEGIN TRANSACTION And COMMIT TRANSACTION

Oct 11, 2000

I am executing a stored procedure something like this

Create Procedure TEST
@test1
@test2
AS
BeGIN TRANSACTION ONE
SELECT...
UPDATE..
....
....

....
TRUNCATE
etc and lot of Select,update and delete statements like this
.....
COMMIT TRANSACTION ONE


The Block of code which I have b/w BEGIN TRANSACTION AND COMMIT TRANSACTION ..Will it be rolled back
if it encounters any errors in the SELECT,UPPDATE,DELETE ..statements which I have with the transaction one.
IF not How do I roll back if it encounters any erros b/w the BEGIN TRANSACTION and END TRANSACTION.

Thanks
micky

View 1 Replies View Related

New Transaction Cannot Enlist In Transaction Coordinator (was Please Help...)

Apr 18, 2005

Hi all,

In my ASP application, I've been using this code:

----------------------------------------------
dim conn, connectionstring

connectionstring= "Provider=SQLOLEDB.1; Data Source = blahblah; Initial Catalog = abc; User Id = osss; Password=xxx"

set conn = server.CreateObject("adodb.connection")
conn.open connectionstring

----------------------------------------------

It's just basically to set up the connection to the SQL server, it works on my other pages, but on a few pages, the last line (conn.open connectionstring) triggers this error:

"Microsoft OLE DB Provider for SQL Server error '8004d00a'

New transaction cannot enlist in the specified transaction coordinator. "

I've never encountered this error before and I couldn't think of any solution... please help!!!

Thanks so much,
Annie

View 2 Replies View Related

BEGIN TRANSACTION COMMIT TRANSACTION Help

Sep 24, 2007

I had thought that if any statement failed within a BEING TRANS .. COMMIT TRANS block, then all the statements would be rolled back. But I am seeing different behavior (SQL Server 2000 8.00.2039)

For instance, run these statements to set up a test:
--DROP TABLE testTable1
--DROP TABLE testTable2
CREATE TABLE testTable1 (f1 varchar(1))
CREATE TABLE testTable2 (f1 varchar(1))
CREATE UNIQUE INDEX idx_tmptmp ON testTable1 (f1)
insert into testTable1(f1) values ('a')

So table testTable1 has a unique index on it..

Now try to run these statements:

--DELETE FROM testTable2
BEGIN TRANSACTION
insert into testTable1(f1) values ('a')
insert into testTable2(f1) values ('a')
COMMIT TRANSACTION

SELECT * FROM testTable2


..the first insert fails on the unique index.. but the second insert succeeds. Shouldn't the second insert roll back? How can I make two operations atomic?

View 8 Replies View Related







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