Showing posts with label period. Show all posts
Showing posts with label period. Show all posts

Monday, March 26, 2012

How can I change the CommandTimeout value?

When I try to execute a query and after 30 seconds the program sends me error :

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

Exception Detail: System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

Source error:

Line 550 Dim myDataSet as Dataset = New DataSet

Line 551 myDataSet = db.ExecuteDataSet(System.Data.CommanType.Text,NewSql) <== Error line

Line 552 i=myDataSet.Tables(0).Rows.Count

In my connection string I set the parameter "Connection Timeout" = 360 but it not works. ( In debug mode the value for db.GetConnection.ConnectionTimeout is the same(360) like the parameter timeout connection.

After many searchs I found the default value for CommandTimeout is 30 secs. Can I change this value ?

Any suggestion will be welcome.

I'm using FrameWork 1.1.

create a SqlCommand object and set the CommandTimeout on that.

Hope it helps

|||

Klaus,

Do you have an example or reference in order to get the code?

Thanks in advance,

Juan Carlos

|||

YesOk. I found the example and the solution for my case is :

Dim myDataSet as Dataset = New DataSet

Dim cmd as DbCommandWrapper = db.GetSqlStringCommandWrapper(NewSql)

cmd.CommandTimeout = 180 (seconds) ==> 0 (zero) in order to wait for ever.

myDataSet = db.ExecuteDataSet(cmdl)

i=myDataSet.Tables(0).Rows.Count

If you want to review more of thishttp://msdn.microsoft.com/msdnmag/issues/05/08/DataPoints/

Klaus, I appreciate a lot your help.

Thanks

sql

Monday, March 12, 2012

How Backup Affect Performance?

I would like to know whether the performance of a SQL server 2000 will be
slow down during a full database backup period?
I have a server with 1.5GB MDF file and 4GB .LDF file. I want to increase a
full backup during lunch time but I'm affraid of the backup will affect
application user.
ThanksBlack
Wow , you have to backup and the shink the log file immediatly
Regarding your question , it should not be any performance issues during the
backup.
"Black" <hoodworld@.hotmail.com> wrote in message
news:uckZOwPiFHA.3656@.TK2MSFTNGP09.phx.gbl...
> I would like to know whether the performance of a SQL server 2000 will be
> slow down during a full database backup period?
> I have a server with 1.5GB MDF file and 4GB .LDF file. I want to increase
a
> full backup during lunch time but I'm affraid of the backup will affect
> application user.
> Thanks
>
>|||Thanks for your reply, Uri.
It's out of my control to shink the log.
BTW, is there any reference site in Microsoft stating that. I have to
provide some evidence to my client.
Thanks again.
Black
"Uri Dimant" <urid@.iscar.co.il> ¼¶¼g©ó¶l¥ó·s»D
:OCOfzHQiFHA.320@.TK2MSFTNGP09.phx.gbl...
> Black
> Wow , you have to backup and the shink the log file immediatly
> Regarding your question , it should not be any performance issues during
the
> backup.
>
>|||It depends on your IO system. If the system is not good enough, you would see
slowness of transactions, decrease of performance. If your IO system good
enough, you would not notice any effects of backups.
"Black" wrote:
> I would like to know whether the performance of a SQL server 2000 will be
> slow down during a full database backup period?
> I have a server with 1.5GB MDF file and 4GB .LDF file. I want to increase a
> full backup during lunch time but I'm affraid of the backup will affect
> application user.
> Thanks
>
>|||Backups done on proper hardware should only affect the normal operation by
around 10% or so. But if you are backing up to the same drives that the
data itself is on you can impact it more depending on the hardware.
--
Andrew J. Kelly SQL MVP
"Black" <hoodworld@.hotmail.com> wrote in message
news:uckZOwPiFHA.3656@.TK2MSFTNGP09.phx.gbl...
> I would like to know whether the performance of a SQL server 2000 will be
> slow down during a full database backup period?
> I have a server with 1.5GB MDF file and 4GB .LDF file. I want to increase
> a
> full backup during lunch time but I'm affraid of the backup will affect
> application user.
> Thanks
>
>|||Black wrote:
> Thanks for your reply, Uri.
> It's out of my control to shink the log.
> BTW, is there any reference site in Microsoft stating that. I have to
> provide some evidence to my client.
>
Then you need to explain to your client that it appears the log is not
being backed up. If your client is only performing full database
backups, then maybe they should be using the simple recovery model.
Other than being able to sniff the log file with a log reader, I can't
think of any reason to keep a huge log file around.
--
David Gugick
Quest Software
www.imceda.com
www.quest.com