Showing posts with label connects. Show all posts
Showing posts with label connects. Show all posts

Friday, March 30, 2012

Increase number of process(thread)

Hello all,

A software that connects SQL Server via ODBC uses 12 process at the same
time when I look at the process info(panel). Is it possible to increase
number of process (or thread) for a specific database? Is there any
parameter?

Thanks in advance,
Do.

--
Message posted via http://www.sqlmonster.comDo Park via SQLMonster.com (forum@.nospam.SQLMonster.com) writes:
> A software that connects SQL Server via ODBC uses 12 process at the same
> time when I look at the process info(panel). Is it possible to increase
> number of process (or thread) for a specific database? Is there any
> parameter?

You can change the number of permitted connections with

sp_configure 'user connections', 100 -- 100 is an example here

This is a server-wide setting. There is no per-database setting for this
(and neither would it be really meaningful).

However, the default for this option is 0, which means that the server
configures as it goes on.

Are you getting any error messages about running out of connections?

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||
Do Park via SQLMonster.com wrote:
> Hello all,
> A software that connects SQL Server via ODBC uses 12 process at the same
> time when I look at the process info(panel). Is it possible to increase
> number of process (or thread) for a specific database? Is there any
> parameter?
> Thanks in advance,
> Do.
> --
> Message posted via http://www.sqlmonster.com

You will find that this is a programed function of the software itself,
not SQL Server.

See if there is a configuration setting you can use to adjust it.

You could also download a copy of the database monitor I have developed
which will tell you what load the software application is having on the
server. This will help determine if it is safe to up the number of
connections or not. It will also tell you if they are locking
themselves out.

You can download it from http://dbmonitor.tripod.com.

Friday, March 23, 2012

incorrect syntax after server up for a few days

Dear All,

My VB.Net application connects to MSSQL. It is always running fine for a few days, but encounters "incorrect syntax" as following unless the server is restarted.

--
Exception occurred System.Runtime.InteropServices.COMException (0x80040E14): Line 1: incorrect syntax near 'CDO'.
at ADODB.ConnectionClass.Execute (String CommandText, Object& RecordsAffected, Int32 Options)
--

There are a few applications in the server. If certain service is stopped, my program continues to run. So I am sure that the MSSQL connections have been taken up, which causes the error. How to prove it? And is there any way to reserve some DB connections to a particular application only?

Thanks for any hint!

I attach my codes below. Anything wrong with the way that I handled the ADODB?

------------------
Public Sub SendAllEmails()
Try
Dim cn As ADODB.Connection = openConn()
Dim rs As ADODB._Recordset
Dim rs2 As ADODB._Recordset
sqlstmt = "select * FROM EMAILTABLE"
rs = cn.Execute(sqlstmt)

While Not rs.EOF

Dim MAIL_ADD_USED As String = rs.Fields("MAIL_ADD_USED").Value.ToString

sqlstmt = "select * from NAMETABLE where EMAIL = '" & MAIL_ADD & "'"
rs2 = cn.Execute(sqlstmt)

If Not rs2.EOF And ErrMsg = "" Then

ErrMsg = SendMail(MAIL_ADD, REPORT_TITLE)

If Not ErrMsg Is Nothing And ErrMsg.Equals("Success") Then
MAIL_DATE_SENT = Now.ToString
MAIL_STATUS = "S"

'wait to make sure the email is sent
System.Threading.Thread.Sleep(1000 * 30)
Else
MAIL_STATUS = "F"
End If

End If

rs2.Close()

sqlstmt = "update EMAILTABLE set " & _
" MAIL_STATUS = " & MAIL_STATUS & "," & _
" MAIL_ERRMSG = null" & _
" where EMAIL = " & MAIL_ADD

cn.Execute(sqlstmt)

rs.MoveNext()

End While

rs.Close()
cn.Close()

Catch e As Exception
EventLog1.WriteEntry("Exception: " & e.ToString)
End Try

End Sub
----------------------Dear All,

My VB.Net application connects to MSSQL. It is always running fine for a few days, but encounters "incorrect syntax" as following unless the server is restarted.

--

Are you using VB.Net? Then how come Recordset come into existence...:S
See the BOL to use VB.net (ADO.Net)|||Well I took over the codes from the programmer. vb.net is quite new to me. thanks for the hint but is there any sample about how to make use of ado.net?

Actually I am more keen to know whether the MSSQL connection can be released and allocated by DBA. There are othere applications that I simply have no control.

Thanks.|||Well I took over the codes from the programmer. vb.net is quite new to me. thanks for the hint but is there any sample about how to make use of ado.net?

Actually I am more keen to know whether the MSSQL connection can be released and allocated by DBA. There are othere applications that I simply have no control.

Thanks.

Check these...
sending mail (http://www.c-sharpcorner.com/UploadFile/sushmita_kumari/SendingMail101062006054220AM/SendingMail1.aspx?ArticleID=91ece6d8-eaaf-41ab-ac6f-533dc215eacf)

Ado.net stored proc use (http://aspalliance.com/673_CodeSnip_Calling_a_Stored_Procedure_from_ASPNE T_20)

All about Ado.net (http://aspalliance.com/articles/LearnADONET.aspx)

And you can always use Profiler to check the status of your server.And to kill process check this
Kill Process (http://msdn2.microsoft.com/en-us/library/ms173730.aspx)