|
Hi,
we are having a problem with an SQL Server 2005.
We are running multiple scripts to send emails on the server but from time to time the server stops sending emails and we have to do a restart to ensure functionalitsy again. We have already taken care to close all opened connections in the scripts.
Any thoughts?
|
|
|
|
|
usermj87 wrote: Any thoughts?
Only wild guesses - care to show us your code?
There are various logfiles in Sql Server. Did they contain any references to errors or warnings?
Bastard Programmer from Hell
|
|
|
|
|
Very difficult to suggest something without seeing your code. Deadlocks, Uncommitted transactions and so many other things could happen.
|
|
|
|
|
Yes...
We are using a standard Stored Procedure as sendmail function.
ALTER PROCEDURE [dbo].[sendmail_subsc]
@to varchar(200),
@copy varchar(200)=null,
@bcc varchar(200)=null,
@replyto varchar(200)=null,
@from varchar(200),
@subject varchar(200),
@body text,
@filename varchar(255)=null
AS
Declare @iMsg int
Declare @hr int
--************* Create the CDO.Message Object ************************
EXEC @hr = sp_OACreate 'CDO.Message', @iMsg OUT
-- This is to configure a remote SMTP server.
EXEC @hr = sp_OASetProperty @iMsg, 'Configuration.fields("http://schemas.microsoft.com/cdo/configuration/sendusing").Value','2'
-- This is to configure the Server Name or IP address.
EXEC @hr = sp_OASetProperty @iMsg, 'Configuration.fields("http://schemas.microsoft.com/cdo/configuration/smtpserver").Value', 'our smtp server'
-- Save the configurations to the message object.
EXEC @hr = sp_OAMethod @iMsg, 'Configuration.Fields.Update', null
-- Set the e-mail parameters.
EXEC @hr = sp_OASetProperty @iMsg, 'To', @To
IF @copy IS NOT NULL
BEGIN
EXEC @hr = sp_OASetProperty @iMsg, 'Cc', @copy
END
IF @bcc IS NOT NULL
BEGIN
EXEC @hr = sp_OASetProperty @iMsg, 'Bcc', @bcc
END
IF @replyto IS NOT NULL
BEGIN
EXEC @hr = sp_OASetProperty @iMsg, 'ReplyTo', @replyto
END
EXEC @hr = sp_OASetProperty @iMsg, 'From', @from
EXEC @hr = sp_OASetProperty @iMsg, 'Subject', @Subject
EXEC @hr = sp_OASetProperty @iMsg, 'HTMLBody', @Body
IF @filename IS NOT NULL
BEGIN
EXEC @hr = sp_OAMethod @iMsg, 'AddAttachment', null, @filename
END
-- Send mail
EXEC @hr = sp_OAMethod @iMsg, 'Send', NULL
-- Destry object
EXEC @hr=sp_OADestroy @iMsg
and the error message we get is that in this procedure the destroy object fails at one point in time and then crashed the whole server. (buffer issue?)
here is the error log from the server:
2011-12-28 02:00:51.25 spid55 Stack Signature for the dump is 0x000000015B32F370
2011-12-28 02:00:52.24 spid55 External dump process return code 0x20000001.External dump process returned no errors.
2011-12-28 02:00:52.26 spid55 Using 'dbghelp.dll' version '4.0.5'
2011-12-28 02:00:53.36 spid55 ***Stack Dump being sent to E:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\SQLDump10000.txt
2011-12-28 02:00:53.36 spid55 SqlDumpExceptionHandler: Process 55 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.
2011-12-28 02:00:53.36 spid55 * *******************************************************************************
2011-12-28 02:00:53.36 spid55 *
2011-12-28 02:00:53.36 spid55 * BEGIN STACK DUMP:
2011-12-28 02:00:53.36 spid55 * 12/28/11 02:00:53 spid 55
2011-12-28 02:00:53.36 spid55 *
2011-12-28 02:00:53.36 spid55 *
2011-12-28 02:00:53.36 spid55 * Exception Address = 00000000774A54FA Module(ntdll+00000000000254FA)
2011-12-28 02:00:53.36 spid55 * Exception Code = c0000005 EXCEPTION_ACCESS_VIOLATION
2011-12-28 02:00:53.36 spid55 * Access Violation occurred writing address 0000000000000024
2011-12-28 02:00:53.36 spid55 * Input Buffer 510 bytes –
2011-12-28 02:00:53.36 spid55 * exec sendmail_subsc 'email address 1(placeholder)','email address 2 (placeholder
2011-12-28 07:53:15 - ! [298] SQLServer Error: 233, Shared Memory Provider: No process is on the other end of the pipe. [SQLSTATE 08S01]
2011-12-28 07:53:15 - ! [298] SQLServer Error: 233, Communication link failure [SQLSTATE 08S01]
2011-12-28 07:53:15 - ! [382] Logon to server '(local)' failed (ConnAttemptCachableOp)
2011-12-28 07:53:15 - ! [298] SQLServer Error: 233, Shared Memory Provider: No process is on the other end of the pipe. [SQLSTATE 08S01]
2011-12-28 07:53:15 - ! [298] SQLServer Error: 233, Communication link failure [SQLSTATE 08S01]
2011-12-28 07:53:15 - ! [382] Logon to server '(local)' failed (ConnAttemptCachableOp)
|
|
|
|
|
hello guys...excuse me for this basic question. I made this new login but when I try to connect using this login this message is shown
<pre lang="c#">
Login failed for user 'xxxxx'. (Microsoft Sql Server, Error: 18456)
</pre>
Whats the problem? Everything seems fine to me.
|
|
|
|
|
overloaded Name wrote: I made this new login
Made it how?
overloaded Name wrote: when I try to connect using this login
Tried to connect how?
|
|
|
|
|
See the error number, try entering that nto a Google search, you will get this as the first result[^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
Hi ALL,
does anybody have a working C++ code that reads mutlivalue MS Acces fields via DAO? Please help!
Radjiv
|
|
|
|
|
Did you even bother to search?
check this[^]
|
|
|
|
|
I'm looking for some good examples of database documentation to use as inspiration (to copy ) for my database documentation. The technical documentation I'm fine with; I can use tools for that to extract it from the DB, but I've hit some writer's block, especially at documenting entities, i.e. tables. OK, I'm using EF, so each of my tables represents an entity model object, and I could use short, on-liners, e.g. the Member table 'stores Member records', but that is a bit useless, so I want to also document what the Member entity is, in the same piece of documentation. Now I am stuck vacillating between one-lines and one-pagers, so I would some examples of well written DB/entity documentation. Any suggestions?
|
|
|
|
|
Just my opinion:
Including
Brady Kelly wrote: the Member table 'stores Member records' may sound unnecessary but there may be that table the currently everyone knows what it is be two years from now they will not. So I suggest keeping the information.
|
|
|
|
|
I didn't say documenting the table was unnecessary, I just said I didn't only want to have something that is basically redundant in my documentation.
|
|
|
|
|
If there is sufficient documentation that basically describes the point of a table elsewhere then your table documentation should specifically reference that other documentation. By name, by section within the document and perhaps with a link if possible. If a link is not possible then enough information must be provided that someone can reliably find that other documentation...two years from now.
|
|
|
|
|
There is no other documentation. I want the documentation for the database, the only area of the application that my client will be able to easily understand, to be the definitive documentation.
|
|
|
|
|
Hi All,
can you help me? i have problem to sum up in MSSQL.
I have column below
Sale Date Total Sale/USD Deposit/USD Difference/USD
01/02/2012 188 180 -8
02/02/2012 110 100 -10
I want to create one more column is Accumulative to sum up column Different.
Accumulative
-8
-18
Can any one give me SQL statement to product result above.
Thanks.
Socheat
modified 8-Feb-12 23:03pm.
|
|
|
|
|
|
Thank for your information
Socheat
|
|
|
|
|
I need to compare two tables in sql server. they are located on different databases. I need to compare the data. The tables have about 200 fields in them.
IS there a way to compare this data and know which field does not match?
Using a hashtotal, would say if two rows are different but does not which data is exactly different. And it gets tough with 200 fields in a table.
Also the size of the table is big, about 100000 rows at minimum.
Thank you so much.
|
|
|
|
|
I suggest you create a copy of the second table in the first server - otherwise your compare will be delayed by the network.
vanikanc wrote: Using a hashtotal, would say if two rows are different but does not which data is exactly different. And it gets tough with 200 fields in a table.
200 fields? How about normalizing that table?
You could write a small table-valued function that compares each field individually for a given record and that spits out only the columnnames where there's differences, by looping through all the columns (see sys.columns ).
Another option might be Sql Compare[^] from Red Gate. It shows the difference in your data, but also on a row-by-row level. The changed columns are highlighted in a different color though, and there's a trial-version available.
Bastard Programmer from Hell
|
|
|
|
|
How about using the Hashtotal or checksum concept and if the two rows are different, then write them out to 2 different text files (FileA & FileB). At the end of the process, you could use a tool like BeyondCompare to compare the data in the two files.
Just a thought.
Awesome tool to have in your bag of tricks ...
http://www.scootersoftware.com/[^]
|
|
|
|
|
I need to choose the most appropriate data engine for an application, and can use some advice.
Background:
I am replacing an existing application, rewriting it from ground up using VS 2010, C# and .NET 4.0.
The prior app used Access style databases. Microsoft discourages this type of database for new apps, or I would continue with it.
Very few of our customers need or use database servers. Typically, a customer would maintain a collection of separate databases, one for each project. Databases only need to be accessed locally. The self contained single file approach of the Access database was ideal, since it is highly portable and easily archived or deleted after a project ends. The largest database I have ever seen reached 100 mb. Typical databases are less than 20 mb, many around 2-4 mb.
The data model is largely relational, and idealy suited to object modeling (without inherited classes).
I like the EF and Code First options in VS 2010, but it all seems to be focused on working with a single server based db. I need to be able to browse and open databases. In rare cases, a customer may even open more than one db at a time, using mdi children for each db. This is not an absolute requirement, but is highly desirable.
Any ideas or suggestions?
|
|
|
|
|
SqlCE would be appropriate; doesn't require a server and is meant as a local file-based db (just as Access). You can open as many as you want simultaneous, and consists of a single file with the ".sdf" file extension.
Without the need to have it all in a single file that can be copied/moved around, I'd go for Sql Server and merge all the databases.
Bastard Programmer from Hell
|
|
|
|
|
As well as SqlCE, there is SQLite[^], which is also a file based db system. I have used this in the exact same scenario which you have related. SQLite has a fully functional ADO.Net implementation[^], and can be embedded in the application if necessary, which means less install hassles. It is also open source, with the source code in the public domain.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
Hi Guys,
I have some C++ code that is working in Real-Time with a decoder. Its job is to Insert into SQL 2008 R2 and its currently using ADO 2.8 to do it.
However i dont want it to block while doing the Insert, because it holds up other packets arriving from the decoder. So i am trying to convert it to perform its calls Asynchronously so i can blindly Insert my packets which will be faster. Although depending on the speed, it is possible that i may need to Insert a 2nd packet before the 1st one had finished.
I have written some sample code in C# (ADO.NET) and proved that Async mode works, but i cannot get any sample code (ADO 2.8) to work in Async mode in C++ and it is driving me nuts!! I want to use the ExecuteComplete event but that does not fire either?
Please would somebody help me find out what the heck i need to do make some progress on making Async work?
Many many thanks,
Rich.
|
|
|
|
|