Showing posts with label updates. Show all posts
Showing posts with label updates. Show all posts

Tuesday, March 27, 2012

automatically update another field based on other parts of the record

Sql is not a strong point with me so I'm just going to throw this out there. I have a stored procedure that updates the quantity in my 'CartItems' table. Is there a way to have something else happen within the stored procedure that will update another field based on other parts of the record? There is a 'lineTotal' field that I need to equal the 'pounds * itemSell' fields which are both fields within this record.

CREATE PROCEDURE UpdateCartItem
(
@.cartItemID Int,
@.newQuantity numeric(9)
)
AS
UPDATE CartItems Set quantity = @.newQuantity
WHERE cartItemID = @.cartItemID
GO

sure. you can update as many fields as you want within the UPDATE statement.

CREATE PROCEDURE UpdateCartItem
(
@.cartItemID Int,
@.newQuantity numeric(9)
)
AS

SET NOCOUNT ON

UPDATE
CartItems
Set
quantity = @.newQuantity
,lineTotal =pounds * itemSell
WHERE
cartItemID = @.cartItemID

SET NOCOUNT OFF

GO

|||Or make the lineTotal a computed column. Just modify the table and tell it the lineTotal column is equal to pounds*itemSell.sql

Thursday, March 22, 2012

Automatical table update within a database

Hello!

We are developping a project using MS-SQLServer 7 and we need a
process for the synchronization of 3 tables together.
Inserts and updates in the table A should immediately and
automatically occur on table C, and updates on table C should also
automatically occur on table B.
We think that the solution using triggers and stored procedures is the
right choice. Could someone with knowledge on stored procedures help
us?
We need the help soon, this is quite urgent, so we’d be happy to
get an answer!
If something is not clear just ask!

Thanks in advance!
E. KellerLook at CREATE TRIGGER topic in the BOL

"E.Keller" <emmanuel.keller@.net2000.ch> wrote in message
news:4eed4cad.0401070114.65961769@.posting.google.c om...
> Hello!
> We are developping a project using MS-SQLServer 7 and we need a
> process for the synchronization of 3 tables together.
> Inserts and updates in the table A should immediately and
> automatically occur on table C, and updates on table C should also
> automatically occur on table B.
> We think that the solution using triggers and stored procedures is the
> right choice. Could someone with knowledge on stored procedures help
> us?
> We need the help soon, this is quite urgent, so we’d be happy to
> get an answer!
> If something is not clear just ask!
> Thanks in advance!
> E. Keller|||Use triggers if you cannot guarantee that the process that modifies table A
will also do the other two. If you do it all with stored procedures (my
preferred method) you can write the modification code for all three tables
inside the procs. make sure you wrap the 3 statements in a transaction so
they all complete or all roll back. Triggers automatically do the
transaction for you, but this is not always a good thing.

"E.Keller" <emmanuel.keller@.net2000.ch> wrote in message
news:4eed4cad.0401070114.65961769@.posting.google.c om...
> Hello!
> We are developping a project using MS-SQLServer 7 and we need a
> process for the synchronization of 3 tables together.
> Inserts and updates in the table A should immediately and
> automatically occur on table C, and updates on table C should also
> automatically occur on table B.
> We think that the solution using triggers and stored procedures is the
> right choice. Could someone with knowledge on stored procedures help
> us?
> We need the help soon, this is quite urgent, so we’d be happy to
> get an answer!
> If something is not clear just ask!
> Thanks in advance!
> E. Keller

automatic updates

I have two sql 2000 server tables one is active and one is terminated (I inherited this db) and I was thinking of having the active table automatically update the terminated table when an employee is terminated. Access is at the front end and in the form of the active table theres a drop down text box that has the employement status(active, terminated, on leave...etc) so when the status turns into terminated i want the acitve table to send those records to the terminated table, ( the data in both tables are not exactly the same). looking into a trigger or stored procedure. This is the first time I've done this so I'm doing some reasearch on how to handle it. Any suggestionsAny suggestions

Yeah,

use a trigger or a stored procedure|||Ok good thank you Brett (reassurance I'm going about it the right way) was thinking a Trigger would be good to update the termination table as soon as the status in the active table is changed to "TERMINATED" it will automatically send the data to that table. Can I show you my code to make sure I'm doing this correctly??

Thanks guys|||Can I show you my code to make sure I'm doing this correctly??Is that anything like "I'll show you mine if..."

NEVERMIND!!!

-PatP|||You know a dirty mind is a terrible thing to waste|||You know a dirty mind is a terrible thing to wasteI'd always heard that a waist was a terrible thing to mind.

-PatP|||You know a dirty mind is a terrible thing to waste

Boy I can see where this is hedading

So Yes you can show me yours...can you send attachments in emails?|||And you should check out our little party we got going on

http://www.dbforums.com/showthread.php?p=3693529#post3693529

The more the merrier...|||I'd always heard that a waist was a terrible thing to mind.

-PatP

Luckily it's just a head shot

http://searchdatabase.techtarget.com/ateExpertBio/0,289623,sid13_cid379843,00.html|||Somebody should submit that to http://www.amihotornot.com/|||You should really quit your day job and do stand up...|||Somebody should submit that to http://www.amihotornot.com/Bleah! It was something like 03:00, about the third day of Tech-Ed. They wanted a picture of me in one of their logo'ed shirts. I never should have agreed!

-PatP|||I used to work with an IT guy who had done stand-up comedy. He was very funny, very similiar to Stephen Colbert on Comedy Central's Daily Show. The problem was that every time you asked him for assistance you had to sit through a minute or two of hillarious but biting sarcasm before he'd solve your problem.|||What did he solve? Excel?

And where did my desiree go?|||I used to work with an IT guy who had done stand-up comedy. He was very funny, very similiar to Stephen Colbert on Comedy Central's Daily Show. The problem was that every time you asked him for assistance you had to sit through a minute or two of hillarious but biting sarcasm before he'd solve your problem.I don't remember that!

-PatP|||I'm still here guys just working on my update trigger, trying to get it to work properly. :)|||Just post it so we can see it...

make sure to add [ code] [ /code] tags...just take out he space|||ok I got two tables one is the EmployeeGL.Table and the other is the Terminations.Table, now both tables have a drop down combo box that has Active or Terminated (termination table has different values in combo box but Terminated is one of them) in it this represents their status. What I want is as soon as the combo box is changed to "Terminated", I want the Termination.Table to updated with that employees information and deleted out of the EmployeeGL.Table. Bare with me cause I'm still new to sql, so I'm still learning how to create stored procedures and triggers.Or perhaps an Append instead of an UPdate Trigger. Sorry still researching and Analyzing. I'll get back with you, gonna research Append (adding to another table rather then updating)|||Perhaps if I append instead of update

INSERT INTO EmployeeGL_Table ( [TM #], FirstName, LastName, [SS #], [Voluntary or Involuntary], TerminationDate )
SELECT TERMINATION.[TM #], TERMINATION.FirstName, TERMINATION.LastName, TERMINATION.SocialSecurityNumber, TERMINATION.VoluntaryorInvoluntary, TERMINATION.TerminationDate
FROM TERMINATION
WHERE (((TERMINATION.Status)="TERMINATED") AND ((TERMINATION.TerminationDate) Between #1/5/2003# And #12/31/2003#));
Perhaps as a stored stored procedure

automatic updates

well as I get further into this project of automatic updates I'm fining more and more barriers. The combo list box which indicates whether the employee is terminated or active might be a problem with sql since you cant create a Row source and a Row source type in a sql table. that combo box exsist in the properties of the form. The Row Source Type is a Value List. Shoot :(I guess I don't understand why this is a deal-breaker. You can:

A) Change your combo-box row source type to a query.

B) Use VB Code to set the Row Source to the results of a query.

C) If you know there are limited possible values for the field (Active, Terminated) then leave it hard-coded in the interface and just perform error checking before you insert data into the database.|||Ok blindman I'm sorry but I dont know VB code so for me that is a deal breaker. Please explain error checking, I will read about it I have booksonline to refer to.|||Are your dealing with an Access interface? Adding VB code to an Access module is very easy.

By error checking, I just mean that the database should verify that the submitted data is an acceptable value, and should return an error message if it is not.|||I tried that but thats not an option, but I figured it out I'm good thanks

Automatic Updates

OK, I get a message from Automatic Updates that SQL 2005 SP 2 needs to be
installed. I tell it to go ahead and install. It says it installed
successfully.
Ten minutes later I get a message from Automatic Updates that SQL 2005 SP 2
needs to be installed. I tell it to go ahead and install. It says it
installed successfully.
Ten minutes later I get a message from Automatic Updates that SQL 2005 SP 2
needs to be installed. I tell it to go ahead and install. It says it
installed successfully.
I reboot just for the heck of it.
After I reboot I get a message from Automatic Updates that SQL 2005 SP 2
needs to be installed. I tell it to go ahead and install. It says it
installed successfully.
This has been going on for two weeks now. Any ideas?
Hi Mike
"Mike C#" wrote:

> OK, I get a message from Automatic Updates that SQL 2005 SP 2 needs to be
> installed. I tell it to go ahead and install. It says it installed
> successfully.
> Ten minutes later I get a message from Automatic Updates that SQL 2005 SP 2
> needs to be installed. I tell it to go ahead and install. It says it
> installed successfully.
> Ten minutes later I get a message from Automatic Updates that SQL 2005 SP 2
> needs to be installed. I tell it to go ahead and install. It says it
> installed successfully.
> I reboot just for the heck of it.
> After I reboot I get a message from Automatic Updates that SQL 2005 SP 2
> needs to be installed. I tell it to go ahead and install. It says it
> installed successfully.
> This has been going on for two weeks now. Any ideas?
>
What version is your SQL Server at? Do you have any other instances?
http://blogs.msdn.com/psssql/archive/2007/04/06/post-sql-server-2005-service-pack-2-sp2-fixes-explained.aspx
explains the different versions and actions that should be taken including
not allowing Microsoft Update to apply SP2 if you have a hotfix that didn't
make SP2.
You could try applying http://support.microsoft.com/Default.aspx?Kbid=934459
John
|||"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:7A1CB953-70DF-4746-BCC5-11EF82180579@.microsoft.com...
> Hi Mike
> "Mike C#" wrote:
> What version is your SQL Server at? Do you have any other instances?
> http://blogs.msdn.com/psssql/archive/2007/04/06/post-sql-server-2005-service-pack-2-sp2-fixes-explained.aspx
> explains the different versions and actions that should be taken including
> not allowing Microsoft Update to apply SP2 if you have a hotfix that
> didn't
> make SP2.
> You could try applying
> http://support.microsoft.com/Default.aspx?Kbid=934459
> John
Hi John,
9.00.3054. I'll check out the post, and let you know if it helps. Thanks!
Mike
|||Hi
"Mike C#" wrote:

> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:7A1CB953-70DF-4746-BCC5-11EF82180579@.microsoft.com...
> Hi John,
> 9.00.3054. I'll check out the post, and let you know if it helps. Thanks!
> Mike
>
If it doesn't work, you can tell windows update not to remind you of a patch
again, when you go through the custom installation, selecting the download
and checking the "Don't remind me again" checkbox.
Johm
|||"John Bell" <JohnBell@.discussions.microsoft.com> wrote in message
news:D6CFE0F8-8E64-4CD3-8004-7274A391A9C6@.microsoft.com...
> If it doesn't work, you can tell windows update not to remind you of a
> patch
> again, when you go through the custom installation, selecting the download
> and checking the "Don't remind me again" checkbox.
> Johm
I considered that, but decided against for now since I want to see if the
manual install actually works. I performed the manual install, and it
appears to have worked, but I want to give it a few more days to be sure.
Thanks
Mike

Automatic Updates

OK, I get a message from Automatic Updates that SQL 2005 SP 2 needs to be
installed. I tell it to go ahead and install. It says it installed
successfully.
Ten minutes later I get a message from Automatic Updates that SQL 2005 SP 2
needs to be installed. I tell it to go ahead and install. It says it
installed successfully.
Ten minutes later I get a message from Automatic Updates that SQL 2005 SP 2
needs to be installed. I tell it to go ahead and install. It says it
installed successfully.
I reboot just for the heck of it.
After I reboot I get a message from Automatic Updates that SQL 2005 SP 2
needs to be installed. I tell it to go ahead and install. It says it
installed successfully.
This has been going on for two weeks now. Any ideas?Hi Mike
"Mike C#" wrote:
> OK, I get a message from Automatic Updates that SQL 2005 SP 2 needs to be
> installed. I tell it to go ahead and install. It says it installed
> successfully.
> Ten minutes later I get a message from Automatic Updates that SQL 2005 SP 2
> needs to be installed. I tell it to go ahead and install. It says it
> installed successfully.
> Ten minutes later I get a message from Automatic Updates that SQL 2005 SP 2
> needs to be installed. I tell it to go ahead and install. It says it
> installed successfully.
> I reboot just for the heck of it.
> After I reboot I get a message from Automatic Updates that SQL 2005 SP 2
> needs to be installed. I tell it to go ahead and install. It says it
> installed successfully.
> This has been going on for two weeks now. Any ideas?
>
What version is your SQL Server at? Do you have any other instances?
http://blogs.msdn.com/psssql/archive/2007/04/06/post-sql-server-2005-service-pack-2-sp2-fixes-explained.aspx
explains the different versions and actions that should be taken including
not allowing Microsoft Update to apply SP2 if you have a hotfix that didn't
make SP2.
You could try applying http://support.microsoft.com/Default.aspx?Kbid=934459
John|||"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:7A1CB953-70DF-4746-BCC5-11EF82180579@.microsoft.com...
> Hi Mike
> "Mike C#" wrote:
>> OK, I get a message from Automatic Updates that SQL 2005 SP 2 needs to be
>> installed. I tell it to go ahead and install. It says it installed
>> successfully.
>> ...
> What version is your SQL Server at? Do you have any other instances?
> http://blogs.msdn.com/psssql/archive/2007/04/06/post-sql-server-2005-service-pack-2-sp2-fixes-explained.aspx
> explains the different versions and actions that should be taken including
> not allowing Microsoft Update to apply SP2 if you have a hotfix that
> didn't
> make SP2.
> You could try applying
> http://support.microsoft.com/Default.aspx?Kbid=934459
> John
Hi John,
9.00.3054. I'll check out the post, and let you know if it helps. Thanks!
Mike|||Hi
"Mike C#" wrote:
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:7A1CB953-70DF-4746-BCC5-11EF82180579@.microsoft.com...
> > Hi Mike
> >
> > "Mike C#" wrote:
> >
> >> OK, I get a message from Automatic Updates that SQL 2005 SP 2 needs to be
> >> installed. I tell it to go ahead and install. It says it installed
> >> successfully.
> >> ...
> > What version is your SQL Server at? Do you have any other instances?
> >
> > http://blogs.msdn.com/psssql/archive/2007/04/06/post-sql-server-2005-service-pack-2-sp2-fixes-explained.aspx
> > explains the different versions and actions that should be taken including
> > not allowing Microsoft Update to apply SP2 if you have a hotfix that
> > didn't
> > make SP2.
> >
> > You could try applying
> > http://support.microsoft.com/Default.aspx?Kbid=934459
> >
> > John
> Hi John,
> 9.00.3054. I'll check out the post, and let you know if it helps. Thanks!
> Mike
>
If it doesn't work, you can tell windows update not to remind you of a patch
again, when you go through the custom installation, selecting the download
and checking the "Don't remind me again" checkbox.
Johm|||"John Bell" <JohnBell@.discussions.microsoft.com> wrote in message
news:D6CFE0F8-8E64-4CD3-8004-7274A391A9C6@.microsoft.com...
> If it doesn't work, you can tell windows update not to remind you of a
> patch
> again, when you go through the custom installation, selecting the download
> and checking the "Don't remind me again" checkbox.
> Johm
I considered that, but decided against for now since I want to see if the
manual install actually works. I performed the manual install, and it
appears to have worked, but I want to give it a few more days to be sure.
Thanks
Mike

Tuesday, March 20, 2012

Automatic Updates

OK, I get a message from Automatic Updates that SQL 2005 SP 2 needs to be
installed. I tell it to go ahead and install. It says it installed
successfully.
Ten minutes later I get a message from Automatic Updates that SQL 2005 SP 2
needs to be installed. I tell it to go ahead and install. It says it
installed successfully.
Ten minutes later I get a message from Automatic Updates that SQL 2005 SP 2
needs to be installed. I tell it to go ahead and install. It says it
installed successfully.
I reboot just for the heck of it.
After I reboot I get a message from Automatic Updates that SQL 2005 SP 2
needs to be installed. I tell it to go ahead and install. It says it
installed successfully.
This has been going on for two weeks now. Any ideas?Hi Mike
"Mike C#" wrote:

> OK, I get a message from Automatic Updates that SQL 2005 SP 2 needs to be
> installed. I tell it to go ahead and install. It says it installed
> successfully.
> Ten minutes later I get a message from Automatic Updates that SQL 2005 SP
2
> needs to be installed. I tell it to go ahead and install. It says it
> installed successfully.
> Ten minutes later I get a message from Automatic Updates that SQL 2005 SP
2
> needs to be installed. I tell it to go ahead and install. It says it
> installed successfully.
> I reboot just for the heck of it.
> After I reboot I get a message from Automatic Updates that SQL 2005 SP 2
> needs to be installed. I tell it to go ahead and install. It says it
> installed successfully.
> This has been going on for two weeks now. Any ideas?
>
What version is your SQL Server at? Do you have any other instances?
http://blogs.msdn.com/psssql/archiv...-explained.aspx
explains the different versions and actions that should be taken including
not allowing Microsoft Update to apply SP2 if you have a hotfix that didn't
make SP2.
You could try applying http://support.microsoft.com/Default.aspx?Kbid=934459
John|||"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:7A1CB953-70DF-4746-BCC5-11EF82180579@.microsoft.com...
> Hi Mike
> "Mike C#" wrote:
>
> What version is your SQL Server at? Do you have any other instances?
> http://blogs.msdn.com/psssql/archiv...-explained.aspx
> explains the different versions and actions that should be taken including
> not allowing Microsoft Update to apply SP2 if you have a hotfix that
> didn't
> make SP2.
> You could try applying
> http://support.microsoft.com/Default.aspx?Kbid=934459
> John
Hi John,
9.00.3054. I'll check out the post, and let you know if it helps. Thanks!
Mike|||Hi
"Mike C#" wrote:

> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:7A1CB953-70DF-4746-BCC5-11EF82180579@.microsoft.com...
> Hi John,
> 9.00.3054. I'll check out the post, and let you know if it helps. Thanks
!
> Mike
>
If it doesn't work, you can tell windows update not to remind you of a patch
again, when you go through the custom installation, selecting the download
and checking the "Don't remind me again" checkbox.
Johm|||"John Bell" <JohnBell@.discussions.microsoft.com> wrote in message
news:D6CFE0F8-8E64-4CD3-8004-7274A391A9C6@.microsoft.com...
> If it doesn't work, you can tell windows update not to remind you of a
> patch
> again, when you go through the custom installation, selecting the download
> and checking the "Don't remind me again" checkbox.
> Johm
I considered that, but decided against for now since I want to see if the
manual install actually works. I performed the manual install, and it
appears to have worked, but I want to give it a few more days to be sure.
Thanks
Mikesql

Automatic update fails

I'm getting automatic updates to install for SQL Server 2005. I am
technically fairly savvy, but I didn't even know I HAD SQL installed!
The problem is that the automatic update won't install, and it gives me no
reason why... but after it fails it continues to show up as an update waiting
to be installed. (I have set my auto updates to let me decide when to
install.)
"SQL Server 2005 Express Edition Service Pack 2 (KB921896) failed to install."
That's all I get. How do I determine WHY it won't install, and then fix it?
AuthorCancerForTwo (AuthorCancerForTwo@.discussions.microsoft.com) writes:
> I'm getting automatic updates to install for SQL Server 2005. I am
> technically fairly savvy, but I didn't even know I HAD SQL installed!
> The problem is that the automatic update won't install, and it gives me
> no reason why... but after it fails it continues to show up as an update
> waiting to be installed. (I have set my auto updates to let me decide
> when to install.)
> "SQL Server 2005 Express Edition Service Pack 2 (KB921896) failed to
> install."
> That's all I get. How do I determine WHY it won't install, and then fix
> it?
The only suggestion I can give is to download the service pack, and run
the install manually to see what it barfs about.
Hm, well there might be logs in
C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\LOG\Hotfix or
corresponding. But since you did not even know that you had SQL Express
installed, that directory may be elsewhere.
You could also check in Services that you actually have an SQL Server
service.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
|||Thank you, Erland... I went to the place you identified and there were some
logs there - I looked at the most recent log and, sure enough, there was the
reason that it failed... Windows Authorization failed. I can't imagine
why... I never used pirated or unauthorized software. But it did give me the
name of the product that uses SQL and, therefore, probably installed it
unbeknownst to me, so I will try to re-install that software.
I must say that I have had a lot of trouble with that product, and I'm going
to dump it as soon as possible... this situation is just another good reason
to do so.
Thank you for your help!
"Erland Sommarskog" wrote:

> AuthorCancerForTwo (AuthorCancerForTwo@.discussions.microsoft.com) writes:
> The only suggestion I can give is to download the service pack, and run
> the install manually to see what it barfs about.
> Hm, well there might be logs in
> C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\LOG\Hotfix or
> corresponding. But since you did not even know that you had SQL Express
> installed, that directory may be elsewhere.
> You could also check in Services that you actually have an SQL Server
> service.
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
>

Automatic statistics on compound index

I just read a note in a book that says that SQL Server 2000 only
automatically updates the statistics on just the first column of a compound
index (provided automatic statistics feature is turned on). It suggests
that the DBA should create statistics on the other columns.
I'd never heard that before, and can't seem to find that little fasinating
tidbit in any other source.
Can anybody confirm that this is true?"Emmet Gray" <egray1@.hot.rr.com> wrote in message
news:uc9EhPDXDHA.2464@.TK2MSFTNGP09.phx.gbl...
> I just read a note in a book that says that SQL Server 2000 only
> automatically updates the statistics on just the first column of a
compound
> index (provided automatic statistics feature is turned on). It suggests
> that the DBA should create statistics on the other columns.
> I'd never heard that before, and can't seem to find that little fasinating
> tidbit in any other source.
> Can anybody confirm that this is true?
>
That's correct - this is a situation where you may want to consider manually
statistics on columns other than the first column of a composite index.
Steve

Sunday, February 19, 2012

Auto Updates for SQL Server?

Our IT guy insists that he must be present anytime the SQL Server automatic updates from Microsoft are installed on the server or the server will crash. What has he been tinkering with to cause this to happen or is he just giving us a line?

Well, I wouldn′t apply all patches to SQL Server without any notice ot testing. Normally the updates or patches don′t break the functionality of SQL Server. To be sure, I would test the patch on a testing server. If you have a WUS, you can setup the server to confirm the patch first before applying the patch on the SQL Server.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de
|||I guess I needed to be a little more specific. He is referring to the auto updates which come from Microsoft (just like on a personal PC). He evidently has the server set up so that the updates sit there until he decides to install them (like the option on a personal PC) which isn't really the problem but then he has turned around and is saying that when he does install the updates (rather than anyone with knowledge to do so) he absolutely has to be there or the server will crash. What could he have possibly done which would make the server crash if he doesn't personally oversee the update process?|||

hi,

this sounds kind "confusing"...

does he perform particular steps in order to avoid "system crashes"?

regards

|||I don't have any idea. We're assuming he's just feeding us a line but he has an unusual family history (which has us particularly concerned at the moment). Believe me this is not a joke. We are not a Dept. of Defense facility or anything like that but we are just a small business where the owner hired him because of his computer knowledge (but does know his background). Now the owner is concerned this is coming back to bite him if we can't figure out why he needs to be there when any updates are installed. We are very worried that he has planted some type of code to bring the business to its knees. Other than a disaster recovery plan which I am already looking into, what other ideas would anyone suggest. I don't want to get anymore specific than what I have since I don't know whether he reads these forums or not.|||

I'm not sure this is a productive discussion for this forum. No one here could (or should) offer any suggestiona as to what your IT guy might or might not do to a computer to make it crash. If you have significant concerns about one of your employees, you need to take it up with your boss. If you feel it is a real possibility that your IT guy might do something maliceous to your server, you should have a qualified computer technician take a look at it.

Regards,

Mike Wachal
SQL Express team

FWIW: There are no patches for SQL Express available through Microsoft Update at this point, you have to download and apply them manually.

Thursday, February 16, 2012

Auto update statistics

We have 'auto update statistics' turned on for all our databases.
We also have a job that updates statistics with full scan every morning of
every day.
I am seeing some high cpu on one of our servers and in running Profiler I see
a number of "SELECT StatMan([SCO])..." statements.
From what I understand this could be due to procedures recompiling due to a
temp table, or auto update statistics.
If by the chance it is due to having 'auto update statistics' turned on, and
I am updating statistics daily, can I do away with one or the other? Is doing
both rather over kill?
--
Message posted via http://www.sqlmonster.comIt is 'probably' ok to turn off autoupdate in this case. One situation
where it isn't is tables that are heavily modified - you could have queries
developing bad query plans after sufficient modifications altered the value
distributions. If this is the case you could simply enable specific tables
using the sp_autostats sproc.
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
"cbrichards via SQLMonster.com" <u3288@.uwe> wrote in message
news:798b0fc1296d4@.uwe...
> We have 'auto update statistics' turned on for all our databases.
> We also have a job that updates statistics with full scan every morning of
> every day.
> I am seeing some high cpu on one of our servers and in running Profiler I
> see
> a number of "SELECT StatMan([SCO])..." statements.
> From what I understand this could be due to procedures recompiling due to
> a
> temp table, or auto update statistics.
> If by the chance it is due to having 'auto update statistics' turned on,
> and
> I am updating statistics daily, can I do away with one or the other? Is
> doing
> both rather over kill?
> --
> Message posted via http://www.sqlmonster.com
>|||Hi there,
There's a new database SET option, AUTO_UPDATE_STATISTICS_ASYNC, that you
can enable to improve the predictability of query response times. When you
enable this option, out-of-date statistics are put on a queue for updating by
a background worker thread, and the query that initiated the statistics
update compiles immediately rather than waiting for the statistics to be
updated.
Thank you,
Saleem Hakani
HTTP://WWW.SQLCOMMUNITY.COM (World Wide Microsoft SQL Server Community)
SQLTips, SQL Forums, SQL Blogs, SQL RADIO, SQL Events, SQL Scripts, SQL
Articles, SQL Clinic and a lot of SQL fun.
Register (Free):
http://www.sqlcommunity.com/RegistrationLoginPage/tabid/68/Default.aspx?returnurl=%2fHome%2ftabid%2f36%2fDefault.aspx
"TheSQLGuru" wrote:
> It is 'probably' ok to turn off autoupdate in this case. One situation
> where it isn't is tables that are heavily modified - you could have queries
> developing bad query plans after sufficient modifications altered the value
> distributions. If this is the case you could simply enable specific tables
> using the sp_autostats sproc.
>
> --
> Kevin G. Boles
> TheSQLGuru
> Indicium Resources, Inc.
> "cbrichards via SQLMonster.com" <u3288@.uwe> wrote in message
> news:798b0fc1296d4@.uwe...
> > We have 'auto update statistics' turned on for all our databases.
> >
> > We also have a job that updates statistics with full scan every morning of
> > every day.
> >
> > I am seeing some high cpu on one of our servers and in running Profiler I
> > see
> > a number of "SELECT StatMan([SCO])..." statements.
> >
> > From what I understand this could be due to procedures recompiling due to
> > a
> > temp table, or auto update statistics.
> >
> > If by the chance it is due to having 'auto update statistics' turned on,
> > and
> > I am updating statistics daily, can I do away with one or the other? Is
> > doing
> > both rather over kill?
> >
> > --
> > Message posted via http://www.sqlmonster.com
> >
>
>|||The auto update kicks in when a certain thresshold of changes has
occurred since the last time the statistics were determined. So if you
update statistics every morning, then the auto update statistics will
not activate unless it thinks it is necessary. This could be on heavily
used tables, or temp tables.
IOW, I would keep it turned on. It also prevents problems if you missed
a table in your daily job, or if (for some reason) the job hasn't run
(completely).
--
Gert-Jan
"cbrichards via SQLMonster.com" wrote:
> We have 'auto update statistics' turned on for all our databases.
> We also have a job that updates statistics with full scan every morning of
> every day.
> I am seeing some high cpu on one of our servers and in running Profiler I see
> a number of "SELECT StatMan([SCO])..." statements.
> From what I understand this could be due to procedures recompiling due to a
> temp table, or auto update statistics.
> If by the chance it is due to having 'auto update statistics' turned on, and
> I am updating statistics daily, can I do away with one or the other? Is doing
> both rather over kill?
> --
> Message posted via http://www.sqlmonster.com