Showing posts with label regular. Show all posts
Showing posts with label regular. Show all posts

Sunday, March 11, 2012

Defrag SQL Server

All
Should the drives where the SQL Server data and log files be defragmenetd on
a regular basis?
ThanksNot unless you overuse autogrow and shrink. OF the database files weren't fragmented when you
created then and if you only had a reasonable amount of grow operation per database file you
wouldn't have fragmented database files. Some info here as well:
http://www.karaszi.com/SQLServer/info_dont_shrink.asp
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"David" <David@.discussions.microsoft.com> wrote in message
news:B33CE701-AA9C-4AAC-ADBC-6E7AEEEB5645@.microsoft.com...
> All
> Should the drives where the SQL Server data and log files be defragmenetd on
> a regular basis?
> Thanks|||Hi David
To add to Tibor's comments. To defragment the disc you would need to stop
SQL Server if you are using the defragmenter supplied with windows, on many
production systems this is not an option. Products such as Diskkeeper can do
this while the server is running.
For a server dedicated to SQL Server you should not need to do this if the
initial file sizes are sufficient and you don't continually shrink the files.
Make sure that you have regular log backups to enable the log file to be
re-used and keep the log file size more constant.
If you are running SQL Server on (say) a development machine or
demonstration system, defragmenting can be very beneficial, I have seen
performance improvements of around 30% just by defragmenting the disc on such
systems.
John
"David" wrote:
> All
> Should the drives where the SQL Server data and log files be defragmenetd on
> a regular basis?
> Thanks

Defrag SQL Server

All
Should the drives where the SQL Server data and log files be defragmenetd on
a regular basis?
ThanksNot unless you overuse autogrow and shrink. OF the database files weren't fr
agmented when you
created then and if you only had a reasonable amount of grow operation per d
atabase file you
wouldn't have fragmented database files. Some info here as well:
http://www.karaszi.com/SQLServer/info_dont_shrink.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"David" <David@.discussions.microsoft.com> wrote in message
news:B33CE701-AA9C-4AAC-ADBC-6E7AEEEB5645@.microsoft.com...
> All
> Should the drives where the SQL Server data and log files be defragmenetd
on
> a regular basis?
> Thanks|||Hi David
To add to Tibor's comments. To defragment the disc you would need to stop
SQL Server if you are using the defragmenter supplied with windows, on many
production systems this is not an option. Products such as Diskkeeper can do
this while the server is running.
For a server dedicated to SQL Server you should not need to do this if the
initial file sizes are sufficient and you don't continually shrink the files
.
Make sure that you have regular log backups to enable the log file to be
re-used and keep the log file size more constant.
If you are running SQL Server on (say) a development machine or
demonstration system, defragmenting can be very beneficial, I have seen
performance improvements of around 30% just by defragmenting the disc on suc
h
systems.
John
"David" wrote:

> All
> Should the drives where the SQL Server data and log files be defragmenetd
on
> a regular basis?
> Thanks

Friday, February 24, 2012

default values

I need to set the default value of a field in my table to 'Regular' if nothing is inserted to that field. Is it not as easy as putting ('Regular') in Default Value?

In the design properties for that row there should be a field to the effect of Default Value. Enter Regular there.

HTH,
Ryan

|||

I did that. Maybe something else is happening here tell me what you think. I have a dropdoen that is either enabled or not based on if you can select Regular or Decaf. I use a stored procedure for this and this: cmdAddItemToCartItems.Parameters.Add("@.regDec", ddlReg.SelectedValue)
If it's not enabled is the stored procedure inserting nothing and overriding the default value? I tried this in my code (with and without the default value set) too:
If Me.ddlReg.Enabled = False Then
cmdAddItemToCartItems.Parameters.Add("@.regDec", "Regular").ToString()
Else
cmdAddItemToCartItems.Parameters.Add("@.regDec", ddlReg.SelectedValue)
End If
It seemed like it worked and then didn't work... maybe I'm just crazy, I don't know. Any suggestions?

|||

I would do it this way. Don't provide the DropDownList if they can't select from it. Instead, use a Label control and display that it is Regular. Then, use that to determine what you are going to insert into the database for that row.

i.e.

If lblReadOnly.Visible Then
cmdAddItemToCartItems.Parameters.Add("@.regDec", lblReadOnly.Text)
Else
cmdAddItemToCartItems.Parameters.Add("@.regDec", ddlReg.SelectedItem.Value)
End If

HTH,
Ryan

|||Beautiful! Thank You!