Managing Transactions And Locks In SQL 7

Apr 25, 2001

Does anyone have any pointers or suggestions in explaining this topic?


The topics are what's including: Managing Transactions, SQL Server Locking and Managing Locks.

View 3 Replies


ADVERTISEMENT

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

Transactions, Locks And Deadlocks

Jul 20, 2005

Hi ChapsCan someone point me in the right direction for a very in depthpractical treatment of this for sql2k.Seen a number of books that skirt around it, read some articles thattouch on it (including some of erlands) but I need more...Thanks for any tips!

View 1 Replies View Related

How To Avoid Deadlocks Using Locks On Transactions

Sep 21, 2015

I'm a web developer. our system uses sql server 2012 since it was put in an environment production, what happened one year ago, but only now we are facing a disturbing problem. what happens it's that, when 30 users try to do the same operation in the database, we are getting deadlock status from the db in a few time. we did put this system in production one year ago and now we are facing this kind of problem.

We know that in other dbms using an optimistic lock solves the problem, but it's not our case, 'cause the users are not doing the same operation in a row.

We develop our system in java ee and our db is sql server 2012. These operations might be done on our api.

View 3 Replies View Related

SQL Server 2008 :: Row Locks Not Escalating To Table Locks After 5000

Jul 16, 2015

I've got an INSERT that's selecting data from a linked server and attempting to push 10 million rows into the blank table. More or less, it looks like this:

insert into ReceivingTable (
Field1, Field2, Field3, Field4
, Field5, Field6, Field7, Field8
, Field9, Field10, Field11, Field12
, Field13, Field14, Field15

[code]...

The instance of the SQL Server Database Engine cannot obtain a LOCK resource at this time. Rerun your statement when there are fewer active users. Ask the database administrator to check the lock and memory configuration for this instance, or to check for long-running transactions. There are no other active users. I ran it again and monitored the following DMO to watch the growth of locks for that spid:

SELECT request_session_id, COUNT (*) num_locks
-- select *
FROM sys.dm_tran_locks
--where request_session_id = 77
GROUP BY request_session_id
ORDER BY count (*) DESC

The number of locks started small and held for a while around 4-7 locks, but at about 5 minutes in the number of locks held by that spid grew dramatically to more than 8 million before finally erroring again with the same message. Researching, I can't figure out why it's not escalating from row locks to table locks at the appropriate threshold. The threshold in was set to 0 at first (Server Properties > Advanced > Parallelism > Locks). I set it to 5000, and it still didn't seem to work. Rewriting the INSERT to include a WITH (TABLOCK) allows it to finish successfully in testing. My problem is that it's coming out of an ETL with source code that I can't edit. I need to figure out how to force it to escalate to locking the entire table via table or server level settings.

A colleague suggested that installing service packs may take care of it (the client is running SQL Server 2008 R2 (RTM)), but I haven't found anything online to support that theory.

View 9 Replies View Related

Transact SQL :: How To List All Locks (including NON-BLOCKING Locks)

Aug 5, 2015

We are migrating our database(s) from ORACLE to SQL. In Oracle we were able to issue a SELECT statement and see all of the locks (Blocking and Non-Blocking) currently in the system.  The query also included the Process ID of the process we needed to kill in order to get rid of the lock.

We now need to create the same type of query for Microsoft SQL Server 2012. I have seen postings on different sites saying that this info can be obtained using SP_WHO2 or using the SQL Server Management Studio Activity Monitor's PROCESSES tab, but we are looking for a SELECT statement that will give us similar information.

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

Managing DATE ?

Jul 5, 2004

Hi,

I have a page that shows some problem indexes (cards ? I don't know the word :/ ) and I want to show only those that are from the current day.

I'm using SQL server 2000. I have a date field inside my table (datetime type). So I tried to put another condition in my WHERE clause. This is:

WHERE something = something else AND mydate = DATEPART('dd', getdate())

or

WHERE something = something else AND mydate = DAY(getdate())

Both don't work..

I wonder if I can really use this in a WHERE clause...of if I'm using them correctly.

View 5 Replies View Related

Managing Job Roles?

Feb 7, 2001

Does anyone know if it's possible to grant a user the ability to manage jobs in server agent besides giving them SA rights? I none of the server roles beside SA seem to be able to work.

Thanks

View 1 Replies View Related

Managing SQL Data

Aug 16, 2004

Hello,

I am currently working on a large project that will be developed using MS SQL. I have been considering two options when it comes the creation of the database. The first option is to create a sepereate table for each of my clients. The tables would be labeled by their Id number then the tables reqular name. Fore example : 781_Users.

The other option is to create a different database for each of the clients.

I just need the data to be seperated between clients, it cant mix. Please just give me your opinion on which option you would consider if you were operating a large project.

Thanks in advance!

View 2 Replies View Related

Managing SQL Remotely

Sep 27, 2004

Has anyone experienced any limitaions or concerns for managing SQL 2K remotely using remote desktop, pleased advise.

Thanks

View 1 Replies View Related

Managing The Tempdb: Help

Jan 9, 2008

Hello everyone. Have a little situation here. I am not normally the DBA at my work, but i've been poking around a little with a SQL Server 2005 implementation. I'm pretty new to this, so please pardon my lack of knowledge.

This particular server is running a lightly used SQL server, or so im told. As part of my Sys Admin duties, I logged into the box today for some routine checks, only to be notified that I was running out of disk space (which is another story).
After poking around awhile, I see that my tempdb is almost 15gb in size.

I don't have a lot of experience with SQL Server 2005. I've worked mostly with 2000. I did read a few things where tempdb has changed a bit in 2005? I wasn't sure.

So I have about 10gigs of space free on my HD (I'm adding more space tomorrow) and I need to figure out what to do.

I came across this thread here:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=64914

is that something I should do? I'm a little concerned I might run out of space overnight and not make it in time.

Anyone have some suggestions?

Thanks.

TCG

View 10 Replies View Related

Managing Users

Jan 3, 2006

Hello,Has anyone ever come across a reason why someone would manually create auser table incl. permission flags and not use the inbuilt user/rolesprovided by that database? The only reason that stands out for me is tomake the database that bit more portable?Thanks,Craig.

View 2 Replies View Related

Managing MS SQL On Linux

Sep 12, 2006

Hi everyone,I'm looking into moving my desktop system at work to Linux from WindowsXP, and one tool I've yet to find a suitable replacement for is MS SQLEnterprise Manager. I mainly need to query MS SQL databases fromLinux, and management tasks (monitor backups, services, etc) can bedone on the MS SQL servers themselves. THere was an application I usedto use on OSX which would connect to a variety of databases, includingMS SQL, and they had a Linux version of the client .. but can'tremember the name. But really any Sybase client that can connect to MSSQL with some ease will work.Thanks for any suggestions or ideas ...Alex

View 5 Replies View Related

Managing Concurrency

May 15, 2007

I want to centralize my previous standalone application. Previous application was using VB.NET and Access XP. Now I want to keep a centralized database (SQL Server 2005) and VB.NET 2005. At this point of time thousands of concurrent users will connect to the database at the same time.

In my application, when a ticket is being issued to a tourist, an SQL query finds the max(ticketno) for the current month from the main table and reserves this number for the current ticket. When the operator has finished entering information and clicks SAVE button, the record is saved to the main table with this ticket no. Previously there was no issue since the database was standalone.

I want to know how to block the new ticket no so that other concurrent users are not using the same number for saving a record. How to better tune the database for thousands of concurrent users at the same time? I also want that the other user must not get an error message when he attempts to save a record. It should be automatically handled by the database.

View 8 Replies View Related

Managing Indexes

Sep 5, 2007

Hello,I have an ASP.NET website which uses SQLServer 2000 as database. I am into tracking the customers who visit to the website. We are getting around 10000 users per day. When each page gives request, request details will be inserted into SQL tables.Table's I am using is indexed. I am in confusion that when these index will be regenerated ? Will it regenerated automatically when new row's are inserted ? or do we need to regenerate it manually ? And what is the difference on Clustured Indexing and Full text indexing ? Which one I should use for better performance ?Thanking youNavaneeth

View 6 Replies View Related

Error Managing

Jul 4, 2006

Hi everyone,
When an error occured in a transaction and we can also create a message for this error ourself too by using @@error in order to print a message . However, I wonder that is it possible to really catch and handle the error ??
For example, when error occured it makes the transaction terminated. So how can we prevent transaction from terminating ??
Meanwhile, I also examine RAISERROR statement but it also does not prevent a transaction from terminating instead ÅŸt only provide an additional message for the error.

View 6 Replies View Related

Managing SQL Server Remotely

Jun 26, 2007

I've combed through SQL Help to find the answer to my question but I think it's telling me it can't be done. I work both from an office with my servers and from home. When I'm at home I would like to access my SQL server remotely using a tool such as MS SQL Server Management Studio. But it appears there is no way to access my SQL Server for management purposes using Management Studio over a remote internet connection. I can access the server using Management Studio while I'm on the internal office network but not from home.
Has anyone been able to do this or might recommend a third party tool as robust as Management Studio?
Thanks 
 

View 6 Replies View Related

SQLDatasource - Managing Programatically

Nov 25, 2005

HiI'm trying to access the properties of my datasource programatically so I can change the stored procedure it connects to depending on the value of a querystringIn my page load I have
Dim myMode = Request.Params("mode")Select Case myMode   Case "Category"      sqldatasource1.SelectCommand = "productsbycategory"      sqldatasource1.SelectCommandType = SqlDataSourceCommandType.StoredProcedure      ******'Need to add querystring parameter   Case "Wishlist"      sqldatasource1.SelectCommand = "productsbywishlist"      sqldatasource1.SelectCommandType = SqlDataSourceCommandType.StoredProcedure      ******'Need to add Session variable parameter   Case Else      sqldatasource1.SelectCommand = "allProducts"      sqldatasource1.SelectCommandType = SqlDataSourceCommandType.StoredProcedureEnd SelectThe problem that I have is that I need to pass a parameter to the first 2 procedures above, a querystring to the first and a session variable to the second.How do I add parameters programaticallyMany thanks

View 2 Replies View Related

About Managing SQL Server 2005

Jan 2, 2006

Hi, I just start using MSSQL server 2005, I already install vss studio
2005 so SQL server 2005 is already installed by default (express
edition).

But unlike SQL server 2000, I coultn't find any tools similiar to "sql
entreprise manager". I was able to create a new database only from
server explorer tools in VSS. But pretty strange that this database act
like a microsoft access database (creating a database file on my
app_data folder). (I am sorry I am new in SQL server 2005
ExpressEdition ).

My question :
1. is that (above) really how mssql server 2005 works?
2. how to create a new user for this database? (example user: sa password: "admin")

thanks

View 2 Replies View Related

Web Interface For Managing SQL Server

Jun 11, 2001

Hi all

Does any one know abt the web interface for managing SQL SERVER
I would like to create database,create tables create users, modify, insert data etc.. over the web

i belive there are interfaces are available on the net

can any body tell me from where i can download it

Thanks in advance

Prasad

View 2 Replies View Related

Managing Excel Execution Through DTS

Oct 14, 2004

We have a convoluted DTS package. The package is stored and scheduled to run on database server1. Within the package we:
• Make a connection to database server2
• Execute a ‘Process Task’ to execute EXCEL.EXE that is installed on server3
• Pass parameters through the ‘Process Task’ direct EXCEL.EXE to open a .xls file on server4
• When the Excel file opens, an auto_exec macro in the Excel file being opened imports a text file local to server4 AND directs Excel to save it with another name on server4.

The questions are:
1.Excel is not installed on server1 so how do we direct Excel to execute on server3 rather than server1 where the DTS package is being executed?

2.And how do we control the security context that executes Excel through this use of automation?

3.Other than potential CPU competition, are there any significant issues with having Excel installed on a dedicated database server?

View 3 Replies View Related

SPROC For Managing Users

Feb 2, 2007

I'm fairly new to SQL server, and I'm helping someone who has a fairly high employee turnover rate.

I would like to create an interface that would allow her to add/edit/delete users and their permissions without having to get into management studio. I'll build a form in the front end application that will presumably pass parameters to a SProc that will do the work.

Her users fall into two categories - full and read only. The tasks she'll need to perform are very simple.

1) Add new user with full access to all tables
2) Add new user with read only access to all tables
3) Change user access from read only to full
4) Change user access from full to read only
3) Delete user

Can someone point me in the right direction on this? Some sample code would be nice, but at the very least I'd like a better term to search by..

Searching for "stored procedure user permissions" brings up tons of hits that mostly deal with who can and can't run a sproc..

View 14 Replies View Related

Managing SQL 2000 And 2005

Jul 10, 2007

I currently use Enterprise Manager 8.0 with several SQL 2000 servers. I'm ready to work with my first SQL Server v 2005. Can I use EM 8.0 along side the new Management Console until I'm through the learning curve? I understand you cannot register a 2005 server with EM 8.0, but I assume you can register a 2000 server from the new Management Console without any problem.

View 1 Replies View Related

Managing Package Configurations

Nov 5, 2007

Hello,

I have a solution with a lot of packages, and each of them has configurations set on an SQL Server table. Right now the information in the table is outdated and I'd like to overwrite it with the new values on the properties of each package (and its elements). Is there another (faster) way to do this without having to disable/enable or recreate all configurations manually?


Thanks in advance

View 7 Replies View Related

Managing SQL Server Agent

Apr 11, 2006

Hi,

I would like to know what are the possibilities to
mange the Sql server Agent in the Sql Server 2005 express edition whit
the Sql server mangement studio express, because I can't see it .



thanks

View 1 Replies View Related

Managing Large Database

Aug 11, 2007

I am developing an office automation software for a government department. To start with, I have decided to first automate the salary section of the department. Because of some issues like, TCO, easy support and maintenance, scalability etc., I have decided to use SQL Server 2005 database with VB 2005 front-end.

I have planned the layout for this first part and found that in only employee salary table, 40,000 records per month will be stored. That comes out to be around 480,000 records annually. This is for one table alone, excluding data in other tables.

Since each section of the department will be integrated into this later, this application will become the backbone the department. The employee service, leave, salary, allowance, deduction and other records shall be maintained.

For this type of mission-critical application, I want to get some queries cleared:

(1) What backup strategy should be followed? I want to have schedule and maual backups both. Is there any way to have a mirror image on another server?

(2) What considerations to keep in mind in the inital stage of database design?

(3) How to keep the design scalable and configurable to meet future needs?

View 6 Replies View Related

SQL2005, Managing Memory

Jan 24, 2008

Hello~

I operate MsSql server with Maximum Server Memory.


The server has 2GB main memory and Maximum Server Memory is 1GB.



If sqlserv.exe use 1GB main memory, new query is not cached.


I think, sql server release pages in main memory to cache new query. but no release.

By above reason, performance of new query is not good.

How can sql server cache new query?


-- Memory Setting --

MIN : 0, MAX : 1GB




Because my English is poor, I am sorry.

View 5 Replies View Related

Managing Transactional Replication

Jul 15, 2006

Hi everybody,

I wish to manage the process of transactional replication between two SQL databases using a c# (or any other possible language, does not differ) written tool. More accurately, I have a database in my server, and I want to have the program to be run from any other computer and does the replication between the local pc(where the program is run) and my server. More to say is that the connection between the server and pc(s) is over the internet.

I would be so thankful if anyone would help me to solve the issue,

with regards

farshad

View 5 Replies View Related

Managing PK/FK Relationships With The Tools

Aug 23, 2006

Ah, why doesn't SQL Server Management Studio (SSMS) or Visual Studio's Server Explorer permit me to set PK/FK constraints on the tables? They're supported in SQL Everywhere (SQL Ev), but I don't see a way to set them up.

Why don't these tools support scripting the database tables to SQL? Is this planned?

View 3 Replies View Related

Using A Separate DAO Class And Managing Connections

Jun 27, 2006

I'm writing an application where I have a class which for example represents a User and I have a UserDAO class which holds all the calls to the database. When I'm trying to create a user, I call my User class pass in the username and password from the login box. Then in my UserDAO I pass these details to a stored procedure to query the database. In this method in the UserDAO I open a SqlConnection call the stored proc and set the results to a SqlDataReader. Then I return this SqlDataReader object which I've created.In my User class the method I populate the user class properties with create a SqlDataReader based on the method on the UserDAO method.My problem is first how can I close the connection I originally created in my UserDAO, as I'm returning a SqlDataReader object I can't close my SqlConnection object before returning in the method. And I can't close the SqlConnection in my User class.Is there another way to separate all my DAO methods in a separate (UserDAO, SecurityDAO etc), but call them in my main classes (User, Security etc).ThanksStephen

View 1 Replies View Related

Managing Security Settings Remotely

Mar 3, 2008

Hi.
I have a website and database using membership which is running successfully on my remote hosting server.
When I go online, I can add a new member because my login page contains a login .NET component.
Question: Is there anyway I can, as the adminstrator, manage the security settings for the members (delete members, define/assign roles etc.) on line?
Or do I have to do it locally on my PC, and then update the remote database? (hopefully not...)
Thanks in advance,
Garrett

View 1 Replies View Related

Managing Development & Production Databases

Jun 6, 2000

Hello everyone,

I have a question about how to efficiently develop on a development version of a database and get those changes over to the production database without loosing live data, etc.?

Here is how we are trying it:

1 Export production database to temp database(exact copy)
2 Delete production database
3 Export development database (definition only, no data) to new database with production database's name
4 Export production (temp) database (data only) over to new production shell

We are having truncate errors due to FK constraints.

Is there a better way?

Thanks for all help

Kevin

View 1 Replies View Related







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