Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Implicit Connection & Cursor / Lock

Author  Topic 

azbatuk
Starting Member

19 Posts

Posted - 2001-11-28 : 10:58:49
Hello,

I am new to SQL and trying to learn. I don't have a clear idea on these Cursor and Lock types with regard to SQL queries.

I read 2 different ideas so far. One is saying I shouldn't use Explicit connections and define Cursor and Lock types. The other one says I was wise to avoid using Cursor types and with regard to Lock types SQL server's defaults were mostly fine.

My questions are these :

- Explicit or Implicit :
I am trying to avoid using ADO Recordset object and mostly using Implicit connection for updates and inserts with SQL statements "INSERT" and "UPDATE". Below you can see examples of how my codes are.

SELECT statement example;
Sql = "SELECT * FROM members WHERE memberid=" & Request("memberid")
Set RS = Conn.Execute(Sql)

UPDATE statement example;
Sql = "UPDATE members SET "
Sql = Sql & "email='" & email & "'"
Sql = Sql & ", siteurl='" & siteurl & "'"
Sql = Sql & " WHERE memberid=" & Request("memberid")
Conn.Execute(Sql)

INSERT statement example;
Sql="INSERT INTO members (membername, email, registerdate) values("
Sql = Sql & "'" & membername & "'"
Sql = Sql & ",'" & email & "'"
Sql = Sql & ",'" & date() & "'"
Conn.Execute(Sql)

As you can see, I don't use ADO Recordset object and there is no Cursor and Lock types.
Any ideas about if I am doing right or wrong ?

- Very Heavy Traffic:
Imagine, you have an ASP page that receives 200,000 views a day, and there are SELECT, UPDATE and INSERTs in this page, and most of these queries are executed on the same table.
What should I do so that there will not be many Deadlocks and script timeouts ?

All help is greately appreciated. :)


AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2001-11-28 : 16:47:28
Really, there's no need to post your question multiple times at SQLTeam. Most of the common visitors view all new questions at all Forums. I've posted some info here: [url]http://www.sqlteam.com/Forums/topic.asp?TOPIC_ID=10969[/url].

Graz, Should this one get locked?

-------------------
It's a SQL thing...
Go to Top of Page

azbatuk
Starting Member

19 Posts

Posted - 2001-11-28 : 16:49:33
Sorry

Go to Top of Page
   

- Advertisement -