Showing posts with label file. Show all posts
Showing posts with label file. Show all posts

Friday, March 30, 2012

Konesans File Watcher Tasks

Hello All

Just curious if there are any tutorials/help files/forums on using this and other Konesans control Flow and data flow task? most import the flow watcher task.

thanks

Karen

No is the honest answer. We write the documentation pages on the SQLIS site for each component, but as free components we have not gone that far on documentation. Questions pop up here about them or you can contact us direct (http://www.konesans.com/contact.aspx), we are happy to help.

Known assembly FileIOPermission error, still no solution

I'm trying to write to a text file from my custom assembly and I keep
getting FileIOPermission. The only way I can get it to work is by
changing the PermissionSetName of the whole CodeGroup from Nothing to
FullTrust. The assembly itself is very simple and all it does is it
writes one line to a text file.
Here is what I did so far:
1. I asserted the permission in my code.
2. I put the text file and my assembly into ReportSevrer bin folder and
changed the text file's security to allow "NETWORK SECURITY" (it
is IIS6) and just in case "Everyone" to write to it.
3. I added CodeGroup just after the code group with Url="$CodeGen$/*"
to the rssrvpolicy.config file with PermissionSetName="FullTrust".
I even installed Visual Studio 2005 to get access to PermCalc tool.
All it showed me was that my dll needs FileIOPermission with
Unrestricted="true" and SecurityPermission with
Flags="Assertion" in the CodeGroup which I also tried by creating a
seperate PermissionSet.
What else can I possibly try?
My Code:
private void WriteLogFile(String msg)
{
FileIOPermission perm1 = new
FileIOPermission(FileIOPermissionAccess.Write, @."C:\Program
Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportServer\bin\ReportLogger.log");
perm1.Assert();
FileStream fs = new FileStream(@."C:\Program Files\Microsoft SQL
Server\MSSQL\Reporting Services\ReportServer\bin\ReportLogger.log",
FileMode.OpenOrCreate, FileAccess.ReadWrite);
StreamWriter w = new StreamWriter(fs);
w.BaseStream.Seek(0, SeekOrigin.End);
w.Write("{0} {1} ", DateTime.Now.ToLongTimeString(),
DateTime.Now.ToLongDateString());
w.Write(msg + "\r\n");
w.Flush();
w.Close();
}
My CodeGroup:
<CodeGroup class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="CGReportHelper"
Description="Allow execution of ReportHelper.dll">
<IMembershipCondition class="UrlMembershipCondition"
version="1"
Url="file://C:/Program Files/Microsoft SQL Server/MSSQL/Reporting
Services/ReportServer/bin/ReportHelper.dll"/>
</CodeGroup>
My Error:
w3wp!processing!2aa8!10/05/2005-16:47:17:: e ERROR: Failed to load
expression host assembly. Details: Request for the permission of type
System.Security.Permissions.FileIOPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
failed.
System.Security.SecurityException: Request for the permission of type
System.Security.Permissions.FileIOPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
failed.
at
System.Security.CodeAccessSecurityEngine.CheckHelper(PermissionSet
grantedSet, PermissionSet deniedSet, CodeAccessPermission demand,
PermissionToken permToken)
at System.Security.CodeAccessSecurityEngine.Check(PermissionToken
permToken, CodeAccessPermission demand, StackCrawlMark& stackMark,
Int32 checkFrames, Int32 unrestrictedOverride)
at
System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission
cap, StackCrawlMark& stackMark)
at System.Security.CodeAccessPermission.Demand()
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share, Int32 bufferSize, Boolean useAsync, String
msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access)
at ReportHelper.ConfirmationStatement.WriteLogFile(String msg)
at ReportHelper.ConfirmationStatement..ctor(Int32 futureBatchSetId)
at CustomCodeProxy.OnInit()
at Microsoft.ReportingServices.ReportProcessing.ExprHostObjectModel.
CustomCodeProxyBase..ctor(IReportObjectModelProxyForCustomCode
reportObjectModel)
at ReportExprHostImpl..ctor(Boolean parametersOnly, Object
reportObjectModel)
The state of the failed permission was:
<IPermission class="System.Security.Permissions.FileIOPermission,
mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
version="1"
Read="C:\Program Files\Microsoft SQL
Server\MSSQL\Reporting Services\ReportServer\bin\ReportLogger.log"
Write="C:\Program Files\Microsoft SQL
Server\MSSQL\Reporting Services\ReportServer\bin\ReportLogger.log"/>
w3wp!processing!2aa8!10/05/2005-16:47:17:: e ERROR: Throwing
Microsoft.ReportingServices.ReportProcessing.ReportProcessingException:
Exception of type
Microsoft.ReportingServices.ReportProcessing.ReportProcessingException
was thrown., ;
Info:
Microsoft.ReportingServices.ReportProcessing.ReportProcessingException:
Exception of type
Microsoft.ReportingServices.ReportProcessing.ReportProcessingException
was thrown.
w3wp!library!2aa8!10/05/2005-16:47:17:: i INFO: Initializing
EnableExecutionLogging to 'True' as specified in Server system
properties.
w3wp!webserver!2aa8!10/05/2005-16:47:17:: e ERROR: Reporting Services
error Microsoft.ReportingServices.Diagnostics.Utilities.RSException:
Failed to load expression host assembly. Details: Request for the
permission of type System.Security.Permissions.FileIOPermission,
mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089 failed. -->
Microsoft.ReportingServices.ReportProcessing.ReportProcessingException:
Failed to load expression host assembly. Details: Request for the
permission of type System.Security.Permissions.FileIOPermission,
mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089 failed.Hi,
See this article....
http://www.c-sharpcorner.com/Code/2005/June/CustomAssemblyinRS.asp
If still you have the issue, write to me bkkrishnan [at] hotmail [dot] com
Balaji
Siwy wrote:
>I'm trying to write to a text file from my custom assembly and I keep
>getting FileIOPermission. The only way I can get it to work is by
>changing the PermissionSetName of the whole CodeGroup from Nothing to
>FullTrust. The assembly itself is very simple and all it does is it
>writes one line to a text file.
>Here is what I did so far:
>1. I asserted the permission in my code.
>2. I put the text file and my assembly into ReportSevrer bin folder and
>changed the text file's security to allow "NETWORK SECURITY" (it
>is IIS6) and just in case "Everyone" to write to it.
>3. I added CodeGroup just after the code group with Url="$CodeGen$/*"
>to the rssrvpolicy.config file with PermissionSetName="FullTrust".
>I even installed Visual Studio 2005 to get access to PermCalc tool.
>All it showed me was that my dll needs FileIOPermission with
>Unrestricted="true" and SecurityPermission with
>Flags="Assertion" in the CodeGroup which I also tried by creating a
>seperate PermissionSet.
>What else can I possibly try?
>My Code:
>private void WriteLogFile(String msg)
>{
> FileIOPermission perm1 = new
>FileIOPermission(FileIOPermissionAccess.Write, @."C:\Program
>Files\Microsoft SQL Server\MSSQL\Reporting
>Services\ReportServer\bin\ReportLogger.log");
> perm1.Assert();
> FileStream fs = new FileStream(@."C:\Program Files\Microsoft SQL
>Server\MSSQL\Reporting Services\ReportServer\bin\ReportLogger.log",
>FileMode.OpenOrCreate, FileAccess.ReadWrite);
> StreamWriter w = new StreamWriter(fs);
> w.BaseStream.Seek(0, SeekOrigin.End);
> w.Write("{0} {1} ", DateTime.Now.ToLongTimeString(),
> DateTime.Now.ToLongDateString());
> w.Write(msg + "\r\n");
> w.Flush();
> w.Close();
>}
>My CodeGroup:
><CodeGroup class="UnionCodeGroup"
> version="1"
> PermissionSetName="FullTrust"
> Name="CGReportHelper"
> Description="Allow execution of ReportHelper.dll">
> <IMembershipCondition class="UrlMembershipCondition"
> version="1"
>Url="file://C:/Program Files/Microsoft SQL Server/MSSQL/Reporting
>Services/ReportServer/bin/ReportHelper.dll"/>
></CodeGroup>
>My Error:
>w3wp!processing!2aa8!10/05/2005-16:47:17:: e ERROR: Failed to load
>expression host assembly. Details: Request for the permission of type
>System.Security.Permissions.FileIOPermission, mscorlib,
>Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
>failed.
>System.Security.SecurityException: Request for the permission of type
>System.Security.Permissions.FileIOPermission, mscorlib,
>Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
>failed.
> at
>System.Security.CodeAccessSecurityEngine.CheckHelper(PermissionSet
>grantedSet, PermissionSet deniedSet, CodeAccessPermission demand,
>PermissionToken permToken)
> at System.Security.CodeAccessSecurityEngine.Check(PermissionToken
>permToken, CodeAccessPermission demand, StackCrawlMark& stackMark,
>Int32 checkFrames, Int32 unrestrictedOverride)
> at
>System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission
>cap, StackCrawlMark& stackMark)
> at System.Security.CodeAccessPermission.Demand()
> at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
>access, FileShare share, Int32 bufferSize, Boolean useAsync, String
>msgPath, Boolean bFromProxy)
> at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
>access)
> at ReportHelper.ConfirmationStatement.WriteLogFile(String msg)
> at ReportHelper.ConfirmationStatement..ctor(Int32 futureBatchSetId)
> at CustomCodeProxy.OnInit()
> at Microsoft.ReportingServices.ReportProcessing.ExprHostObjectModel.
>CustomCodeProxyBase..ctor(IReportObjectModelProxyForCustomCode
>reportObjectModel)
> at ReportExprHostImpl..ctor(Boolean parametersOnly, Object
>reportObjectModel)
>The state of the failed permission was:
><IPermission class="System.Security.Permissions.FileIOPermission,
>mscorlib, Version=1.0.5000.0, Culture=neutral,
>PublicKeyToken=b77a5c561934e089"
> version="1"
> Read="C:\Program Files\Microsoft SQL
>Server\MSSQL\Reporting Services\ReportServer\bin\ReportLogger.log"
> Write="C:\Program Files\Microsoft SQL
>Server\MSSQL\Reporting Services\ReportServer\bin\ReportLogger.log"/>
>w3wp!processing!2aa8!10/05/2005-16:47:17:: e ERROR: Throwing
>Microsoft.ReportingServices.ReportProcessing.ReportProcessingException:
>Exception of type
>Microsoft.ReportingServices.ReportProcessing.ReportProcessingException
>was thrown., ;
> Info:
>Microsoft.ReportingServices.ReportProcessing.ReportProcessingException:
>Exception of type
>Microsoft.ReportingServices.ReportProcessing.ReportProcessingException
>was thrown.
>w3wp!library!2aa8!10/05/2005-16:47:17:: i INFO: Initializing
>EnableExecutionLogging to 'True' as specified in Server system
>properties.
>w3wp!webserver!2aa8!10/05/2005-16:47:17:: e ERROR: Reporting Services
>error Microsoft.ReportingServices.Diagnostics.Utilities.RSException:
>Failed to load expression host assembly. Details: Request for the
>permission of type System.Security.Permissions.FileIOPermission,
>mscorlib, Version=1.0.5000.0, Culture=neutral,
>PublicKeyToken=b77a5c561934e089 failed. -->
>Microsoft.ReportingServices.ReportProcessing.ReportProcessingException:
>Failed to load expression host assembly. Details: Request for the
>permission of type System.Security.Permissions.FileIOPermission,
>mscorlib, Version=1.0.5000.0, Culture=neutral,
>PublicKeyToken=b77a5c561934e089 failed.
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-reporting/200510/1|||I finally figured it out.
The problem was with assertion in my code. I changed it from
FileIOPermissionAccess.Write to FileIOPermissionAccess.AllAccess and it
worked.
I guess when you open a file with FileAccess.ReadWrite then assertion
FileIOPermissionAccess.Write is not enough.
Regards,|||Hi,
I'm custom assemblie to access the registry and get some data..
i'm getting a error of "Requested registry access is not allowed"
I followed all the steps that you mentioned but i still get the same error..
but in case of File access it works im not getting any error but for
Registry acccess im getting that error. did you tried using registry. i even
gave "FullTrust" in the the permission policy file.
Please let me know if any one have tried registree.
Thanks
Bava
"BALAJI K via SQLMonster.com" wrote:
> Hi,
> See this article....
> http://www.c-sharpcorner.com/Code/2005/June/CustomAssemblyinRS.asp
> If still you have the issue, write to me bkkrishnan [at] hotmail [dot] com
> Balaji
>
> Siwy wrote:
> >I'm trying to write to a text file from my custom assembly and I keep
> >getting FileIOPermission. The only way I can get it to work is by
> >changing the PermissionSetName of the whole CodeGroup from Nothing to
> >FullTrust. The assembly itself is very simple and all it does is it
> >writes one line to a text file.
> >
> >Here is what I did so far:
> >
> >1. I asserted the permission in my code.
> >2. I put the text file and my assembly into ReportSevrer bin folder and
> >changed the text file's security to allow "NETWORK SECURITY" (it
> >is IIS6) and just in case "Everyone" to write to it.
> >3. I added CodeGroup just after the code group with Url="$CodeGen$/*"
> >to the rssrvpolicy.config file with PermissionSetName="FullTrust".
> >
> >I even installed Visual Studio 2005 to get access to PermCalc tool.
> >All it showed me was that my dll needs FileIOPermission with
> >Unrestricted="true" and SecurityPermission with
> >Flags="Assertion" in the CodeGroup which I also tried by creating a
> >seperate PermissionSet.
> >
> >What else can I possibly try?
> >
> >My Code:
> >
> >private void WriteLogFile(String msg)
> >{
> > FileIOPermission perm1 = new
> >FileIOPermission(FileIOPermissionAccess.Write, @."C:\Program
> >Files\Microsoft SQL Server\MSSQL\Reporting
> >Services\ReportServer\bin\ReportLogger.log");
> > perm1.Assert();
> >
> > FileStream fs = new FileStream(@."C:\Program Files\Microsoft SQL
> >Server\MSSQL\Reporting Services\ReportServer\bin\ReportLogger.log",
> >FileMode.OpenOrCreate, FileAccess.ReadWrite);
> > StreamWriter w = new StreamWriter(fs);
> > w.BaseStream.Seek(0, SeekOrigin.End);
> > w.Write("{0} {1} ", DateTime.Now.ToLongTimeString(),
> > DateTime.Now.ToLongDateString());
> > w.Write(msg + "\r\n");
> > w.Flush();
> >
> > w.Close();
> >}
> >
> >My CodeGroup:
> >
> ><CodeGroup class="UnionCodeGroup"
> > version="1"
> > PermissionSetName="FullTrust"
> > Name="CGReportHelper"
> > Description="Allow execution of ReportHelper.dll">
> > <IMembershipCondition class="UrlMembershipCondition"
> > version="1"
> >Url="file://C:/Program Files/Microsoft SQL Server/MSSQL/Reporting
> >Services/ReportServer/bin/ReportHelper.dll"/>
> ></CodeGroup>
> >
> >My Error:
> >
> >w3wp!processing!2aa8!10/05/2005-16:47:17:: e ERROR: Failed to load
> >expression host assembly. Details: Request for the permission of type
> >System.Security.Permissions.FileIOPermission, mscorlib,
> >Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
> >failed.
> >System.Security.SecurityException: Request for the permission of type
> >System.Security.Permissions.FileIOPermission, mscorlib,
> >Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
> >failed.
> > at
> >System.Security.CodeAccessSecurityEngine.CheckHelper(PermissionSet
> >grantedSet, PermissionSet deniedSet, CodeAccessPermission demand,
> >PermissionToken permToken)
> > at System.Security.CodeAccessSecurityEngine.Check(PermissionToken
> >permToken, CodeAccessPermission demand, StackCrawlMark& stackMark,
> >Int32 checkFrames, Int32 unrestrictedOverride)
> > at
> >System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission
> >cap, StackCrawlMark& stackMark)
> > at System.Security.CodeAccessPermission.Demand()
> > at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
> >access, FileShare share, Int32 bufferSize, Boolean useAsync, String
> >msgPath, Boolean bFromProxy)
> > at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
> >access)
> > at ReportHelper.ConfirmationStatement.WriteLogFile(String msg)
> > at ReportHelper.ConfirmationStatement..ctor(Int32 futureBatchSetId)
> > at CustomCodeProxy.OnInit()
> > at Microsoft.ReportingServices.ReportProcessing.ExprHostObjectModel.
> >CustomCodeProxyBase..ctor(IReportObjectModelProxyForCustomCode
> >reportObjectModel)
> > at ReportExprHostImpl..ctor(Boolean parametersOnly, Object
> >reportObjectModel)
> >
> >The state of the failed permission was:
> ><IPermission class="System.Security.Permissions.FileIOPermission,
> >mscorlib, Version=1.0.5000.0, Culture=neutral,
> >PublicKeyToken=b77a5c561934e089"
> > version="1"
> > Read="C:\Program Files\Microsoft SQL
> >Server\MSSQL\Reporting Services\ReportServer\bin\ReportLogger.log"
> > Write="C:\Program Files\Microsoft SQL
> >Server\MSSQL\Reporting Services\ReportServer\bin\ReportLogger.log"/>
> >
> >w3wp!processing!2aa8!10/05/2005-16:47:17:: e ERROR: Throwing
> >Microsoft.ReportingServices.ReportProcessing.ReportProcessingException:
> >Exception of type
> >Microsoft.ReportingServices.ReportProcessing.ReportProcessingException
> >was thrown., ;
> > Info:
> >Microsoft.ReportingServices.ReportProcessing.ReportProcessingException:
> >Exception of type
> >Microsoft.ReportingServices.ReportProcessing.ReportProcessingException
> >was thrown.
> >w3wp!library!2aa8!10/05/2005-16:47:17:: i INFO: Initializing
> >EnableExecutionLogging to 'True' as specified in Server system
> >properties.
> >w3wp!webserver!2aa8!10/05/2005-16:47:17:: e ERROR: Reporting Services
> >error Microsoft.ReportingServices.Diagnostics.Utilities.RSException:
> >Failed to load expression host assembly. Details: Request for the
> >permission of type System.Security.Permissions.FileIOPermission,
> >mscorlib, Version=1.0.5000.0, Culture=neutral,
> >PublicKeyToken=b77a5c561934e089 failed. -->
> >Microsoft.ReportingServices.ReportProcessing.ReportProcessingException:
> >Failed to load expression host assembly. Details: Request for the
> >permission of type System.Security.Permissions.FileIOPermission,
> >mscorlib, Version=1.0.5000.0, Culture=neutral,
> >PublicKeyToken=b77a5c561934e089 failed.
>
> --
> Message posted via SQLMonster.com
> http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-reporting/200510/1
>

Wednesday, March 28, 2012

knowing the 'result' of a, INSERT/UPDATE/DELETE

Hi,
I'm writing a VB.NET application who has to insert/update and delete a whole
bunch of records from a File into a Sql Server Database. But I want to be
able to knwo the 'result' of my ctions.
for exemple:
- after an INSERT: knowing if this happened well or not
- after an UPDATE: knowing wich number of records were updated (or if there
were records udpated or not)
- after a DELETE: knwoing the number of deleted recrods.
Is there any possiblity of doing this?
Thanks a lot,
Pieter
The return parameter id will tell you the autonumber id created here and if
it executed
/* Stored Procedure Insert tblDocuLijn*/
CREATE PROCEDURE spInserttblDocuLijn
@.ID bigint output,
-- FK tblDocument.DOCID
@.doclDOCID int,
@.doclInhoud varchar(2000),
@.doclPrijs float
As Insert INTO tblDocuLijn
(doclDOCID,
doclInhoud,
doclPrijs
)
VALUES
(
@.doclDOCID,
@.doclInhoud,
@.doclPrijs
)
SET @.ID = SCOPE_IDENTITY()
GO
for your update you will need a double stored proc
first select @.output = count(*) from blabla where your condition
then your update
delete the same
hope it helps
eric
"DraguVaso" <pietercoucke@.hotmail.com> wrote in message
news:%23q93JYGKEHA.1132@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I'm writing a VB.NET application who has to insert/update and delete a
whole
> bunch of records from a File into a Sql Server Database. But I want to be
> able to knwo the 'result' of my ctions.
> for exemple:
> - after an INSERT: knowing if this happened well or not
> - after an UPDATE: knowing wich number of records were updated (or if
there
> were records udpated or not)
> - after a DELETE: knwoing the number of deleted recrods.
> Is there any possiblity of doing this?
> Thanks a lot,
> Pieter
>
|||Check out @.@.ROWCOUNT and @.@.ERROR in the BOL.
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"DraguVaso" <pietercoucke@.hotmail.com> wrote in message
news:%23q93JYGKEHA.1132@.TK2MSFTNGP12.phx.gbl...
Hi,
I'm writing a VB.NET application who has to insert/update and delete a whole
bunch of records from a File into a Sql Server Database. But I want to be
able to knwo the 'result' of my ctions.
for exemple:
- after an INSERT: knowing if this happened well or not
- after an UPDATE: knowing wich number of records were updated (or if there
were records udpated or not)
- after a DELETE: knwoing the number of deleted recrods.
Is there any possiblity of doing this?
Thanks a lot,
Pieter
|||> - after an INSERT: knowing if this happened well or not
> - after an UPDATE: knowing wich number of records were updated (or if
there
> were records udpated or not)
> - after a DELETE: knwoing the number of deleted recrods.
The SqlCommand.ExecuteNonQuery method will return the number of rows
affected by an INSERT, UPDATE or DELETE. If execution fails, a
SqlException is thrown and you can catch it as desired.
Hope this helps.
Dan Guzman
SQL Server MVP
"DraguVaso" <pietercoucke@.hotmail.com> wrote in message
news:%23q93JYGKEHA.1132@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I'm writing a VB.NET application who has to insert/update and delete a
whole
> bunch of records from a File into a Sql Server Database. But I want to be
> able to knwo the 'result' of my ctions.
> for exemple:
> - after an INSERT: knowing if this happened well or not
> - after an UPDATE: knowing wich number of records were updated (or if
there
> were records udpated or not)
> - after a DELETE: knwoing the number of deleted recrods.
> Is there any possiblity of doing this?
> Thanks a lot,
> Pieter
>
|||Don't forget that both SQLCommand Objects and SqlDataAdapters have a variety
of events that will let you know all sorts of status of queries etc...
-CJ
"DraguVaso" <pietercoucke@.hotmail.com> wrote in message
news:%23q93JYGKEHA.1132@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I'm writing a VB.NET application who has to insert/update and delete a
whole
> bunch of records from a File into a Sql Server Database. But I want to be
> able to knwo the 'result' of my ctions.
> for exemple:
> - after an INSERT: knowing if this happened well or not
> - after an UPDATE: knowing wich number of records were updated (or if
there
> were records udpated or not)
> - after a DELETE: knwoing the number of deleted recrods.
> Is there any possiblity of doing this?
> Thanks a lot,
> Pieter
>
|||"DraguVaso" <pietercoucke@.hotmail.com> schrieb
> I'm writing a VB.NET application who has to insert/update and delete
> a whole bunch of records from a File into a Sql Server Database. But
> I want to be able to knwo the 'result' of my ctions.
> for exemple:
> - after an INSERT: knowing if this happened well or not
> - after an UPDATE: knowing wich number of records were updated (or if
> there were records udpated or not)
> - after a DELETE: knwoing the number of deleted recrods.
> Is there any possiblity of doing this?
The ExecuteNonQuery method is a function returning the number of affected
records.
Armin
How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
|||When your code calls ExecuteNonQuery to INSERT, UPDATE or DELETE - the
number of rows affected is returned. Here is an example that captures the
number of rows affected into a variable.
Dim recordsAffected As Integer = cmd.ExecuteNonQuery()
As far as knowing if "things went well" - exceptions will be raised. To
handle exceptions wrap your SQL INSERT, DELETE, and UPDATE calls in a
Try..Catch block and the SqlServerException class to find out what errors
occurred.
Try
....
Catch ex as System.Data.SqlException
... handle and/or report error
Finally
... clean up
End Try
Mike
Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com
When you call Update
"DraguVaso" <pietercoucke@.hotmail.com> wrote in message
news:%23q93JYGKEHA.1132@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I'm writing a VB.NET application who has to insert/update and delete a
whole
> bunch of records from a File into a Sql Server Database. But I want to be
> able to knwo the 'result' of my ctions.
> for exemple:
> - after an INSERT: knowing if this happened well or not
> - after an UPDATE: knowing wich number of records were updated (or if
there
> were records udpated or not)
> - after a DELETE: knwoing the number of deleted recrods.
> Is there any possiblity of doing this?
> Thanks a lot,
> Pieter
>
|||Hi Pieter,
I find it nice to have my name too in this nice group of people.
If you need more answer, feel free to ask.
Now we wait all for Herfried.
:-)))))
Cor
|||Thanks guys!! works great!!
"Mike McIntyre [MVP]" <mikemc@.dotnetshowandtell.com> wrote in message
news:uHVvStGKEHA.892@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> When your code calls ExecuteNonQuery to INSERT, UPDATE or DELETE - the
> number of rows affected is returned. Here is an example that captures the
> number of rows affected into a variable.
> Dim recordsAffected As Integer = cmd.ExecuteNonQuery()
> As far as knowing if "things went well" - exceptions will be raised. To
> handle exceptions wrap your SQL INSERT, DELETE, and UPDATE calls in a
> Try..Catch block and the SqlServerException class to find out what errors
> occurred.
> Try
> ...
> Catch ex as System.Data.SqlException
> ... handle and/or report error
> Finally
> ... clean up
> End Try
>
> --
> Mike
> Mike McIntyre
> Visual Basic MVP
> www.getdotnetcode.com
>
> When you call Update
> "DraguVaso" <pietercoucke@.hotmail.com> wrote in message
> news:%23q93JYGKEHA.1132@.TK2MSFTNGP12.phx.gbl...
> whole
be
> there
>
|||Hehe hi Cor!
It was indeed a nice conference here in this topic with everybody all
together :-)
Pieter
"Cor Ligthert" <notfirstname@.planet.nl> wrote in message
news:%23TvQDHHKEHA.1000@.TK2MSFTNGP11.phx.gbl...
> Hi Pieter,
> I find it nice to have my name too in this nice group of people.
> If you need more answer, feel free to ask.
> Now we wait all for Herfried.
> :-)))))
> Cor
>

knowing the 'result' of a, INSERT/UPDATE/DELETE

Hi,
I'm writing a VB.NET application who has to insert/update and delete a whole
bunch of records from a File into a Sql Server Database. But I want to be
able to knwo the 'result' of my ctions.
for exemple:
- after an INSERT: knowing if this happened well or not
- after an UPDATE: knowing wich number of records were updated (or if there
were records udpated or not)
- after a DELETE: knwoing the number of deleted recrods.
Is there any possiblity of doing this?
Thanks a lot,
PieterThe return parameter id will tell you the autonumber id created here and if
it executed
/* Stored Procedure Insert tblDocuLijn*/
CREATE PROCEDURE spInserttblDocuLijn
@.ID bigint output,
-- FK tblDocument.DOCID
@.doclDOCID int,
@.doclInhoud varchar(2000),
@.doclPrijs float
As Insert INTO tblDocuLijn
(doclDOCID,
doclInhoud,
doclPrijs
)
VALUES
(
@.doclDOCID,
@.doclInhoud,
@.doclPrijs
)
SET @.ID = SCOPE_IDENTITY()
GO
for your update you will need a double stored proc
first select @.output = count(*) from blabla where your condition
then your update
delete the same
hope it helps
eric
"DraguVaso" <pietercoucke@.hotmail.com> wrote in message
news:%23q93JYGKEHA.1132@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I'm writing a VB.NET application who has to insert/update and delete a
whole
> bunch of records from a File into a Sql Server Database. But I want to be
> able to knwo the 'result' of my ctions.
> for exemple:
> - after an INSERT: knowing if this happened well or not
> - after an UPDATE: knowing wich number of records were updated (or if
there
> were records udpated or not)
> - after a DELETE: knwoing the number of deleted recrods.
> Is there any possiblity of doing this?
> Thanks a lot,
> Pieter
>|||Check out @.@.ROWCOUNT and @.@.ERROR in the BOL.
--
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"DraguVaso" <pietercoucke@.hotmail.com> wrote in message
news:%23q93JYGKEHA.1132@.TK2MSFTNGP12.phx.gbl...
Hi,
I'm writing a VB.NET application who has to insert/update and delete a whole
bunch of records from a File into a Sql Server Database. But I want to be
able to knwo the 'result' of my ctions.
for exemple:
- after an INSERT: knowing if this happened well or not
- after an UPDATE: knowing wich number of records were updated (or if there
were records udpated or not)
- after a DELETE: knwoing the number of deleted recrods.
Is there any possiblity of doing this?
Thanks a lot,
Pieter|||> - after an INSERT: knowing if this happened well or not
> - after an UPDATE: knowing wich number of records were updated (or if
there
> were records udpated or not)
> - after a DELETE: knwoing the number of deleted recrods.
The SqlCommand.ExecuteNonQuery method will return the number of rows
affected by an INSERT, UPDATE or DELETE. If execution fails, a
SqlException is thrown and you can catch it as desired.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"DraguVaso" <pietercoucke@.hotmail.com> wrote in message
news:%23q93JYGKEHA.1132@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I'm writing a VB.NET application who has to insert/update and delete a
whole
> bunch of records from a File into a Sql Server Database. But I want to be
> able to knwo the 'result' of my ctions.
> for exemple:
> - after an INSERT: knowing if this happened well or not
> - after an UPDATE: knowing wich number of records were updated (or if
there
> were records udpated or not)
> - after a DELETE: knwoing the number of deleted recrods.
> Is there any possiblity of doing this?
> Thanks a lot,
> Pieter
>|||Don't forget that both SQLCommand Objects and SqlDataAdapters have a variety
of events that will let you know all sorts of status of queries etc...
-CJ
"DraguVaso" <pietercoucke@.hotmail.com> wrote in message
news:%23q93JYGKEHA.1132@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I'm writing a VB.NET application who has to insert/update and delete a
whole
> bunch of records from a File into a Sql Server Database. But I want to be
> able to knwo the 'result' of my ctions.
> for exemple:
> - after an INSERT: knowing if this happened well or not
> - after an UPDATE: knowing wich number of records were updated (or if
there
> were records udpated or not)
> - after a DELETE: knwoing the number of deleted recrods.
> Is there any possiblity of doing this?
> Thanks a lot,
> Pieter
>|||"DraguVaso" <pietercoucke@.hotmail.com> schrieb
> I'm writing a VB.NET application who has to insert/update and delete
> a whole bunch of records from a File into a Sql Server Database. But
> I want to be able to knwo the 'result' of my ctions.
> for exemple:
> - after an INSERT: knowing if this happened well or not
> - after an UPDATE: knowing wich number of records were updated (or if
> there were records udpated or not)
> - after a DELETE: knwoing the number of deleted recrods.
> Is there any possiblity of doing this?
The ExecuteNonQuery method is a function returning the number of affected
records.
Armin
How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html|||When your code calls ExecuteNonQuery to INSERT, UPDATE or DELETE - the
number of rows affected is returned. Here is an example that captures the
number of rows affected into a variable.
Dim recordsAffected As Integer = cmd.ExecuteNonQuery()
As far as knowing if "things went well" - exceptions will be raised. To
handle exceptions wrap your SQL INSERT, DELETE, and UPDATE calls in a
Try..Catch block and the SqlServerException class to find out what errors
occurred.
Try
...
Catch ex as System.Data.SqlException
... handle and/or report error
Finally
... clean up
End Try
Mike
Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com
When you call Update
"DraguVaso" <pietercoucke@.hotmail.com> wrote in message
news:%23q93JYGKEHA.1132@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I'm writing a VB.NET application who has to insert/update and delete a
whole
> bunch of records from a File into a Sql Server Database. But I want to be
> able to knwo the 'result' of my ctions.
> for exemple:
> - after an INSERT: knowing if this happened well or not
> - after an UPDATE: knowing wich number of records were updated (or if
there
> were records udpated or not)
> - after a DELETE: knwoing the number of deleted recrods.
> Is there any possiblity of doing this?
> Thanks a lot,
> Pieter
>|||Hi Pieter,
I find it nice to have my name too in this nice group of people.
If you need more answer, feel free to ask.
Now we wait all for Herfried.
:-)))))
Cor|||Thanks guys!! works great!!
"Mike McIntyre [MVP]" <mikemc@.dotnetshowandtell.com> wrote in message
news:uHVvStGKEHA.892@.TK2MSFTNGP09.phx.gbl...
> When your code calls ExecuteNonQuery to INSERT, UPDATE or DELETE - the
> number of rows affected is returned. Here is an example that captures the
> number of rows affected into a variable.
> Dim recordsAffected As Integer = cmd.ExecuteNonQuery()
> As far as knowing if "things went well" - exceptions will be raised. To
> handle exceptions wrap your SQL INSERT, DELETE, and UPDATE calls in a
> Try..Catch block and the SqlServerException class to find out what errors
> occurred.
> Try
> ...
> Catch ex as System.Data.SqlException
> ... handle and/or report error
> Finally
> ... clean up
> End Try
>
> --
> Mike
> Mike McIntyre
> Visual Basic MVP
> www.getdotnetcode.com
>
> When you call Update
> "DraguVaso" <pietercoucke@.hotmail.com> wrote in message
> news:%23q93JYGKEHA.1132@.TK2MSFTNGP12.phx.gbl...
> > Hi,
> >
> > I'm writing a VB.NET application who has to insert/update and delete a
> whole
> > bunch of records from a File into a Sql Server Database. But I want to
be
> > able to knwo the 'result' of my ctions.
> >
> > for exemple:
> > - after an INSERT: knowing if this happened well or not
> > - after an UPDATE: knowing wich number of records were updated (or if
> there
> > were records udpated or not)
> > - after a DELETE: knwoing the number of deleted recrods.
> >
> > Is there any possiblity of doing this?
> >
> > Thanks a lot,
> >
> > Pieter
> >
> >
>|||Hehe hi Cor!
It was indeed a nice conference here in this topic with everybody all
together :-)
Pieter
"Cor Ligthert" <notfirstname@.planet.nl> wrote in message
news:%23TvQDHHKEHA.1000@.TK2MSFTNGP11.phx.gbl...
> Hi Pieter,
> I find it nice to have my name too in this nice group of people.
> If you need more answer, feel free to ask.
> Now we wait all for Herfried.
> :-)))))
> Cor
>

knowing the 'result' of a, INSERT/UPDATE/DELETE

Hi,
I'm writing a VB.NET application who has to insert/update and delete a whole
bunch of records from a File into a Sql Server Database. But I want to be
able to knwo the 'result' of my ctions.
for exemple:
- after an INSERT: knowing if this happened well or not
- after an UPDATE: knowing wich number of records were updated (or if there
were records udpated or not)
- after a DELETE: knwoing the number of deleted recrods.
Is there any possiblity of doing this?
Thanks a lot,
PieterThe return parameter id will tell you the autonumber id created here and if
it executed
/* Stored Procedure Insert tblDocuLijn*/
CREATE PROCEDURE spInserttblDocuLijn
@.ID bigint output,
-- FK tblDocument.DOCID
@.doclDOCID int,
@.doclInhoud varchar(2000),
@.doclPrijs float
As Insert INTO tblDocuLijn
(doclDOCID,
doclInhoud,
doclPrijs
)
VALUES
(
@.doclDOCID,
@.doclInhoud,
@.doclPrijs
)
SET @.ID = SCOPE_IDENTITY()
GO
for your update you will need a double stored proc
first select @.output = count(*) from blabla where your condition
then your update
delete the same
hope it helps
eric
"DraguVaso" <pietercoucke@.hotmail.com> wrote in message
news:%23q93JYGKEHA.1132@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I'm writing a VB.NET application who has to insert/update and delete a
whole
> bunch of records from a File into a Sql Server Database. But I want to be
> able to knwo the 'result' of my ctions.
> for exemple:
> - after an INSERT: knowing if this happened well or not
> - after an UPDATE: knowing wich number of records were updated (or if
there
> were records udpated or not)
> - after a DELETE: knwoing the number of deleted recrods.
> Is there any possiblity of doing this?
> Thanks a lot,
> Pieter
>|||Check out @.@.ROWCOUNT and @.@.ERROR in the BOL.
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"DraguVaso" <pietercoucke@.hotmail.com> wrote in message
news:%23q93JYGKEHA.1132@.TK2MSFTNGP12.phx.gbl...
Hi,
I'm writing a VB.NET application who has to insert/update and delete a whole
bunch of records from a File into a Sql Server Database. But I want to be
able to knwo the 'result' of my ctions.
for exemple:
- after an INSERT: knowing if this happened well or not
- after an UPDATE: knowing wich number of records were updated (or if there
were records udpated or not)
- after a DELETE: knwoing the number of deleted recrods.
Is there any possiblity of doing this?
Thanks a lot,
Pieter|||> - after an INSERT: knowing if this happened well or not
> - after an UPDATE: knowing wich number of records were updated (or if
there
> were records udpated or not)
> - after a DELETE: knwoing the number of deleted recrods.
The SqlCommand.ExecuteNonQuery method will return the number of rows
affected by an INSERT, UPDATE or DELETE. If execution fails, a
SqlException is thrown and you can catch it as desired.
Hope this helps.
Dan Guzman
SQL Server MVP
"DraguVaso" <pietercoucke@.hotmail.com> wrote in message
news:%23q93JYGKEHA.1132@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I'm writing a VB.NET application who has to insert/update and delete a
whole
> bunch of records from a File into a Sql Server Database. But I want to be
> able to knwo the 'result' of my ctions.
> for exemple:
> - after an INSERT: knowing if this happened well or not
> - after an UPDATE: knowing wich number of records were updated (or if
there
> were records udpated or not)
> - after a DELETE: knwoing the number of deleted recrods.
> Is there any possiblity of doing this?
> Thanks a lot,
> Pieter
>|||Don't forget that both SQLCommand Objects and SqlDataAdapters have a variety
of events that will let you know all sorts of status of queries etc...
-CJ
"DraguVaso" <pietercoucke@.hotmail.com> wrote in message
news:%23q93JYGKEHA.1132@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I'm writing a VB.NET application who has to insert/update and delete a
whole
> bunch of records from a File into a Sql Server Database. But I want to be
> able to knwo the 'result' of my ctions.
> for exemple:
> - after an INSERT: knowing if this happened well or not
> - after an UPDATE: knowing wich number of records were updated (or if
there
> were records udpated or not)
> - after a DELETE: knwoing the number of deleted recrods.
> Is there any possiblity of doing this?
> Thanks a lot,
> Pieter
>|||"DraguVaso" <pietercoucke@.hotmail.com> schrieb
> I'm writing a VB.NET application who has to insert/update and delete
> a whole bunch of records from a File into a Sql Server Database. But
> I want to be able to knwo the 'result' of my ctions.
> for exemple:
> - after an INSERT: knowing if this happened well or not
> - after an UPDATE: knowing wich number of records were updated (or if
> there were records udpated or not)
> - after a DELETE: knwoing the number of deleted recrods.
> Is there any possiblity of doing this?
The ExecuteNonQuery method is a function returning the number of affected
records.
Armin
How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html|||When your code calls ExecuteNonQuery to INSERT, UPDATE or DELETE - the
number of rows affected is returned. Here is an example that captures the
number of rows affected into a variable.
Dim recordsAffected As Integer = cmd.ExecuteNonQuery()
As far as knowing if "things went well" - exceptions will be raised. To
handle exceptions wrap your SQL INSERT, DELETE, and UPDATE calls in a
Try..Catch block and the SqlServerException class to find out what errors
occurred.
Try
...
Catch ex as System.Data.SqlException
... handle and/or report error
Finally
... clean up
End Try
Mike
Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com
When you call Update
"DraguVaso" <pietercoucke@.hotmail.com> wrote in message
news:%23q93JYGKEHA.1132@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I'm writing a VB.NET application who has to insert/update and delete a
whole
> bunch of records from a File into a Sql Server Database. But I want to be
> able to knwo the 'result' of my ctions.
> for exemple:
> - after an INSERT: knowing if this happened well or not
> - after an UPDATE: knowing wich number of records were updated (or if
there
> were records udpated or not)
> - after a DELETE: knwoing the number of deleted recrods.
> Is there any possiblity of doing this?
> Thanks a lot,
> Pieter
>|||Hi Pieter,
I find it nice to have my name too in this nice group of people.
If you need more answer, feel free to ask.
Now we wait all for Herfried.
:-)))))
Cor|||Thanks guys!! works great!!
"Mike McIntyre [MVP]" <mikemc@.dotnetshowandtell.com> wrote in message
news:uHVvStGKEHA.892@.TK2MSFTNGP09.phx.gbl...
> When your code calls ExecuteNonQuery to INSERT, UPDATE or DELETE - the
> number of rows affected is returned. Here is an example that captures the
> number of rows affected into a variable.
> Dim recordsAffected As Integer = cmd.ExecuteNonQuery()
> As far as knowing if "things went well" - exceptions will be raised. To
> handle exceptions wrap your SQL INSERT, DELETE, and UPDATE calls in a
> Try..Catch block and the SqlServerException class to find out what errors
> occurred.
> Try
> ...
> Catch ex as System.Data.SqlException
> ... handle and/or report error
> Finally
> ... clean up
> End Try
>
> --
> Mike
> Mike McIntyre
> Visual Basic MVP
> www.getdotnetcode.com
>
> When you call Update
> "DraguVaso" <pietercoucke@.hotmail.com> wrote in message
> news:%23q93JYGKEHA.1132@.TK2MSFTNGP12.phx.gbl...
> whole
be[vbcol=seagreen]
> there
>|||Hehe hi Cor!
It was indeed a nice conference here in this topic with everybody all
together :-)
Pieter
"Cor Ligthert" <notfirstname@.planet.nl> wrote in message
news:%23TvQDHHKEHA.1000@.TK2MSFTNGP11.phx.gbl...
> Hi Pieter,
> I find it nice to have my name too in this nice group of people.
> If you need more answer, feel free to ask.
> Now we wait all for Herfried.
> :-)))))
> Cor
>sql

Wednesday, March 21, 2012

Kill cmd process started from SQL Server Agent

Hi!
I have a small problem , but it's still a problem.
I have a SQL Server Agent job that runs a .cmd file. This CMD is logged to a textfile.
This process is locked, waiting for me to type a password, but I have nowhere to type that pass.

What I want to do is kill the process that i locking the logfile, because since the logfile is locked, the job cannot be started again (and it's a scheduled job).
The jobs status is 'Not Running'.
I have solved the problem by making the cmd write to another logfile, so the schedule will work, but the file is still locked, and I don't want to restart the server since it's a productionserver.

How to I find the process that is initialized from SQL Agent, and kill it?

Thanks!

BixCould be you'll have a big problem...

what does the cmd file execute?

If it's ANY type of GUI you could hang the box...

What's in the cmd file?|||Nope, no GUI is executed.
It's juat a matter of reading textfiles, formatting the data and inserting it into the db.

The part that hangs is a "Net Use"-command for accessing a networkshare.
I have added the user and pass so that this does not happen again...|||I'm not sure about this, but I believe you will find cmdexec in your system processes. You can kill the PID and it should take care of you.|||killing the parent process without terminating the child may lead to system instability. cmdexec does not take care of anything that had been invoked from it.

Friday, March 9, 2012

Keeping users out while updating data

I have a flat file with data that I need to use to update existing records
in my database with. I wrote a Stored Proc to do this, but I want to run it
when everyone is out of the database. My question is, how do I keep users
from accessing the database while my update is running? I thought about
taking it offline but BOL said that while it's offline it can not be
modified. Does this mean the data or the structure or both?
Thanks
Mike
You could set it to single_user temporarily...
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"M Smith" <msmith@.avma.org> wrote in message
news:#tN5xTcOEHA.644@.tk2msftngp13.phx.gbl...
> I have a flat file with data that I need to use to update existing records
> in my database with. I wrote a Stored Proc to do this, but I want to run
it
> when everyone is out of the database. My question is, how do I keep users
> from accessing the database while my update is running? I thought about
> taking it offline but BOL said that while it's offline it can not be
> modified. Does this mean the data or the structure or both?
> Thanks
> Mike
>
|||OK, I set the database to start up in single_user mode. The problem is when
I try to open query analyzer to execute my stored proc it won't let me in.
It gives me a log in failure because SQL Server is in single user mode. How
can I execute my stored proc?
Mike
"Aaron Bertrand - MVP" <aaron@.TRASHaspfaq.com> wrote in message
news:e15w6VcOEHA.2344@.TK2MSFTNGP10.phx.gbl...[vbcol=seagreen]
> You could set it to single_user temporarily...
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
>
>
> "M Smith" <msmith@.avma.org> wrote in message
> news:#tN5xTcOEHA.644@.tk2msftngp13.phx.gbl...
records[vbcol=seagreen]
run[vbcol=seagreen]
> it
users
>
|||Setting it to restricted_user might be better assuming the normal users do
not have elevated privileges - with single_user the risk is someone getting
the connection before you which sounds like what is happening
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"M Smith" <msmith@.avma.org> wrote in message
news:eagtzxcOEHA.2780@.TK2MSFTNGP09.phx.gbl...
> OK, I set the database to start up in single_user mode. The problem is
when
> I try to open query analyzer to execute my stored proc it won't let me in.
> It gives me a log in failure because SQL Server is in single user mode.
How[vbcol=seagreen]
> can I execute my stored proc?
> Mike
> "Aaron Bertrand - MVP" <aaron@.TRASHaspfaq.com> wrote in message
> news:e15w6VcOEHA.2344@.TK2MSFTNGP10.phx.gbl...
> records
> run
> users
about
>
|||How about just using a locking hint for a more restrictive lock. If you used the holdlock locking hint:
SELECT * FROM [TABLE] (HOLDLOCK) it would be as if you were briefly the only user of that table.
There are other locks less restrictive than that like tablock and UPDLOCK, which will let others read the data.
|||Hi,
I do agree with Jaspers suggestion, set the database to restricted user and
using the same connection (inside query analyzer) try to execute the
procedure
Alter database northwind set RESTRICTED_USER with rollback immediate
go
exec procedures_name
go
Alter database northwind set MULTI_USER
Thanks
Hari
MCDBA
"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:uH2v#LdOEHA.1616@.TK2MSFTNGP12.phx.gbl...
> Setting it to restricted_user might be better assuming the normal users do
> not have elevated privileges - with single_user the risk is someone
getting[vbcol=seagreen]
> the connection before you which sounds like what is happening
> --
> HTH
> Jasper Smith (SQL Server MVP)
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
>
> "M Smith" <msmith@.avma.org> wrote in message
> news:eagtzxcOEHA.2780@.TK2MSFTNGP09.phx.gbl...
> when
in.[vbcol=seagreen]
> How
to
> about
>

Keeping users out while updating data

I have a flat file with data that I need to use to update existing records
in my database with. I wrote a Stored Proc to do this, but I want to run it
when everyone is out of the database. My question is, how do I keep users
from accessing the database while my update is running? I thought about
taking it offline but BOL said that while it's offline it can not be
modified. Does this mean the data or the structure or both?
Thanks
MikeYou could set it to single_user temporarily...
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"M Smith" <msmith@.avma.org> wrote in message
news:#tN5xTcOEHA.644@.tk2msftngp13.phx.gbl...
> I have a flat file with data that I need to use to update existing records
> in my database with. I wrote a Stored Proc to do this, but I want to run
it
> when everyone is out of the database. My question is, how do I keep users
> from accessing the database while my update is running? I thought about
> taking it offline but BOL said that while it's offline it can not be
> modified. Does this mean the data or the structure or both?
> Thanks
> Mike
>|||OK, I set the database to start up in single_user mode. The problem is when
I try to open query analyzer to execute my stored proc it won't let me in.
It gives me a log in failure because SQL Server is in single user mode. How
can I execute my stored proc?
Mike
"Aaron Bertrand - MVP" <aaron@.TRASHaspfaq.com> wrote in message
news:e15w6VcOEHA.2344@.TK2MSFTNGP10.phx.gbl...
> You could set it to single_user temporarily...
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
>
>
> "M Smith" <msmith@.avma.org> wrote in message
> news:#tN5xTcOEHA.644@.tk2msftngp13.phx.gbl...
records[vbcol=seagreen]
run[vbcol=seagreen]
> it
users[vbcol=seagreen]
>|||Setting it to restricted_user might be better assuming the normal users do
not have elevated privileges - with single_user the risk is someone getting
the connection before you which sounds like what is happening
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"M Smith" <msmith@.avma.org> wrote in message
news:eagtzxcOEHA.2780@.TK2MSFTNGP09.phx.gbl...
> OK, I set the database to start up in single_user mode. The problem is
when
> I try to open query analyzer to execute my stored proc it won't let me in.
> It gives me a log in failure because SQL Server is in single user mode.
How
> can I execute my stored proc?
> Mike
> "Aaron Bertrand - MVP" <aaron@.TRASHaspfaq.com> wrote in message
> news:e15w6VcOEHA.2344@.TK2MSFTNGP10.phx.gbl...
> records
> run
> users
about[vbcol=seagreen]
>|||How about just using a locking hint for a more restrictive lock. If you used
the holdlock locking hint:
SELECT * FROM [TABLE] (HOLDLOCK) it would be as if you were briefly the
only user of that table.
There are other locks less restrictive than that like tablock and UPDLOCK, w
hich will let others read the data.|||Hi,
I do agree with Jaspers suggestion, set the database to restricted user and
using the same connection (inside query analyzer) try to execute the
procedure
Alter database northwind set RESTRICTED_USER with rollback immediate
go
exec procedures_name
go
Alter database northwind set MULTI_USER
Thanks
Hari
MCDBA
"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:uH2v#LdOEHA.1616@.TK2MSFTNGP12.phx.gbl...
> Setting it to restricted_user might be better assuming the normal users do
> not have elevated privileges - with single_user the risk is someone
getting
> the connection before you which sounds like what is happening
> --
> HTH
> Jasper Smith (SQL Server MVP)
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
>
> "M Smith" <msmith@.avma.org> wrote in message
> news:eagtzxcOEHA.2780@.TK2MSFTNGP09.phx.gbl...
> when
in.[vbcol=seagreen]
> How
to[vbcol=seagreen]
> about
>

Keeping users out while updating data

I have a flat file with data that I need to use to update existing records
in my database with. I wrote a Stored Proc to do this, but I want to run it
when everyone is out of the database. My question is, how do I keep users
from accessing the database while my update is running? I thought about
taking it offline but BOL said that while it's offline it can not be
modified. Does this mean the data or the structure or both?
Thanks
MikeYou could set it to single_user temporarily...
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"M Smith" <msmith@.avma.org> wrote in message
news:#tN5xTcOEHA.644@.tk2msftngp13.phx.gbl...
> I have a flat file with data that I need to use to update existing records
> in my database with. I wrote a Stored Proc to do this, but I want to run
it
> when everyone is out of the database. My question is, how do I keep users
> from accessing the database while my update is running? I thought about
> taking it offline but BOL said that while it's offline it can not be
> modified. Does this mean the data or the structure or both?
> Thanks
> Mike
>|||OK, I set the database to start up in single_user mode. The problem is when
I try to open query analyzer to execute my stored proc it won't let me in.
It gives me a log in failure because SQL Server is in single user mode. How
can I execute my stored proc?
Mike
"Aaron Bertrand - MVP" <aaron@.TRASHaspfaq.com> wrote in message
news:e15w6VcOEHA.2344@.TK2MSFTNGP10.phx.gbl...
> You could set it to single_user temporarily...
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
>
>
> "M Smith" <msmith@.avma.org> wrote in message
> news:#tN5xTcOEHA.644@.tk2msftngp13.phx.gbl...
> > I have a flat file with data that I need to use to update existing
records
> > in my database with. I wrote a Stored Proc to do this, but I want to
run
> it
> > when everyone is out of the database. My question is, how do I keep
users
> > from accessing the database while my update is running? I thought about
> > taking it offline but BOL said that while it's offline it can not be
> > modified. Does this mean the data or the structure or both?
> >
> > Thanks
> > Mike
> >
> >
>|||Setting it to restricted_user might be better assuming the normal users do
not have elevated privileges - with single_user the risk is someone getting
the connection before you which sounds like what is happening
--
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"M Smith" <msmith@.avma.org> wrote in message
news:eagtzxcOEHA.2780@.TK2MSFTNGP09.phx.gbl...
> OK, I set the database to start up in single_user mode. The problem is
when
> I try to open query analyzer to execute my stored proc it won't let me in.
> It gives me a log in failure because SQL Server is in single user mode.
How
> can I execute my stored proc?
> Mike
> "Aaron Bertrand - MVP" <aaron@.TRASHaspfaq.com> wrote in message
> news:e15w6VcOEHA.2344@.TK2MSFTNGP10.phx.gbl...
> > You could set it to single_user temporarily...
> >
> > --
> > Aaron Bertrand
> > SQL Server MVP
> > http://www.aspfaq.com/
> >
> >
> >
> >
> > "M Smith" <msmith@.avma.org> wrote in message
> > news:#tN5xTcOEHA.644@.tk2msftngp13.phx.gbl...
> > > I have a flat file with data that I need to use to update existing
> records
> > > in my database with. I wrote a Stored Proc to do this, but I want to
> run
> > it
> > > when everyone is out of the database. My question is, how do I keep
> users
> > > from accessing the database while my update is running? I thought
about
> > > taking it offline but BOL said that while it's offline it can not be
> > > modified. Does this mean the data or the structure or both?
> > >
> > > Thanks
> > > Mike
> > >
> > >
> >
> >
>|||How about just using a locking hint for a more restrictive lock. If you used the holdlock locking hint:
SELECT * FROM [TABLE] (HOLDLOCK) it would be as if you were briefly the only user of that table
There are other locks less restrictive than that like tablock and UPDLOCK, which will let others read the data.|||Hi,
I do agree with Jaspers suggestion, set the database to restricted user and
using the same connection (inside query analyzer) try to execute the
procedure
Alter database northwind set RESTRICTED_USER with rollback immediate
go
exec procedures_name
go
Alter database northwind set MULTI_USER
Thanks
Hari
MCDBA
"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:uH2v#LdOEHA.1616@.TK2MSFTNGP12.phx.gbl...
> Setting it to restricted_user might be better assuming the normal users do
> not have elevated privileges - with single_user the risk is someone
getting
> the connection before you which sounds like what is happening
> --
> HTH
> Jasper Smith (SQL Server MVP)
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
>
> "M Smith" <msmith@.avma.org> wrote in message
> news:eagtzxcOEHA.2780@.TK2MSFTNGP09.phx.gbl...
> > OK, I set the database to start up in single_user mode. The problem is
> when
> > I try to open query analyzer to execute my stored proc it won't let me
in.
> > It gives me a log in failure because SQL Server is in single user mode.
> How
> > can I execute my stored proc?
> >
> > Mike
> >
> > "Aaron Bertrand - MVP" <aaron@.TRASHaspfaq.com> wrote in message
> > news:e15w6VcOEHA.2344@.TK2MSFTNGP10.phx.gbl...
> > > You could set it to single_user temporarily...
> > >
> > > --
> > > Aaron Bertrand
> > > SQL Server MVP
> > > http://www.aspfaq.com/
> > >
> > >
> > >
> > >
> > > "M Smith" <msmith@.avma.org> wrote in message
> > > news:#tN5xTcOEHA.644@.tk2msftngp13.phx.gbl...
> > > > I have a flat file with data that I need to use to update existing
> > records
> > > > in my database with. I wrote a Stored Proc to do this, but I want
to
> > run
> > > it
> > > > when everyone is out of the database. My question is, how do I keep
> > users
> > > > from accessing the database while my update is running? I thought
> about
> > > > taking it offline but BOL said that while it's offline it can not be
> > > > modified. Does this mean the data or the structure or both?
> > > >
> > > > Thanks
> > > > Mike
> > > >
> > > >
> > >
> > >
> >
> >
>

Friday, February 24, 2012

Keep speed

Hi...

I'm inserting and deleting about 30 000 records into 2 tables each day - import them from a text file using DTS.

The users add about 1000 records a day using Access and Windows .NET frontends...

Which TSQL commands should I run frequently to keep the database up to speed ?

I'm doing the following ... do you know of anything else?

Backup LOG MyDataBase WITH TRUNCATE_ONLY
DBCC SHRINKDATABASE (MyDataBase , 40)
GO

Backup LOG tempdb WITH TRUNCATE_ONLY
DBCC SHRINKDATABASE (tempdb, 70)
GO

THANKS!!!!!!!!!!!!!!!

Dave

There are a lot of different things you can do to keep the speed of your database up, such as:

Set the database to Simple Recovery and enable Auto Shrink, this will perform the same function you are doing with your DBCC Shrink commands. There are quite a few debates as to whether or not Simple Recovery and Auto Shrink impact performance but I have not seen any negative impacts myself.

Partition your database across multiple physical drives, this can dramatically improve performance

If you are using SAN disk, properly align the sector boundaries of your disk, here is a rather large document on the subject but it's a good one

http://www.hertenberger.co.za/resources/diskpar.pdf#search='how%20to%20use%20diskpar'

Delete any data older than "x" days from your tables, which it sounds like you may already be doing

Dedicate "x" amount of RAM to your instance

Dedicate "x" number of CPU's to your instance

The list goes on but that is a few examples.

|||Simple recovery model will not impact performance. However, the autoshrink certainly will. If the autoshrink kicks off when you are trying to process other queries, it will definitely slow everything down.|||

Hi Dave,

What comes to mind immediatly is that there will be a potentially large amount of fragmentation of tables/indexes in your db. This is because: a) you are performing a large amount of deletes and inserts often and b) shrinkdatabase introduces logical fragmentation.

So, I would recommend you run dbcc showcontig on your main tables, then perform rebuilds as needed with either DBCC DBREINDEX or DBCC INDEXDEFRAG. As an aside, if there has been a large amount of fragmentation on several tables, make sure your statistics are up to date, and run sp_recompile on the tables in question so that any stored procs you have can make use of the new stats immediatly.

Cheers
Rob

|||

Hi, Lesego.

If you're going to be doing queries agianst these tables that you're adding and removing data from, it's probably a good idea to update the statistics on the table. UPDATE STATISTICS is the command to use, and you'll want to run it against any statistics the table has -- you can find those most easily by exploring in the object browser in managemnet studio, but you'll have one for each index on the table, plus any that you've created yourself, plus any that the server has created automatically.

UPDATE STATISTICS might not be too important if you're selecting data directly from the table. But it will be very important if you are using the table that's the target of your insert/delete batch job in any JOINs with other tables. The query optimizer makes many decisions about how to best execute a statement based on information it can gather from the statistics on the table.

Hope that helps, and do let us know if you have more follow-up questions.

.B ekiM

Keep only X # of backups when appending to BU file

Using SQL Server 2005 STD, is there a way to create a maintance plan to
backup the database, appending to a file, but only keeping the last X number
of backups?
I would like to keep 4 full backups at a time. When the 5th backup occurs, I
would like the first to be deleted.
I've seen options like this in 3rd party backup tools, but is there a way to
do this natively w/ SQL Server?
Have a look at the expire parameter of the backup command. From
http://msdn2.microsoft.com/en-us/library/ms187510.aspx
a.. To have the backup set expire after a specific number of days, click
After (the default option), and enter the number of days after set creation
that the set will expire. This value can be from 0 to 99999 days; a value of
0 days means that the backup set will never expire.
The default value is set in the Default backup media retention (in days)
option of the Server Properties dialog box (Database Settings Page). To
access this, right-click the server name in Object Explorer and select
properties; then select the Database Settings page.
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Dan" <Dan@.discussions.microsoft.com> wrote in message
news:DEA2E6D1-DB67-42F7-8406-E37EB553AEA9@.microsoft.com...
> Using SQL Server 2005 STD, is there a way to create a maintance plan to
> backup the database, appending to a file, but only keeping the last X
> number
> of backups?
> I would like to keep 4 full backups at a time. When the 5th backup occurs,
> I
> would like the first to be deleted.
> I've seen options like this in 3rd party backup tools, but is there a way
> to
> do this natively w/ SQL Server?
|||If every backup goes to the same file, then the answer is no. There
is no way for SQL Server to drop old backups from the front of the
file. The solution is for each backup to go to an individual file.
Roy Harvey
Beacon Falls, CT
On Tue, 19 Sep 2006 18:34:01 -0700, Dan
<Dan@.discussions.microsoft.com> wrote:

>Using SQL Server 2005 STD, is there a way to create a maintance plan to
>backup the database, appending to a file, but only keeping the last X number
>of backups?
>I would like to keep 4 full backups at a time. When the 5th backup occurs, I
>would like the first to be deleted.
>I've seen options like this in 3rd party backup tools, but is there a way to
>do this natively w/ SQL Server?

Keep only X # of backups when appending to BU file

Using SQL Server 2005 STD, is there a way to create a maintance plan to
backup the database, appending to a file, but only keeping the last X number
of backups?
I would like to keep 4 full backups at a time. When the 5th backup occurs, I
would like the first to be deleted.
I've seen options like this in 3rd party backup tools, but is there a way to
do this natively w/ SQL Server?Have a look at the expire parameter of the backup command. From
http://msdn2.microsoft.com/en-us/library/ms187510.aspx
a.. To have the backup set expire after a specific number of days, click
After (the default option), and enter the number of days after set creation
that the set will expire. This value can be from 0 to 99999 days; a value of
0 days means that the backup set will never expire.
The default value is set in the Default backup media retention (in days)
option of the Server Properties dialog box (Database Settings Page). To
access this, right-click the server name in Object Explorer and select
properties; then select the Database Settings page.
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Dan" <Dan@.discussions.microsoft.com> wrote in message
news:DEA2E6D1-DB67-42F7-8406-E37EB553AEA9@.microsoft.com...
> Using SQL Server 2005 STD, is there a way to create a maintance plan to
> backup the database, appending to a file, but only keeping the last X
> number
> of backups?
> I would like to keep 4 full backups at a time. When the 5th backup occurs,
> I
> would like the first to be deleted.
> I've seen options like this in 3rd party backup tools, but is there a way
> to
> do this natively w/ SQL Server?|||If every backup goes to the same file, then the answer is no. There
is no way for SQL Server to drop old backups from the front of the
file. The solution is for each backup to go to an individual file.
Roy Harvey
Beacon Falls, CT
On Tue, 19 Sep 2006 18:34:01 -0700, Dan
<Dan@.discussions.microsoft.com> wrote:

>Using SQL Server 2005 STD, is there a way to create a maintance plan to
>backup the database, appending to a file, but only keeping the last X numbe
r
>of backups?
>I would like to keep 4 full backups at a time. When the 5th backup occurs,
I
>would like the first to be deleted.
>I've seen options like this in 3rd party backup tools, but is there a way t
o
>do this natively w/ SQL Server?

Keep only X # of backups when appending to BU file

Using SQL Server 2005 STD, is there a way to create a maintance plan to
backup the database, appending to a file, but only keeping the last X number
of backups?
I would like to keep 4 full backups at a time. When the 5th backup occurs, I
would like the first to be deleted.
I've seen options like this in 3rd party backup tools, but is there a way to
do this natively w/ SQL Server?Have a look at the expire parameter of the backup command. From
http://msdn2.microsoft.com/en-us/library/ms187510.aspx
a.. To have the backup set expire after a specific number of days, click
After (the default option), and enter the number of days after set creation
that the set will expire. This value can be from 0 to 99999 days; a value of
0 days means that the backup set will never expire.
The default value is set in the Default backup media retention (in days)
option of the Server Properties dialog box (Database Settings Page). To
access this, right-click the server name in Object Explorer and select
properties; then select the Database Settings page.
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Dan" <Dan@.discussions.microsoft.com> wrote in message
news:DEA2E6D1-DB67-42F7-8406-E37EB553AEA9@.microsoft.com...
> Using SQL Server 2005 STD, is there a way to create a maintance plan to
> backup the database, appending to a file, but only keeping the last X
> number
> of backups?
> I would like to keep 4 full backups at a time. When the 5th backup occurs,
> I
> would like the first to be deleted.
> I've seen options like this in 3rd party backup tools, but is there a way
> to
> do this natively w/ SQL Server?|||If every backup goes to the same file, then the answer is no. There
is no way for SQL Server to drop old backups from the front of the
file. The solution is for each backup to go to an individual file.
Roy Harvey
Beacon Falls, CT
On Tue, 19 Sep 2006 18:34:01 -0700, Dan
<Dan@.discussions.microsoft.com> wrote:
>Using SQL Server 2005 STD, is there a way to create a maintance plan to
>backup the database, appending to a file, but only keeping the last X number
>of backups?
>I would like to keep 4 full backups at a time. When the 5th backup occurs, I
>would like the first to be deleted.
>I've seen options like this in 3rd party backup tools, but is there a way to
>do this natively w/ SQL Server?

Monday, February 20, 2012

KB913580 related problem

I hope this is posted in the correct forum.

I have Linked Servers that are used to query Access databases that reside on a file server.This has been working for a long time, until I applied KB913580 which references the Distributed Transaction Controller. I am running SQL Server 2000 on the same desktop (development environment) from which I am accessing the Linked Server.The file server is on the same LAN segment – there is no firewall involved.

I uninstalled the update and rebooted but still getting the error:

OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.

[OLE/DB provider returned message: The Microsoft Jet database engine cannot open the file '\\tacir2k3\Infrastructure\Databases\July 2003 Databases\General\GenDb2004_TR_Db.mdb'.It is already opened exclusively by another user, or you need permission to view its data.]

OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IDBInitialize::Initialize returned 0x80004005:].

The SQL Server log contains the following (see bolded item):

2006-05-12 07:58:29.79 serverMicrosoft SQL Server2000 - 8.00.760 (Intel X86)

Dec 17 2002 14:22:05

Copyright (c) 1988-2003 Microsoft Corporation

Developer Edition on Windows NT 5.1 (Build 2600: Service Pack 2)

2006-05-12 07:58:29.79 serverCopyright (C) 1988-2002 Microsoft Corporation.

2006-05-12 07:58:29.79 serverAll rights reserved.

2006-05-12 07:58:29.79 serverServer Process ID is 1720.

2006-05-12 07:58:29.79 serverLogging SQL Server messages in file 'C:\Program Files\Microsoft SQL Server\MSSQL\log\ERRORLOG'.

2006-05-12 07:58:29.98 serverSQL Server is starting at priority class 'normal'(1 CPU detected).

2006-05-12 07:58:31.85 serverSQL Server configured for thread mode processing.

2006-05-12 07:58:31.95 serverUsing dynamic lock allocation. [2500] Lock Blocks, [5000] Lock Owner Blocks.

2006-05-12 07:58:32.18 serverAttempting to initialize Distributed Transaction Coordinator.

2006-05-12 07:58:32.37 serverFailed to obtain TransactionDispenserInterface: Result Code = 0x8004d01b

2006-05-12 07:58:32.46 spid3Starting up database 'master'.

The Distributed Transaction Coordinator service is started. The settings are all set to OFF (0).

A query to a table in the linked server returns:

OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.

[OLE/DB provider returned message: The Microsoft Jet database engine cannot open the file '\\tacir2k3\Infrastructure\Databases\July 2003 Databases\General\GenDb2004_TR_Db.mdb'.It is already opened exclusively by another user, or you need permission to view its data.]

OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IDBInitialize::Initialize returned 0x80004005:].

(It is not in use by any other user).

exec xp_cmdshell 'type \\TACIR2K3\infrastructure\Databases\July 2004 Databases\General\GenDb2005_TR_Db.mdb'

This returns” “access is denied”

Is there any way to resolve this problem?

Hi,

I am not sure if the issue is related to the patch or not.

Most probably uninstalling the patch won't help. I have experienced few issues after installing this patch on Windows 2000 server.

Even uninstalling didn't help.

Solution which worked:

Uninstall the patch, reboot.

Install the patch manually from Microsoft website and not from windows update site, reboot and the issue should be fixed if it's related to the patch.

The patch if installed from windows update is not updating few core files in Windows 2000 server. Manual install is able to update the files.

|||

I installed KB913580 on a Windows 2000 server hosting our Exchange Server (5.5). This sits on an internal IP and receives traffic from a TrimMail (mail filtering device). The TrimMail gets an internal IP NATted from a Cisco Pix firewall. The firewall is connected directly to a cable modem (the router is a Cisco "router on a stick" handled through a trunked vlan on a Cisco Catalyst 6600 switch).

The way it is designed, the TrimMail device receives mail, filters, forwards to the Exchange server. If the Exchange server is unavailable, TrimMail holds the mail for up to five days.

After the installation of KB913580, incoming mail from outside our network stopped. Some of the incoming mail bounced, some was acquired by TrimMail and held but not delivered to Exchange. Every "ping" from inside the network to any outside address failed. Browser traffic worked fine without any delays, so the connection was all right.

When KB913580 was uninstalled, "ping" worked, mail came through fine.

I hate to think we are exposed to the security vulnerability this patch is designed to fix, but until I figure out what happened and why, I cannot re-install it.

Any ideas?

|||

Yes, there's no doubt in my mind that this patch caused these problems and the problems I have encountered.

I applied the Microsoft patch MS06-018 (KB913580) Vulnerability in Microsoft Distributed Transaction Coordinator Could Allow Denial of Service on the 13th (4 days after it was issued) to my dedicated server (at a hosting site) running SQL2K SP4. Since then, on two occasions, I needed to reboot my server (Win 2K Server SP4) and the server took exceptionally long to boot and then when I finally gained access to the server SQL Server EM could not find my server (my databases were gone), I couldn't access Internet sites with IE (although I could ping remote sites), and I couldn't even open the Control Panel to look at network services. In the Services menu, it just said mssql.exe "Starting...". When that service was stopped, the network stuff all happened so I could access sites, and I could restart SQL Server.

Excerpts from the SQL Server Log:

Microsoft SQL Server 2000 - 8.00.2039 (Intel X86)
May 3 2005 23:18:38
Copyright (c) 1988-2003 Microsoft Corporation
Standard Edition on Windows NT 5.0 (Build 2195: Service Pack 4)

Attempting to initialize Distributed Transaction Coordinator.
(12 -30 minutes later)
Failed to obtain TransactionDispenserInterface: Result Code = 0x8004d01b
Could not set up Net-Library 'SSNETLIB'..
Unable to load any netlibs.
SQL Server could not spawn FRunCM thread.

Does anyone know SPECIFICALLY the issue here? This is all on a production server where I cannot experiment with uninstalling/rebooting/installing/rebooting etc.

Thanks for any help.

|||

I did as you suggested and rebooted.

The SQL Server log errors related to the Distributed Transaction Coordinator are gone and I can reference the linked database.

Thank you many times!!! I would never have come to this solution.

|||

Well I spoke too soon about this solving my problem. Got one good SQL Server start and now I am back to the same problem.

I also noticed a couple of other problems that started occurring after KB900485 was applied on 4/28/2006. I tried the suggestion regarding reinstalling this patch from the MS site and keep getting the automatic updates notice for it when I reboot. It displays on the Add/Remove programs list.

I get about 21 messages " Error 15457. Configuration option 'allow updates' changed from 0 to 1. Run the RECONFIGURE statement to install." These started on 5/1/2006 after KB900485 was applied. On the last test these occurred at the time I executed SQL to access the linked database.

I looked closer at the Events log and notice that I also started getting the following error related to MSSQLServer after KB900485 was applied. "SuperSocket into: (SpnRegister): Error 1355.

GRRRRR. Anyone with any other suggestions.

|||

I had issues with KB913580 and developed a bunch of strange problems on my server and it turned out to be a tape driver conflict.

Everything else that happened was a symptom of the problem and not the actual problem. I could not log out or shutdown the server, I could not browse the internet and some of the core services were not started or timed out etc which caused a series of problems overall.

So, if you have backup exec v10D installed on this server and have the veritas drivers installed try removing the veritas tape drivers and go to your native tape drivers from MS or the Manufacture and see if your other problems go away. It may take two reboots for the tape drives and veritas to work properly. Once to initially identify the tape drive and install the drivers and then a second reboot to actually load the drivers.

Let me know if you have this situation and if it corrects it.

|||

After a MONTH of PSS from MS, dozens of hours of emails and phone calls, and several PSS techs, it turns out that this was a SQL Server bug, that occasionally appears on some Windows 2000 SP4 machines when the KB913580 patch changes something about the order of startup services.

The fix can be found here:

http://support.microsoft.com/?kbid=917405

Note: Much of this time was wasted because the KB913580 patch could not be completely uninstalled (as expected) once it was manually installed (not from the update process).