Locks Count And Importing PL/SQL To TSQL
Hi everyone.
I have 3 questions.
1. How do you count the number of locked row in a table when you do a select statement?
2. Is there any software out there that imports PL/SQL to TSQL? We have ALOT to import and not enough ressource to do it manually.
3. What do you guys/girls recommended for a book in TSQL?
Thank you!
Sebs
613-951-2398
sauljea@statcan.ca
Bonjour tout le monde.
J'ai 3 petites question.
1. Comment peut-on compter le nombre d'enregistrements "Lock" dans une table lors d'un select statement?
2. Existe-t-il un logiciel qui importe des procédures PL/SQL à TSQL?
3. Qu'es-ce que vous recommendez comme livre pour la programmation en TSQL?
Merci!
Sebs
613-951-2398
sauljea@statcan.ca
View Complete Forum Thread with Replies
Related Forum Messages:
TSQL Stored Procedure - Get Count Where....
I have the following for sql server 2000... Select b.courseName, a.courseId, count(a.courseId) as [count], avg(convert(INT, a.fldScore)) as [average], count(fldPass) as [passed], count(fldPass) as [failed] From tblTest a inner join tblTest2 b on a.courseId = b.courseId Group by a.courseId, b.courseName Problem is the [passed] and [failed] As it is, it's counting all of them. I need to adjust it so passed will only read where fldPass = 'yes' and fldPass = 'no' for the passed and failed. Suggestions? Thanks, Zath
View Replies !
TSQL: I Want To Use A SELECT Statement With COUNT(*) AS 'name' And ORDER BY 'name'
I am very new to Transact-SQL programming and don't have a programmingbackground and was hoping that someone could point me in the rightdirection. I have a SELECT statement SELECT FIXID, COUNT(*) AS IOIsand want to ORDER BY 'IOI's'. I have been combing through the BOL, butI don't even know what topic/heading this would fall under.USE INDIISELECT FIXID, COUNT(*) AS IOIsFROM[dbo].[IOI_2005_03_03]GROUP BY FIXIDORDER BY FIXIDI know that it is a simple question, but perhaps someone could assistme.Thanks,
View Replies !
TSQL + VBA Excel 2003 - Importing Data From MS Excel 2003 To SQL SERVER 2000 Using Multi - Batch Processing
Hi, I need to import an SQL string from MS Excel 2003 to SQL SERVER 2000. The string I need to import is composed by 5 different several blocks and looks like: Code Snippet CommandLine01 = "USE mydb" CommandLine02 = "SELECT Block ..." CommandLine03 = "GO ALTER TABLE Block... GO" CommandLine04 = "UPDATE Block..." CommandLine05 = "SELECT Block..." The detail of the SQL string is at: http://forums.microsoft.com/msdn/showpost.aspx?postid=2093921&siteid=1&sb=0&d=1&at=7&ft=11&tf=0&pageid=1 I am trying to implement OJ's suggestion: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2117223&SiteID=1 to use multi - batch processing to import the string to SQL SERVER, something like: Code Snippet Dim SqlCnt, cmd1, cmd2, cmd3 'set the properties and open a connection cmd1="use my_db" cmd2="create table mytb" cmd3="insert into mytb" SqlCnt.execute cmd1 SqlCnt.Execute cmd2 SqlCnt.Execute cmd3 Below is the code (just partial) I have, and I need help to complete it. Thanks in advance, Aldo. Code Snippet Function TestConnection() Dim ConnectionString As New ADODB.Connection Dim RecordSet As New ADODB.RecordSet ConnectionString = "Driver={SQL Server};Server=myServer;Database=myDBName;Uid=UserName;Pwd=Password" ConnectionString.Open CmdLine01 = " USE " & myDB CmdLine02 = " SELECT ACCOUNTS.FULLNAME FROM ACCOUNTS" ... CmdLine03 = "GO ALTER TABLE Block... GO" CmdLine04 = "UPDATE Block..." CmdLine05 = "SELECT Block..." RecordSet.Open CmdLine01, ConnectionString RecordSet.Open CmdLine02, ConnectionString ConnectionString.Execute CmdLine01 ConnectionString.Execute CmdLine02 'Retrieve Field titles For ColNr = 1 To RecordSet.Fields.Count ActiveSheet.Cells(1, ColNr).Value = RecordSet.Fields(ColNr - 1).Name Next ActiveSheet.Cells(2, 1).CopyFromRecordset RecordSet 'Close ADO objects RecordSet.Close ConnectionString.Close Set RecordSet = Nothing Set ConnectionString = Nothing End Function
View Replies !
Transaction Count After EXECUTE Indicates That A COMMIT Or ROLLBACK TRANSACTION Statement Is Missing. Previous Count = 1, Current Count = 0.
With the function below, I receive this error:Error:Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing. Previous count = 1, current count = 0.Function:Public Shared Function DeleteMesssages(ByVal UserID As String, ByVal MessageIDs As List(Of String)) As Boolean Dim bSuccess As Boolean Dim MyConnection As SqlConnection = GetConnection() Dim cmd As New SqlCommand("", MyConnection) Dim i As Integer Dim fBeginTransCalled As Boolean = False 'messagetype 1 =internal messages Try ' ' Start transaction ' MyConnection.Open() cmd.CommandText = "BEGIN TRANSACTION" cmd.ExecuteNonQuery() fBeginTransCalled = True Dim obj As Object For i = 0 To MessageIDs.Count - 1 bSuccess = False 'delete userid-message reference cmd.CommandText = "DELETE FROM tblUsersAndMessages WHERE MessageID=@MessageID AND UserID=@UserID" cmd.Parameters.Add(New SqlParameter("@UserID", UserID)) cmd.Parameters.Add(New SqlParameter("@MessageID", MessageIDs(i).ToString)) cmd.ExecuteNonQuery() 'then delete the message itself if no other user has a reference cmd.CommandText = "SELECT COUNT(*) FROM tblUsersAndMessages WHERE MessageID=@MessageID1" cmd.Parameters.Add(New SqlParameter("@MessageID1", MessageIDs(i).ToString)) obj = cmd.ExecuteScalar If ((Not (obj) Is Nothing) _ AndAlso ((TypeOf (obj) Is Integer) _ AndAlso (CType(obj, Integer) > 0))) Then 'more references exist so do not delete message Else 'this is the only reference to the message so delete it permanently cmd.CommandText = "DELETE FROM tblMessages WHERE MessageID=@MessageID2" cmd.Parameters.Add(New SqlParameter("@MessageID2", MessageIDs(i).ToString)) cmd.ExecuteNonQuery() End If Next i ' ' End transaction ' cmd.CommandText = "COMMIT TRANSACTION" cmd.ExecuteNonQuery() bSuccess = True fBeginTransCalled = False Catch ex As Exception 'LOG ERROR GlobalFunctions.ReportError("MessageDAL:DeleteMessages", ex.Message) Finally If fBeginTransCalled Then Try cmd = New SqlCommand("ROLLBACK TRANSACTION", MyConnection) cmd.ExecuteNonQuery() Catch e As System.Exception End Try End If MyConnection.Close() End Try Return bSuccess End Function
View Replies !
Equivalent Tsql For Sql Server 2000 Is Needed [from Sql Server 2005 Only Tsql]
Can anyone please give me the equivalent tsql for sql server 2000 for the following two queries which works fine in sql server 2005 1 -- Full Table Structure select t.object_id, t.name as 'tablename', c.name as 'columnname', y.name as 'typename', case y.namewhen 'varchar' then convert(varchar, c.max_length)when 'decimal' then convert(varchar, c.precision) + ', ' + convert(varchar, c.scale)else ''end attrib,y.*from sys.tables t, sys.columns c, sys.types ywhere t.object_id = c.object_idand t.name not in ('sysdiagrams')and c.system_type_id = y.system_type_idand c.system_type_id = y.user_type_idorder by t.name, c.column_id 2 -- PK and Index select t.name as 'tablename', i.name as 'indexname', c.name as 'columnname' , i.is_unique, i.is_primary_key, ic.is_descending_keyfrom sys.indexes i, sys.tables t, sys.index_columns ic, sys.columns cwhere t.object_id = i.object_idand t.object_id = ic.object_idand t.object_id = c.object_idand i.index_id = ic.index_idand c.column_id = ic.column_idand t.name not in ('sysdiagrams')order by t.name, i.index_id, ic.index_column_id This sql is extracting some sort of the information about the structure of the sql server database[2005] I need a sql whihc will return the same result for sql server 2000
View Replies !
Altering Table Issues (total Row Count Vs Exported Row Count)
Please help me... I had a table with x number of fields... I had this data source view and model ... if I selected some information about the table everything was ok... yesterday I altered the table adding two more fields. I create a new data source, data source view and model to get the new database fields included... now I filter using those fields... and the report is telling me... 81 records... but I exported the data to csv... and I only see 58 records... I do a manual query thru query analyzer... and got the 81 records... some records did not appear... I have no filters... no relations, just one table just one field selected in the report I'm building. any ideas ??? kindest regards. elias.
View Replies !
In SQL 2000 Can I Use Count() To Count A Column?
I use SQL 2000 I have a Column named Bool , the value in this Column is 0�0�1�1�1 I no I can use Count() to count this column ,the result would be "5" but what I need is "2" and "3" and then I will show "2" and "3" in my DataGrid as the True is 2 and False is 3 the Query will have some limited by a Where Query.. but first i need to know .. how to have 2 result count could it be done by Count()? please help. thank you very much
View Replies !
Table Row Count + Index Row Count
SQL 2000I have a table with 5,100,000 rows.The table has three indices.The PK is a clustered index and has 5,000,000 rows - no otherconstraints.The second index has a unique constraint and has 4,950,000 rows.The third index has no constraints and has 4,950,000 rows.Why the row count difference ?Thanks,Me.
View Replies !
DTSDestination.Count And DTSSource.Count
I'm trying to create a VB Script that gets the # of columns from a source table and the # of columns from the destination table and creates a transformation based on the number of columns in the source table. I can write the actual transformation, but does anyone have an example of how I can get the DTSSource.Count property to return an integer? Much Thanks, Dan O'Malley dan_o@leaseteam.com
View Replies !
Properties Row Count Not = Select Count(*)
I have a SQL2000 table, and when I display Properties, it says the row count = 927, but when I do select count(*), I get 924. I did a refresh on everything (since refresh is often needed), finally exited SQL Ent Mgr, went back in with the same result. I believe 924 is the correct count ..... Is that table corrupted somehow ? Can I trust the count in "Properties" for other tables ?
View Replies !
Locks
I have read that even during read procedures (sql select statements), sql server uses row locking. I know that you can use the NOLOCK keyword, but if you don't everytime that a user makes a selects statement on a table, does sql server really lock those rows, and if so are they then unavailable to another user who wants to make a select statement at the same time on that same table? That does not seem like it would be the case otherwise it would not scale well. Thanks for any clarification on this.
View Replies !
Locks
Hello, I have a problem in SQLSERVER 2000, when I execute a Query, the table get locked for insert or any other transaction, even for other queries. Does SQL Server have a kind of lock mode different of Oracle ? How do I solve this problem ??
View Replies !
Locks
Hello There !! I have a very big problem, with SQL SERVER 2000. I want to know about the locks with select. When I execute a Select (so big), and I try to update or Insert into one of the tables that I invoke in the select, I get locked. Is there in SQL Server, something like a Select for update, that could be causing the problem ??? Is there any way to select rows from a table without locking it ? I really have a big problem with this, and I don't know so much about sql server ! Thank you so much !!!
View Replies !
Locks
I Have 359 locks on MY Database ,They are always there on my DB.The DB is a development database and lots of summary Stored procedures will be running on this DB. Does it effect the performance.How can I remove those locks. Thanks.
View Replies !
Locks
Hi All, Sql server 7 pls provide me sql statement that shows all the locks. the goal is to produce the output on an HTML page. pls help me in solving this TIA Adil
View Replies !
Locks
2 quick questions : 1) How do I keep multiple users from editing the same record without locking the entire table? What would be a 'standard' way of handling this? 2) How do I keep 2 people from posting the same record? Please help me understand locking, THANKS!!!
View Replies !
Locks For A Max Value
I have a stored proc which will be entering/updating a record into a table. The table's key is an integer field which I may have to increment by one. I know I can use declare @nextid int set @netxid = max(id) from table insert @nextid into table Is some kind of lock the best way to approach this?
View Replies !
Regarding Locks
I am using Sql Server 7.0 To I got the following error message. Can some one tell how to solve this issue. Server: Msg 1204, Level 19, State 1, Procedure OPEN_OBJECTS, Line 2 SQL Server has run out of LOCKS. Rerun your statement when there are fewer active users, or ask the system administrator to reconfigure SQL Server with more LOCKS. ranga.
View Replies !
SQL Locks
what the best way to control locks, if inserting couple thousands records from one table to another.
View Replies !
Locks
Hi I have a big query which updates around 14000 rows at a time if i place a lock on the table and others try to update the same table is it possible to let them know that table is locked by someone else.
View Replies !
EM Locks Up..
Has anyone had this before and know a solution. We cannot connect to our SQL 7.0 database (on W2K cluster) through the EM tool. Our application and Query analyzer, profiler, etc. connect just fine. Any ideas? Thx..
View Replies !
Locks
I am using SQL Server7.0. I opened a table through the Enterprise Manager and left it open. In the Query Analyzer when I try to update a field on that table(more than 2000 rows), it goes on running. When I watched the Current Activity, it shows that the update process is being blocked by the select query. But if I try to update the same column for less than 1500 rows, there is no blocking issue and the update occurs immediately. Can anybody let me know why this is happening and what should I do to prevent it?
View Replies !
Locks
if have a transaction with statments like begin insert into table A ...where exists (select .. from table A) transaction What locks will be placed while inserting and selecting rows,if multiple users are accessing this concurrently
View Replies !
Locks
Hi I want to write all my select ststements using locks how i should write a select ststement using locks i searched for examples but iam not getting the syntax Plz give me one example for select statements using locks thanks in advance Malathi Rao
View Replies !
Obtain Unit Percent With Unit Count Divided By Total Count In Query
The following query returns a value of 0 for the unit percent when I do a count/subquery count. Is there a way to get the percent count using a subquery? Another section of the query using the sum() works. Here is a test code snippet: --Test Count/Count subquery declare @Date datetime set @date = '8/15/2007' select -- count returns unit data Count(substring(m.PTNumber,3,3)) as PTCnt, -- count returns total for all units (select Count(substring(m1.PTNumber,3,3)) from tblVGD1_Master m1 left join tblVGD1_ClassIII v1 on m1.SlotNum_ID = v1.SlotNum_ID Where left(m1.PTNumber,2) = 'PT' and m1.Denom_ID <> 9 and v1.Act = 1 and m1.Active = 1 and v1.MnyPlyd <> 0 and not (v1.MnyPlyd = v1.MnyWon and v1.ActWin = 0) and v1.[Date] between DateAdd(dd,-90,@Date) and @Date) as TotalCnt, -- attempting to calculate the percent by PTCnt/TotalCnt returns 0 (Count(substring(m.PTNumber,3,3)) / (select Count(substring(m1.PTNumber,3,3)) from tblVGD1_Master m1 left join tblVGD1_ClassIII v1 on m1.SlotNum_ID = v1.SlotNum_ID Where left(m1.PTNumber,2) = 'PT' and m1.Denom_ID <> 9 and v1.Act = 1 and m1.Active = 1 and v1.MnyPlyd <> 0 and not (v1.MnyPlyd = v1.MnyWon and v1.ActWin = 0) and v1.[Date] between DateAdd(dd,-90,@Date) and @Date)) as AUPct -- main select from tblVGD1_Master m left join tblVGD1_ClassIII v on m.SlotNum_ID = v.SlotNum_ID Where left(m.PTNumber,2) = 'PT' and m.Denom_ID <> 9 and v.Act = 1 and m.Active = 1 and v.MnyPlyd <> 0 and not (v.MnyPlyd = v.MnyWon and v.ActWin = 0) and v.[Date] between DateAdd(dd,-90,@Date) and @Date group by substring(m.PTNumber, 3,3) order by AUPct Desc Thanks. Dan
View Replies !
Locks In SQL2000
How to lock a Row in SQL2000 so that nobody can select that row. I applied ROWLOCK, but i am not finding the way. My query is "SELECT * FROM tablename WITH (ROWLOCK)" Is this the correct way to write locks. I would be thankful if u help me
View Replies !
Many Tempdb Locks?
hi all,we have a SQL2000SP3 runing in W2K3. The application is JDEdwards.recently I've observed that once in a while (about a few hours), therewould be a process from the ERP application that holds quite a numberof extent locks in tempdb, can be as high as 10000 locks. when I runsp_lock on that spid, it gives something like this:697200EXT1:156760 XGRANT697200EXT1:94896 XGRANT697200EXT1:132224 XGRANT697200EXT1:140488 XGRANT697200EXT1:181552 XGRANT697800DB SGRANT697200EXT1:165280 XGRANT697200EXT1:127888 XGRANT697200EXT1:173544 XGRANT697200EXT1:152624 XGRANT697200EXT1:160888 XGRANT697200EXT1:144616 XGRANT697200EXT1:198336 XGRANT697200EXT1:107296 XGRANT697200EXT1:99176 XGRANT697200EXT1:169344 XGRANT697200EXT1:115704 XGRANTI am wondering what action is it doing, creating temp tables?? manythanks.
View Replies !
Question On Locks
somebody helps ?1.What kind of lockes are created on what resources when followingquerys executes ?select * from JOBQUEUE where ID='XXX'update JOBQUEUE set columnA='YYY' where ID='XXX'2.Under what kind of situation, share lock on a row or on a page or on atable will convert to exclusive lock?Thanks a lot.*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!
View Replies !
Tracing Sql For Locks
I am fairly new to SQL Server. I am writing a tool in stored procedureto identify locks in a table. I have already written the basic frameworkof the SP. It will reside in master database and take two inputs. Databasename and table name. From that it will show all locks at that instanton that table of that database. If table name is omitted, then it will showlocks on all tables.I am using syslockinfo, spt_values tables and joining with SP_WHO procedureto get the table name, user name and the session id.Now what I need is to find out which SQL is causing the lock and since whenlock is being held on the table. Which tables in master database holds therequired information.TIA.Ravi
View Replies !
Copy Without Locks
I have a stored procedure which copies data from a view into atemporary table (x2) and then from the temporary table into a tablewhich the users use. It takes 1 minute to get the data into the temptable and seconds to update into the final one (hence the two stages).When I do the initial copy from the view, it locks the various tablesused in the view and potentially blocks the users. It's a complex viewand uses plenty of other tables. We get massive performance issues'generating' the data into a table as opposed to the view.What I want to do is take all the data without locking it. I don'twant to modify the data, just read it and stick the data into a table.ThanksRyanSQL as follows :/*Drop into temp tables first and then proper ones later as thisworks out a lot less time when no data will be available*/TRUNCATE TABLE MISGENERATE.dbo.CBFA_MISDATATemp -- Temp TableTRUNCATE TABLE MISGENERATE.dbo.CBFA_MISPIPDATATemp -- Temp TableINSERT INTO MISGENERATE.dbo.CBFA_MISDATATempSELECT * FROM MIS.dbo.CBFA_MISDATA -- ViewINSERT INTO MISGENERATE.dbo.CBFA_MISPIPDATATempSELECT * FROM MIS.dbo.CBFA_MISPIPDATA -- View/*Now drop this into full MIS tables for speed*/TRUNCATE TABLE MISGENERATE.dbo.CBFA_MISDATATRUNCATE TABLE MISGENERATE.dbo.CBFA_MISPIPDATAINSERT INTO MISGENERATE.dbo.CBFA_MISDATA -- Final TableSELECT * FROM MISGENERATE.dbo.CBFA_MISDATATempINSERT INTO MISGENERATE.dbo.CBFA_MISPIPDATA -- Final TableSELECT * FROM MISGENERATE.dbo.CBFA_MISPIPDATATemp
View Replies !
Locks With Select
Hey I have a terrible problem !! I have a query, and It doesn't matter if it has finished, the table is still locked. Is there any clause to unlock the share mod lock (force) when the query has finished or any way to ensure that table has no locks to continue with another query or transaction ? Could you give me any sentence ? Thanks you !!
View Replies !
Intermittent Locks
We are experiencing problems intermittently. Users report problems of various types including timeout messages. We investigate and find a user has acquired a lock which is blocking other users. We contact the user and they have usually completed their activity and are not always aware of any problem despite them owning a lock. When the user logs out of the application the lock clears and the system returns to normal. Indexes have been rebuilt, auto update statistics is on. Does anyone have any suggestions? :cool:
View Replies !
SQL Server Locks?
I have a simple web application using ASP.NET/C#/SQL Server 2000/Windows 2000 I'm having problems with the server "hanging" for ~15 minutes. Disk/CPU are idle so this isn't a resource issue. In Enterprise Manager, under "Current Activity" I see several processes waiting on: LCK_M_X LCK_M_S LCK_M_S NETWORKIO How do I investigate this? My application is so simple, I have trouble imagining how a lock-related problem could ocurr? There is absolutely no concurrent processing done on this server. There is only one user running this app and there are no separate threads spawned. Although this problem is sporadic, this happens the most while doing the following: - Open connection1 (for SELECT) - Open connection2 (for UPDATE) - Open SqlDataReader through connection1 with SELECT statement - Iterate through - For certain records issue UPDATE statement via connection2. Here are some sample code snippets. Default ADO.NET options and everything should be cleaned up through C# "using" blocks without relying on garbage collection. using (SqlConnection selectConnection = LeadsDatabase.OpenConnection()) { using (SqlConnection updateConnection = LeadsDatabase.OpenConnection()) { using (SqlCommand dbCommand = new SqlCommand(sql, selectConnection)) { using (SqlDataReader reader = dbCommand.ExecuteReader()) { while (reader.Read()) { using (SqlCommand updateCommand = new SqlCommand(sql, updateConnection)) { updateCommand.ExecuteNonQuery();
View Replies !
SQL Page Locks
I understand the basic concept of page locks and table locks, but I am unclear of the exact details of the locks. Would someone please explain this to me? User A goes into WORK_ORDER table record 1 User B goes into WORK_ORDER table record 2 records 1 and 2 are on the same page. Would user B would be able to access/modify the record even though user A already had a lock set? Or would that page be locked until user A`s lock was released? What would happen if user A tried to access record 2 as well as record 1? also, What would happen if user B tried to access record 1 if user A was already in it? Thank you so much! Toni
View Replies !
SQL Server Locks
I am having a problem with an SQL6.5 server locking up periodically. I go into the error logs and there is the following message: 98/12/08 20:16:30.64 kernel dpdb_asyncread: mirror: Operating system error 6(The handle is invalid.) encountered There is also this entry in the Event Application Log: Event ID: 17055 Source:MSSQLServer Type:Error Category:Kernel Description: Mesg 17053 : dpdb_asyncread: mirror: Operating system error 6(The handle is invalid.) encountered I have already searched that ever valuable MS knowledge-base for OS error 6 and found exactly ZIP! Can anybody shed some light on this? Thanks! Andy Roche Senior Consultant WARCOM Services
View Replies !
Intent Locks
I am attempting to delete some records in a table using msquery. Msquery locks up and I see that I have an intent lock on the table in enterprise manager that never seems to get an exclusive lock. What would inhibit an exclusive lock. USer connecting to the database at this time all seem to experience an ODBC error until I kill msquery. I can not kill the intent locks unless killing the msquery app. Any Ideas??
View Replies !
Tempdb Locks
Good day. I have a same problem with tempdb syscolumns locking. I call a procedure thats creates a temporary tables fill its and try to insert a results into a table which have a trigger which try to create a temporary tables. Sometimes this work fine, but sometimes the server is hangs up. The sp_who shows next: spid status loginame hostname blk dbname cmd ------ ---------- ------------ ------------------------------------ ----- ---------- ------------------------------------------------ 1 sleeping sa 0 master MIRROR HANDLER 2 sleeping sa 0 master LAZY WRITER 3 sleeping sa 13 tempdb DUMP TRANSACTION 4 sleeping sa 0 master RA MANAGER 13 sleeping sa PROG1 0 SHOPNEW INSERT 14 runnable sa PROG1 0 master SELECT The sp_lock procedure shows next: ............................ (I cut a big list) 13 Ex_page-blk 3 316 tempdb ............................ After that I can't make anything with hempdb (use sp_who2 or sp_lock2 or any other) and can't a KILL 13. I also can't stop a service SQLServer.exe I can OLNY restart the NT... Note: I tried to use a begin tran ... end tran. No effects reached. And I can't understand why the server hang's up when he want... I have a 20000 LE Threshold maximum.
View Replies !
Systems Locks On SQL 6.5
I have a problem where Backup Exec crashed during a backup of a SQL database and now SQL show 3 extent lock that are now redundant. These cannot be removed from Enterprise manager Is it therefore possible to remove them directly from the master database ?? Thanks
View Replies !
It Can't Happen, SQL Locks Up
I am using SQL Server 6.5, when two or more independent applications put transactions through SQL, it locks up. Example of locks up. When the OrderLines table is locked, then I put the following (Select * from OrderLines) then the query does not return any values, the world goes round and round, the only way out is to shut down and cross my fingers whilst SQL goes into recovery mode. I have read through some of the documentation, such as deadlocks, livelocks and lock starvation but it say none of these will lock the whole machine. But somehow simultaneous transactions can, and the current activity dialog goes red, bright red. Any ideas?
View Replies !
No More Locks Problem When I Have 200,000
We are trying to add a about 100,000 transactions to a table with one non-clustered index and 31 million rows in one transaction. We have 200,000 locks and 64 meg ram for SQL Server. We get a No More locks error. When we try to insert this 100,000 transactions into a table with no rows in it. It works fine using about 7934 locks. How can this be ? what are we doing wrong.? Thanks for any help in advance. Rob Doyle
View Replies !
Sql Server Has Run Out Of Locks
Everytime I try to open the design-mode of a table from enterprise mgr, I get this error 1204.--- SQL Server has run out of LOCKS. Rerun your statement when there are fewer active users, or ask the system administrator to reconfigure SQL Server with more LOCKS. There no other users but me. Locks have been configured to their max (over 200000000). Don't understand whats wrong. Please help..
View Replies !
Update Locks
In the BOL under "Understanding Locking in SQL Server", there are two paragraphs that describe Update locks. In the second paragraph it reads: To avoid this potential deadlock problem, update (U) locks are used. Only one transaction can obtain an update (U) lock to a resource at a time. If a transaction modifies a resource, the update (U) lock is converted to an exclusive (X) lock. Otherwise, the lock is converted to a shared-mode lock. The question is how does SQL determine that a lock can be converted from an exclusive lock to a Shared-mode lock. Thanks
View Replies !
Urgent Locks
I keep getting locks while trying to look at anything in enterprise manager when loading a large tables clustered index. I need to modify a stored procedure but cannot access it. Any advise. Thanks, Steve
View Replies !
Database Locks
How do I temporarily lock a database (read-only mode) programatically? For example: BeginTrans //LOCK OUT ALL OTHER USERS //Only the Server has Write access CommitTrans THANKS!
View Replies !
Row Vs Table Locks
I am interested in getting a better handle on how SQL 2000 determines the locking level to apply to different transactions. I am familiar with the fact that SQL does this on the fly but I was wondering if this could be specified in a Stored Procedure to use one over the other instead and what impact if any that might have on indexes. The databases I work with run anywhere from under 100 GB to 150 GB. Thanks for anyone's input on this subject. Thomas
View Replies !
Locks In SQL Server
Hi All, We have one intranet system working absolutely fine since 9 months. But, all at sudden locking problems started and its just like a nightmare. I ran SQL traces, I checked event viewer and I made changes in my front-end coding so that all my recordsets use proper locking features. But, it didn't help. I know that the presentation of problem is very vague. But, I dont know what else I can write about it. Any help will be highly appreciated. Thanx
View Replies !
|