Where Are Error Transactions Stored? Can They Be Edited Or Deleted?

Apr 2, 2007

Greetings,



We are using peer-to-peer transactional replication. When using the default agent profile, the replicator stops processing commands when it encounters an error. It appears to keep trying to apply the command that caused the error and essentially hangs on that command. We have changed our agent profiles to "Continue on data consistency errors" - not the kind of option to give you a warm fuzzy feeling but we just don't know what else to do.



Where are the commands that cause errors stored within the replication environment? Can they be individually viewed, edited, and/or deleted? We would like some alternative to "continue on data consistency errors."



Thanks,

BCB

View 5 Replies


ADVERTISEMENT

How Do I Track When A Stored Proc. Was Deleted ?

Oct 12, 2007

Does SQL Server logs track such a thing ?
Where do I look to see when the last time a stored procedure was modified or deleted....or the same goes for a table created ?

Thank you

View 8 Replies View Related

Transact SQL :: Prevent Stored Procedure From Getting Deleted

Sep 28, 2015

How could I prevent a stored procedure from getting deleted?

View 3 Replies View Related

Code Thinks Deleted Stored Procedure Still Exists?

Feb 13, 2013

I'm writing some code to create stored procedures in a database. In order to test it out, I deleted a stored procedure (right clicking in SQL Server 2008 and clicking on delete) and then ran my code to see if it would create it.

My code looks like this:

Code:
SqlCommand command = new SqlCommand();
SqlConnection conn = database.TypeLibraryDatabaseConnection;
command.Connection = conn;
// create the command to create the stored procedure
command.CommandText = database.GetProcedure(node.Name);
// create the stored proc in the database
try
{
command.ExecuteNonQuery();
}
catch
{
}
command.Dispose();

database.GetProcedure(node.name) basically gets a string containing the SQL script to create the stored procedure.

command.ExecuteNonQuery() throws an SqlException that says: "There is already an object named 'SecuritySession_DeleteSessionById' in the

database." But I deleted it! Why does it think it's still there?

View 3 Replies View Related

Deleted Stored Procedure Caused Backup Job To Failed

May 29, 2007



Hello,



I created a test stored procedure in MS SQL 2000. When the problem in my app was fixed, I deleted this test stored procedure. But the backup job thinks this procedure still exist and so backup job would failed. How can I fix this problem?



Thank in advance for your assistance.

View 1 Replies View Related

Stored Procedure And Transactions

May 8, 2007

Good afternoon,
I was checking how Microsoft was doing something on stored procedures and I've noticed something interesting (or not) in their AdventureWorks sample database. I've noticed that their stored procedures are encapsulated in transactions such as this:BEGIN TRY
BEGIN TRANSACTION; -- <SOME SQL HERE>
END TRY
BEGIN CATCH
-- Rollback any active or uncommittable transactions before
-- inserting information in the ErrorLog
IF @@TRANCOUNT > 0
BEGIN
ROLLBACK TRANSACTION;
END

EXECUTE [dbo].[uspLogError];
END CATCH;
 For the more I can understand what they are doing here I do have a question regarding the way SQL Server executes this procedure and the eventual overhead of it. I'm saying this because, as far as I know, when we execute a stored procedure it runs as a whole transaction itself. Not being very proficent with transactions, I find myself with the question: Isn't this a double transaction? If so, isn't this causing unecessary overhead on the database server, consequently in the database itself? Or is this pretty much the only way to do error handling without a roundtrip to the caller (e.g. Data Access Layer)
I'm trying to learn more about transactions and error handling using SQL Server so every help is valuable.
Best regards,DBA

View 2 Replies View Related

Transactions And Stored Procs

Mar 8, 2004

All,

I'm relatively new to stored procs (not to SQL or SQL Server) and I am trying to get transactions to work within a stored proc. Here is the code:


(
--define the parameters that are needed
@userID char(32),
@userName varchar(50),
@status char(10),
@type char(10),
@password varchar(50),
@firstName varchar(100),
@lastName varchar(100),
@email varchar(200),
@domain varchar(50),
@pwdExpiry int,
@badLogin int,
@lastLogin datetime,
@full varchar(8000),
@read varchar(8000),
@noaccess varchar(8000)
)
AS
BEGIN TRAN tmp1
--First, insert the user into the system
INSERT INTO ptsUsers(UserID, UserName, Status, Type, Password, FirstName, LastName, Email, DomainName, PasswordExpiry, BadLoginAttempts, LastLoginDate)
values(@userID, @userName, @status, @type, @password, @firstName, @lastName, @email, @domain, @pwdExpiry, @badLogin, @lastLogin);

--Now, we need to add the function access edges for the user
declare @arrayValue char(32)
declare @rightID char(32)
declare @sepPos int
while patindex('%,%',@full)<>0
BEGIN
select @sepPos = patindex('%,%' , @full)
select @arrayValue = left(@full, @sepPos - 1)
-- replace the value with an empty string
select @full = stuff(@full, 1, @sepPos, '')

--create and parse the new id
declare @strID char(32),@tmpStr varchar(40)
set @tmpStr = newid();
set @strID = REPLACE(@tmpStr,'-','')

--get the access right id for full control
select @rightID = (Select AccessRightID from ptsAccessRights where Name = 'Write')
if(@rightID IS NOT NULL)
--insert the records that are full access
INSERT INTO ptsFunctionAccessEdges(FunctionAccessEdgeID, FunctionID, AccessRightID, UserID)
VALUES(@strID, @arrayValue, @rightID, @userID)
else
RAISERROR(50100,15,1)
END
COMMIT TRAN tmp1
IF @@TRANCOUNT > 0
RAISERROR(50101,15,1)
ROLLBACK TRAN tmp1


The transaction does not rollback when any errors occur at all. Any advice/help?

View 3 Replies View Related

Transactions And Stored Procedures

Dec 1, 2005

My company has decided that all CRUD operations will be done via stored procedures.  I am in the process of coming up with a strategy for handling transactions.  Before I begin my design, I was wondering if I will be better off keeping my transaction logic completely in my stored procedures or would I be best served by surrounding calls to my stored procedures using ADO.NET transactions to handle the transaction logic?Thanks

View 6 Replies View Related

Transactions Within A Stored Procedure

Feb 7, 2006

Ive never used transactions before but i would like to start using them within stored procedures.

I have some questions about them and how roll backs function.

i have had a go a writing a basic procedure with a transaction

** updated {with Code wrap }


Code:

CREATE PROCEDURE TransferMoney
(
@Account1 Int,
@Account2 Int,
@myValue Numeric(18),
@myValue2 Numeric(18)
)
AS


-- STEP 1: Start the transaction

BEGIN TRANSACTION

-- STEP 2 & 3: Issue the Insert statement, checking @@ERROR after each statement

Insert Into Bank (Balance) Values (@MyValue)
WHERE AccountID = @Account1

-- Rollback the transaction if there were any errors

IF @@ERROR <> 0
BEGIN
-- Rollback the transaction
ROLLBACK
Return
END


Insert Into Bank (Balance) Values (@MyValue2)
WHERE AccountID = @Account2

-- Rollback the transaction if there were any errors

IF @@ERROR <> 0
BEGIN
-- Rollback the transaction
ROLLBACK
Return
END

-- STEP 4: If we reach this point, the commands completed successfully
-- Commit the transaction....

COMMIT




now have i used the
IF @@ERROR <> 0 correctly?


i want this transaction to only happen if the if both statement are true, stopping data insertion Errors when transfering from one account and adding to another.

any thoughts you have will be fantastic

View 7 Replies View Related

Multiple Stored Procedures And Transactions

Dec 7, 2007

I have a simple question: Can I have two or more stored procedures that begin transactions but the last stored procedure will commit all transactions if there was no error?
In other words, I have a stored procedure that performs some legacy stuff.  I do not want to rewrite that logice, execpt I am putting it into a Stored Procedure since it currently is embedded SQL.
To support newer functionality, I am writing data to additional new tables.  However, I do not want the *new* things to occur if there is an error.  This is easy enough, I dont call the Stored Procedure for the new functionality if there was an error. However, if there was not an error and the newer stored procedure is called AND there is an error in the new stored procedure, I want to ROLLBACK the changes from the proceeding stored procedures.
To my understanding, I can name transactions but that is only to indicate in the logs what transactions have failed.
I thought about not using transactions for any of the individual stored procedures and calling them from a main stored procedure.  The main stored procedure will have a BEGIN TRY and an END TRY (I am using SQL Server 2005) and at the top (right after the try) I will have a BEGIN TRANSACTION.  In the BEGIN CATCH I will have a ROLLBACK and at the end I will have a COMMIT.  If any of the stored procedures fail at any point it will cause the catch to occur thus rolling back all of my transactions.  This would be the easiest way but I still need to deal with the question of, "What happens if any single stored procedure is called?"  I guess I could have try and catches in each individual stored procedure for that.
I just want to make sure I am not overlooking something simple.  I think I have the right idea by doing it this way I mentioned above.  Because this is critical billing processing I just want to have some reassurance that this would work.
Thank

View 4 Replies View Related

Stored Procedures, 'GO', And Transactions/atomicity

Oct 20, 2006

I have been having a bit of trouble creating a sql schema creation script (using sql server 2005) with generic stored procedures. I am generating the script from an xslt transform, so it is all in one document. The intent is that either everything works (schema creation, tables, constraints, procedures, and triggers) or the entire thing will be rolled back.

The problem I am having is that I can not find a way to put more than one stored procedure inside of a transaction statement, much less having all of the create statements needed within the same transaction. As far as I can tell the GO statement is needed between stored procs, but this statement appears to commit the preceding create <object> statement - breaking my atomic transaction.

Does anyone know a way around this or a way to put multiple procedures/triggers in the same transaction?

View 5 Replies View Related

How Can Control Transactions For Creating Stored Procedure ?

Apr 30, 2007

I create StringBuilder type forconcating string to create a lot of stored procedure at once However When I use this command BEGIN TRANSACTIONBEGIN TRY--////////////////////// SQL COMMAND /////////////////////////           -------------------- This any command --///////////////////////////////////////////////////////////    --COMMIT TRANEND TRYBEGIN CATCH    IF @@TRANCOUNT > 0        ROLLBACK TRANSACTION;END CATCHIF @@TRANCOUNT > 0    COMMIT TRANSACTION;   on any command If I use Create a lot of Tablessuch as  BEGIN TRANSACTION
BEGIN TRY
--////////////////////// SQL COMMAND /////////////////////////CREATE TABLE [dbo].[Table1](      Column1 Int ,      Column2 varchar(50) NULL  ) ON [PRIMARY]CREATE TABLE [dbo].[Table2](
     Column1 Int ,
     Column2 varchar(50) NULL
 ) ON [PRIMARY]
CREATE TABLE [dbo].[Table3](

     Column1 Int ,

     Column2 varchar(50) NULL

 ) ON [PRIMARY]
--///////////////////////////////////////////////////////////
    --COMMIT TRAN
END TRY

BEGIN CATCH
    IF @@TRANCOUNT > 0
        ROLLBACK TRANSACTION;
END CATCH

IF @@TRANCOUNT > 0
    COMMIT TRANSACTION;   It correctly works. But if I need create a lot of Stored procedure  as the following code :   BEGIN TRANSACTION
BEGIN TRY
--////////////////////// SQL COMMAND /////////////////////////
CREATE PROCEDURE [dbo].[DeleteItem1]
    @ProcId        Int,
    @RowVersion        Int
AS
BEGIN
    DELETE FROM [dbo].[ItemProcurement]
    WHERE
        [ProcId]    =    @ProcId    AND
        [RowVersion]    =    @RowVersion   
END CREATE PROCEDURE [dbo].[DeleteItem2]

    @ProcId        Int

AS

BEGIN

    DELETE FROM [dbo].[ItemProcurement]

    WHERE

        [ProcId]    =    @ProcId 

END
CREATE PROCEDURE [dbo].[DeleteItem3]


    @ProcId        Int


AS


BEGIN


    DELETE FROM [dbo].[ItemProcurement]


    WHERE


        [ProcId]    =    @ProcId 


END

--///////////////////////////////////////////////////////////
    --COMMIT TRAN
END TRY

BEGIN CATCH
    IF @@TRANCOUNT > 0
        ROLLBACK TRANSACTION;
END CATCH

IF @@TRANCOUNT > 0
    COMMIT TRANSACTION; It occurs Error ?????  Please help me How should I solve them ?   

View 1 Replies View Related

DTS Transactions - Error

Mar 9, 2001

I have a DTS package which contains:
- 1 "Execute SQL" task
- 1 "Connection" object

The provider for the connection is SQLOLEDB ("Microsoft OLEDB Provider for SQL Server"), and this works just fine with transactions in ADO etc.
The MDAC version is 2.5, and the SQL Server Client Utils version is 7.0 SP2.

The package properties are set as follows:
- "Use transactions" is on
- "Auto commmit transaction" is on
- "Read committed" isolation level

The execute SQL task has the following workflow properties:
- "Join transaction if present" is on
- "Commit transaction on successful..." is on
- "Rollback transaction on failure" is on
- ("Execute on main package thread" just in case)

When I execute the package (from the designer, or cmd line), I get the following (most informative) error:
"Error Source: Microsoft Data Transformation Services (DTS) Package
Error Description: Unspecified error"


If I change the package properties to remove "Use transactions", it executes just fine.

Any ideas?

TIA

View 2 Replies View Related

Rolling Back Transactions For Multiple Stored PRocs

Oct 5, 2007

I have a quick question.

I need to execute some stored procedures in certain steps... all performing some inserts/updates

What i need is, a mechanism, by which i can roll back to the previous state if i encounter an exception (either in the app or SP)

so, if the my first two SP execute fine, perform their functionality like insert/update, and the third one fails...

how can i roll back to the initial state in ASP.NET.

would appreciate any info.
or redirection to the the location where i can look up some info on that.

AJ

View 1 Replies View Related

Views(Edited)

Aug 22, 2007

Hai,
I have a table named "Student" which contains four columns and three rows.I want to see just the first row only from the "Student" table and the marks should be calculated.
Here is my table
sno smark1 smark2 smark3
1 60 60 60
2 70 70 70
3 90 90 90

The Ouput Should be:
sno smarks(smark1+ smark2+smark3)
1 180
2 210
3 270

View 4 Replies View Related

Parallel Transactions Error

Aug 21, 2007



Hi,All.
I'm writing test cases on C# for a few methods that make changes in database.To prevent making changes I used BeginTransaction-Rollback,everything was good.But this doesn't work if tested method has BeginTransaction-Rollback code itself.An error appears in NUnit: System.InvalidOperationException : SqlConnection does not support parallel transactions.
Do smb know how to solve the problem?

*******************************tc below********************
[Test]

[Category("Access")]

public void UpdateGroupUserTable(/*Int32 userID, GroupList dataset*/)

{

r.BeginTransaction();

try

{

r.UpdateGroupUserTable(userId,gl);

}

finally

{

r.Rollback();

}
*******************************tested method below********************

public void UpdateGroupUserTable(Int32 userID, GroupList dataset)

{

CheckDisposed();

UpdateCommand.CommandType = CommandType.Text;

UpdateCommand.Parameters.Clear();

UpdateCommand.Parameters.Add("@USERID", userID);

BeginTransaction();

try

{

Adapter.Update(dataset.acl_group);

Commit();

}

catch (SqlException)

{

Rollback();

throw;

}

}

View 5 Replies View Related

Transactions With Containers Error

Apr 17, 2008



So I have a few data flow tasks that I need to all execute successfully before I commit the changes. So I use a few nested sequence containers with the parent set to Required and all of the children set to Supported. This should work right? Instead I get "The AcquireConnection method call to the connection manager "Databasenamehere" failed with error code 0xC0202009. If I switch the parent back to Supported or NotSupported it will execute fine.

HELP!

Thanks in advance!

View 2 Replies View Related

Records Duplicate When Edited...?

Sep 27, 2006

Hi,I have written a web application using dreamweaver MX, asp.net, and MSsql server 2005.The problem I am having occurs when I attempt to edit a record. I have setup a datagrid with freeform fields so that the user can click on edit, make the required changes within the data grid then click update. The data is then saved to the database. All this was created using dreameaver and most of the code was automatically generated for me.The problem is that, not everytime, but sometimes when I go to edit a record once I hit the update button to save the changes the record is duplicated 1 or more times. This doesnt happen everytime but when it does it duplicates the record between 1 and about 5 times. I have double checked everything but cannot find anything obvious that may be causing this issue. Does anyone have any suggestions as to what I should look for? Is this a coding error or something wrong with MSsql? Any ideas?Thanks in advance-Mitch 

View 1 Replies View Related

Text Too Long To Be Edited

Oct 10, 2006

Hi,I asked this in an MS Access newsgroup, but no one has answered. Since italso applies to SQL Server, maybe someone in here has an answer? I actuallydo have the same problem in both SQL Server 2000 and Access 2000.When I click in certain records in a memo field, I get the error message"text too long to be edited", and I can't get into the record to make anychanges.I tried exporting the record to html, but only part of the memo field isexported.I know that in SQL Server, you can increase the size of the field, but youcan't do that in an Access memo field (that I know of!).I'm thinking that if I could get into the field and lose some of the whitespace, it would help, but I can't get into the field, and can't get the dataout, either!Does anyone know anything about this?Thanks, Jill~

View 1 Replies View Related

ERROR - The Row Value(s) Updated Or Deleted Either Do Not Make The Row Unique Or They Alter Multiple Rows.

Sep 8, 2006

i am getting the above error on my database i have 2 rows with the same info on and another 2 with the same info on.  example:

ID    username   password

1            bob       bob

1            bob       bob

1           john       john

1           john        john

 

I know this is a fault with ms sql 2005 however how do i fix it?

Ive found this link which explains everything but how do i start a query.  I tried clicking on new query and copying the code.  What is table1 meant to be?  the database is dbl.tbl_admin.  It wont find my database.

Im not sure how to do it anyway.

I need to change it though as its my admin password and Ive given it out to web design companys

http://geekswithblogs.net/allensb/archive/2006/07/27/86484.aspx

Can some 1 read the above page and give me full instructions, I dont know what im doing thanks

info@uktattoostudios.co.uk

View 7 Replies View Related

Changing Connection Transactions To Database Transactions

May 22, 2005

Hi there,
I have decided to move all my transaction handling from asp.net to stored procedures in a SQL Server 2000 database. I know the database is capable of rolling back the transactions just like myTransaction.Rollback() in asp.net. But what about exceptions? In asp.net, I am used to doing the following:
<code>Try   'execute commands   myTransaction.Commit()Catch ex As Exception   Response.Write(ex.Message)   myTransaction.Rollback()End Try</code>Will the database inform me of any exceptions (and their messages)? Do I need to put anything explicit in my stored procedure other than rollback transaction?
Any help is greatly appreciated

View 3 Replies View Related

Bank Of 15 Records Cannot Be Edited In A Table

Oct 10, 2007

Hi,
I am using SQL Server 2000 as part of SBS 2003. I have an odd problem with a table in my database.

On Monday, due to a problem we had on Friday afternoon, I was forced to restore the database to 12:30pm Friday. Since then, everything has been fine, except that in one table, a bank of 15 records cannot be edited. There are 25,000+ records in the table, and all of the rest are fine and can be edited. If I try to edit one of the "bad" records, SQL times out or hangs indefinately. This is true if I edit the table direct, if I use SQL Analyser or if I use my FE application. There is no other error message. There are no triggers on the table.

As far as I can see, the id's of all of the bad records are the same as those which would have been entered on Friday afternoon, but which were lost with the restore. Records before and after the bank of 15 can be edited ok.

Last night, with no other users on the system, I exported the table, deleted the original, created a new table with the same name and fields as the original and used Analyser to populate the new table from the export. I then tried to edit the bad records and it worked fine. However, this morning, with other users on, it fails again and the records cannot be edited.

I have used DBCC CHECKDB and it displays no errors.

Can anybody suggest what this might be and how I can get round it?

Thanks for any help

Colin

View 20 Replies View Related

Can Fields In Sql Server Reports Be Edited?

Mar 7, 2008

Is there a way to make some fields in reporting services report editable?

View 3 Replies View Related

Error:SqlConnection Does Not Support Parallel Transactions

Jul 17, 2006

This is my code in vb.net with Sql transactionI am using insertcommand and update command for executing the sqlqueryin consecutive transactions as follows.How can I achive parallel transactions in sql------------------start of code---------------------trybID = Convert.ToInt32(Session("batchID"))                    strSQL = ""                    strSQL = "Insert into sessiondelayed (batchid,ActualEndDate) values (" & bID & ",'" & Format(d1, "MM/dd/yyyy") & "')"
                    sqlCon = New System.Data.SqlClient.SqlConnection(ConfigurationSettings.AppSettings("conString"))
                    Dim s1 As String = sqlCon.ConnectionString.ToString                    sqlDaEndDate = New System.Data.SqlClient.SqlDataAdapter("Select * from sessiondelayed", sqlCon)                    dsEndDate = New DataSet                    sqlDaEndDate.Fill(dsEndDate)
                    dbcommandBuilder = New SqlClient.SqlCommandBuilder(sqlDaEndDate)
                    'sqlCon.BeginTransaction()                    'sqlDaEndDate.InsertCommand.Transaction = tr                    If sqlCon.State = ConnectionState.Closed Then                        sqlCon.Open()                    End If                    sqlDaEndDate.InsertCommand = sqlCon.CreateCommand()                    tr = sqlCon.BeginTransaction(IsolationLevel.ReadCommitted)                    sqlDaEndDate.InsertCommand.Connection = sqlCon                    sqlDaEndDate.InsertCommand.Transaction = tr                    sqlDaEndDate.InsertCommand.CommandText = strSQL                    sqlDaEndDate.InsertCommand.CommandType = CommandType.Text
                    sqlDaEndDate.InsertCommand.ExecuteNonQuery()                    tr.Commit()                    sqlDaEndDate.Update(dsEndDate)                    sqlCon.Close()                End If            Catch es As Exception
                Dim s2 As String = es.Message                If sqlCon.State = ConnectionState.Closed Then                    sqlCon.Open()                End If                strSQL = " update SessionDelayed set ActualEndDate= '" & Format(d1, "MM/dd/yyyy") & "' where batchid=" & bID & ""                sqlDaEndDate.UpdateCommand = sqlCon.CreateCommand()                tr1 = sqlCon.BeginTransaction(IsolationLevel.ReadCommitted)                sqlDaEndDate.UpdateCommand.Connection = sqlCon                sqlDaEndDate.UpdateCommand.Transaction = tr1                sqlDaEndDate.UpdateCommand.CommandText = strSQL                sqlDaEndDate.UpdateCommand.CommandType = CommandType.Text                sqlDaEndDate.UpdateCommand.ExecuteNonQuery()                tr1.Commit()                sqlDaEndDate.Update(dsEndDate)                sqlCon.Close()
 
            End Try
'-------------End----------------

View 1 Replies View Related

Edited Version: Very Urgent Date Calculation

Nov 13, 2007

Hi, How can i calculate the date out? i am using vb sql server database...db saved my date as dd/MM/yyyy, form display my date as dd/MM/yyyy too
1.I have a selected date by user from calendar in tb_dop.text 
2.creditDate.text for user to enter number of days to add to tb_dop.text date
3.dDate.text to display the calculated date Private Sub Calendar1_SelectionChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged
'display selected date from calendar
tb_dop.Text = Calendar1.SelectedDate()
End SubPrivate Sub btn_add2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_add2.ClickDim myDate As New DateTime
myDate = tb_dop.Text
Dim i As Integer
i = creditDate.TextDim dDate As New DateTime
dDate = myDate.AddDays(i)
dueDate.Text = dDate
ERROR
The conversion of char data type to smalldatetime data type resulted in an out-of-range smalldatetime value.The statement has been terminated.
I know it is becos diff format of date calculation, there4, how can i change it to calculate in mm/dd/yyyy format? Funny rite? i can saved and display in dd/MM/yyyy but i cant calculate using this format
Note: i cant change my form display format to mm/dd/yyyy cos i need it to be user friendly in my country ty (URGENT)
Once again thanks

View 4 Replies View Related

Managing Distributed Transactions With ADO.NET 2.0 Using TransactionScope Gives Error Message

Nov 14, 2007

 Hi, I am working  on vs2005 with sql server 2000. I  have used TransactionScope class. Example Reference: http://www.c-sharpcorner.com/UploadFile/mosessaur/TransactionScope04142006103850AM/TransactionScope.aspx   The code is given below.  using System.Transactions;   protected void Page_Load(object sender, EventArgs e)    {  System.Transactions.TransactionOptions transOption = new System.Transactions.TransactionOptions();         transOption.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;         transOption.Timeout = new TimeSpan(0, 2, 0);         using (System.Transactions.TransactionScope tranScope = new System.Transactions.TransactionScope(TransactionScopeOption.Required,transOption))         {            using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["nwConnString"].ConnectionString))            {                int i;                con.Open();                SqlCommand cmd = new SqlCommand("update products set unitsinstock=100 where productid=1", con);                i = cmd.ExecuteNonQuery();                if (i > 0)                {                    using (SqlConnection conInner = new SqlConnection(ConfigurationManager.ConnectionStrings["pubsConnString"].ConnectionString))                    {                        conInner.Open();                        SqlCommand cmdInner = new SqlCommand("update Salary set sal=5000 where eno=1", conInner);                        i = cmdInner.ExecuteNonQuery();                        if (i > 0)                        {                            tranScope.Complete(); // this statement commits the executed query.                        }                    }                }            }            //  Dispose TransactionScope object, to commit or rollback transaction.        } } It gives error like
 "The partner transaction manager has disabled its support for remote/network transactions. (Exception from HRESULT: 0x8004D025)" The database I have used is northwind database and pubs database which is by default in sql server 2000. So, Kindly let me know how to proceed further.  Thanks in advance,Arun. 

View 1 Replies View Related

Post 2005 SP2 Install, No Script Component Can Be Edited.

Feb 26, 2007

Anyone starting to see "Cannot show Visual Studio for Applications editor. (Microsoft Visual Studio)" after installing SQL Server 2005 SP2 on x86 machines?  Second, how can it be fixed?

After installing SP2, the script component editor will not edit script components created in pre SP2 releases. (I also have Visual Studio 2005 SP1 installed). The script TASK editor will start, but when attempting to open a script COMPONENT in the VSA editor, a script component created for pre-SP2 packages, the following error dialog occurs.

Cannot show Visual Studio for Applications editor. (Microsoft Visual Studio)

This same error dialog has occurred on multiple computers, none of them are running Vista (rather Windows XP SP2). All of the pre-existent pre-SP2 script components have Precompile set to true as well, since they are intended for 64 bit machines.

Now, certain posts say, register DLLs in the following directories via:
for %i in (*.dll) do RegSvr32 -s %i.

C:Program FilesCommon FilesMicrosoft SharedVSA8.0common
C:Program FilesCommon FilesMicrosoft SharedVSA8.0vsa

One problem with these instruction is that the second directory doesn't even exist, however, a directory called "C:Program FilesCommon FilesMicrosoft SharedVSA8.0VsaEnv" does exist, which is perhaps what was meant. Even after registering the DLLs there, the script component editor will not open (erroring out after clicking the "Design Script..." button).

View 28 Replies View Related

Data Source View Of Mining Structure Cant Be Edited?

Nov 23, 2006

Hi, all here,

Thank you very much for your kind attention.

I got a quite a strange problem with Mining structure for OLAP data source though. The problem is: I am not able to edit the mining structure in the mining structure editor. The whole data source view within the mining structure editor is greyed. Could please anyone here give me any advices for that?

Thank you very much in advance for any help for that.

With best regards,

Yours sincerely,

 

View 5 Replies View Related

Problems Using Error Row Redirection And Transactions In A Data Flow Task

Mar 22, 2007

I am having a problem getting error rows to redirect between an OLE DB Source and an OLE DB Destination when using transactions. Each time I turn on the transaction control I get an error stating:

"[OLE DB Destination [48]] Error: The input "OLE DB Destination Input" (61) cannot be set to redirect on error using a connection in a transaction."

I get the above Error when using MSDTC. I have the data flow inside of a Sequence Container with the transaction option set to REQUIRED and the Isolation Level set to Serializable. I have tried all the Isolation levels.

I have the error rows piped off to a seperate OLE DB Destination. I have also tried using native SQL transactions with Execute SQL tasks to BEGIN, COMMIT or ROLLBACK the transaction. This does not work either. It looks like it works properly when the data flow is successful but using profiler I can see SSIS opens up a seperate process for the BEGIN and then another one with the Data Flow task. When I intentionally fail the Data Flow the Rollback always fails. I made sure I had RetainSameConnection turned on for the Connection I was using.

I am speculating that the Data Flow does not know what to Rollback the actual rows that succeeded or the error rows that are getting piped off.

I am fairly stumped on this one so any help is appreciated.

Thanks

View 4 Replies View Related

Select Most Recently Edited Item AND A Certain Type If Another Doesn't Exist

Sep 20, 2007

I've got a big problem that I'm trying to figure out:I have an address table out-of-which I am trying to select mailing addresses for companies UNLESS a mailing address doesn't exist; then I want to select the physical addresses for that company. If I get multiple mailing or physical addresses returned I only want the most recently edited out of those.I don't need this for an individual ID select, I need it applied to every record from the table.My address table has some columns that look like:
[AddressID] [int][LocationID] [int][Type] [nvarchar](10)[Address] [varchar](50)[City] [varchar](50)[State] [char](2)[Zip] [varchar](5)[AddDate] [datetime][EditDate] [datetime]AddressID is a primary-key non-null column to the address table and the LocationID is a foreign key value from a seperate Companies table.So there will be multiple addresses to one LocationID, but each address will have it's own AddressID.How can I do this efficiently with perfomance in mind???Thank you in advance for any and all replies...

View 5 Replies View Related

Regarding The Query To Save The Ids Of The Edited Names From Different Tables Into A Single Table.

Mar 8, 2008

Here with the below query iam binding my gridview with industry name,company name,Plant Name,Group Name related to the IDs in Audit table.Select Aud.Ad_ID_PK,Aud.Audit_Name,Ind.Industry_Name,Cmp.Company_Name,Pla.Plant_Name,Gr.Groups_Name,Aud.Audit_Started_On,Aud.Audit_Scheduledto,Aud.Audit_Created_On from
Industry Ind,
Company Cmp,
Plant Pla,
Groups Gr,
Audits Audwhere Ind.Ind_Id_PK =Aud.Audit_Industry and
Cmp.Cmp_ID_PK =Aud.Audit_Company and
Pla.Pl_ID_PK =Aud.Audit_Plant and
Gr.G_ID_PK =Aud.Audit_Group and
Ad_ID_PK in (select Ad_ID_PK from Audits)
Now i want to edit these names.
when i click on edit in gridview these names will be filled into textboxes and when i change the names it should compare the name with particular tables and should get the Id of that and store in Audits table.
For example:
i have this data in my audits table:




Commercial83312

2
2
2
1
Here Commercial83312 is ID of that Audit and 2,2,2,1 are the Industry,Company,Plant and group Ids for that particular audit.In the front end i can see the names of this particular IDs.
when i edit the industry name in the UI it must check the name with industry table and get the ID of the changed name and store it in audit table.
so the data may be changed in audits table as :



Commercial83312

4
2
2
1

 




so here the industry ID is changed
I need the stored procedure for this.
please help me,its very urgent...

View 4 Replies View Related

Select Most Recently Edited Item AND A Certain Type If Another Doesn't Exist

Sep 20, 2007

I've got a big problem that I'm trying to figure out:

I have an address table out-of-which I am trying to select mailing addresses for companies UNLESS a mailing address doesn't exist; then I want to select the physical addresses for that company. If I get multiple mailing or physical addresses returned I only want the most recently edited out of those.

I don't need this for an individual ID select, I need it applied to every record from the table.

My address table has some columns that look like:
[AddressID] [int]
[LocationID] [int]
[Type] [nvarchar](10)
[Address] [varchar](50)
[City] [varchar](50)
[State] [char](2)
[Zip] [varchar](5)
[AddDate] [datetime]
[EditDate] [datetime]

AddressID is a primary-key non-null column to the address table and the LocationID is a foreign key value from a seperate Companies table.
So there will be multiple addresses to one LocationID, but each address will have it's own AddressID.

How can I do this efficiently with perfomance in mind???

Thank you in advance for any and all replies...

View 2 Replies View Related

Sdf File Edited In SQL Server Managment Studio Crashes My Pocket Pc Application.

Apr 16, 2008

I have a sql server ce db file that I use in my pocket pc application. It seems to be working until I try to edit my .sdf file in SQL Server (2005) Managment Studio. After this I cannot open modified file in my application.

I receive native exception error when I call Open method for Connection object:
ExceptionCode: 0xc0000005
ExceptionAddress: 0x03f8aaac
Reading: 0x00000010

When I edit .sdf file in another pc it's all working.

My config is:
windows vista business
.net compact framework 2.0 sp2
sql server 2005
sql server 2005 compact edition
sql server 2005 compact edition server tools
sql server 2005 compact edition tools for visual studio 2005

Best regards



View 1 Replies View Related







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