MSSQLServer Logging Many Missing Stored Procedure Messages
Jul 10, 2007
Hello, I am getting many of these messages in my server's event log (approximately 13 every 5 seconds or so). I have tried clearing the queue with "END CONVERSATION @ConvHandle WITH CLEANUP;" but the event log keeps getting messages. I have attached an example below.
Type: Information
Event Source: MSSQLSERVER
Event Category: (2)
Event ID: 9724
Date: 7/10/2007
Time: 3:52:37 PM
Description:
The activated proc [dbo].[SqlQueryNotificationStoredProcedure-32e779eb-edcb-44d1-ba30-93f46ef9d9f8] running on queue HoudiniPlatform.dbo.SqlQueryNotificationService-32e779eb-edcb-44d1-ba30-93f46ef9d9f8 output the following: 'Could not find stored procedure 'dbo.SqlQueryNotificationStoredProcedure-32e779eb-edcb-44d1-ba30-93f46ef9d9f8'.'
I installed SQL server 2005 on a win2003 server box.
When I open the Connect to Server dialog box, I choose server type: Database Engine. There is no Servername listed, so I put in the name of the PC.
I get a long error message when I try to connect:
Cannot connect to PCName.... ...error: 40 - Could not open a connection to SQL Server)...
When I try to go into the Surface area Configuration, I get this message: "No sql server 2005 components were found on the specified computer. Either no components are installed, or you are not an administrator on this computer. (SQLSAC)"
I am logged in as Administrator in the PC, so did I do something seriously wrong with the installation?
In the services window, I can not fine MSSQLserver (not sure if this is relevant).
I have a big stored procedure which is going to alter many tables,insert data, basically lot of changes.
So, i want to have a text file (or) any log file which will display, what all the changes does the stored procedure has done ( They dont want profiler output )
Can anybody know how to log the results of execution of stored procedure to a text file.
How can I avoid certain messages from SQL Server being recorded into the Event viewer ? For example, every time I truncate the transaction log with 'Backup log with truncate_only', It is being recorded into the Event viewer as an Error. But, I know that it is not an error. How can I avoid this ?
I'm looking for a facility similar to NT audit facility except for SQL Server 6.5.
Is there a tool or facility that will track when users log in (using SQL Server security), and either which stored procedures they execute or which tables they select?
I keep getting this error on one of my pages when trying to do an update to the table via a stored procedure: *System.Data.SqlClient.SqlException: Procedure or function 'sp_u_contractor_references' expects parameter '@p_contractorrfid', which was not supplied I have verified that I am adding this parameter and that the spelling is correct. I have also made sure that the value is not NULL. I'm confused as to what else the problem could be. Any ideas?
How can I get the messages sent by the server while I'm executing a stored procedure via the JDBC driver?
I need to get my own debug messages (done through the print() function) and also standard server messages (such as "x row(s) affected" or results from SET STATISTICS TIME ON). Is this possible?
'...we can attach an event handler to the package...and this one event handler will catch all events raised of that event type by every container in the package...'
Fine. Now what I want to do is catch all OnInformation events generated for the package, and disgard all apart from a subset, whose message contains a particular string. So the Q is, how do I/can I interrogate the message for the event that my handler has just caught?
Michael Coles has come up with a neat method of overriding sp_dts_addlogentry, (http://blogs.sqlservercentral.com/blogs/michael_coles/archive/2007/10/09/3012.aspx), but I want to do this within the package, not outside, to avoid the change becoming global to every package writing to the same sysdtslog90.
How can I copy the error messages when I execute a SSIS package?. The Progress tab or the Execution results tab both dont have the means to copy the results. I would like the errors to be output to a text file under a directory on my drive system (some thing like C:SSISExecResults.txt). Is this possible?. If so how do I configure my package to output the package execution results to a text file?.
I have a process that is running on the os. This process is picking up FTP files every 5 min, it renames them so not to confuse them with the new files, copies all renamed files into one file to be used by bulk insert, runs the bulk insert to populate a table, and then runs the stored procedure that scrubbing the data and insert it into another table. For every transaction that I do in my stored procedure, I do the error checking as follows:
IF @@error <> 0 BEGIN ROLLBACK TRANSACTION RETURN
If my stored procedure encounters an error, return statement will stop it from running. If this happens, I need to stop the process that is running on the os as well.
Questions:
How can that be accomplished?
How to restart the stored procedure ones the error has been corrected?
The ExecuteSQL task makes it easy to capture the resultset of a query or stored proc in a variable. But what about the messages that would normally appear in the Messages tab when running queries in Management Studio or Query Analyzer? There must be a way to display and log rowcounts and other messages that a query normally produces.
Various package/task logging configrations haven't helped. I've read discussions about logging rowcounts in data flow tasks, but what about capturing messages in ExecuteSQL and other control flow tasks that run T-SQL?
I only have enough time to dabble in this technology so I may be missing something obvious or approaching this incorrectly. Any suggestion, reference, constructive criticism or reponse would be appreciated.
I am writting a huge Service Broker Application. I notice that each message that is processed appears in the SQL Server Logs. Currently I am just testing with a single queue and tons of messages are showing up in the log. Is there a way that I can turn these informational messages off? I think in the end I may have something like 15 or 20 queues. These messages are very useful for debugging but I may not desire this extensive logging to be running all the time on all of my queues.
The log for our SQL 2000 database shows constant "starting up database dbname" entires. Is there a option that causes the databases to constantly be starting or is this a new feature of SQL 2000.
SQL Server 2000, VB.NET 1.1. Here's the dummy sp: CREATE PROCEDURE am_user.spTestCrap ( @maxFloodControl int, @int_memID int) ASset nocount onselect @maxFloodControl, @int_memIDreturn 62GO Here's some VB.NET code that does not work: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim strConn As String = "server=amdb1;UID=am_User;PWD=thepwd;DATABASE=thedb;pooling=true" Dim objConn As New SqlClient.SqlConnection(strConn) objConn.Open() Dim objComm As SqlClient.SqlCommand Dim nReturnedValue As Integer Dim memID As Integer 'This is a "root" level message objComm = New SqlClient.SqlCommand("am_User.spTestCrap", objConn) objComm.CommandType = CommandType.StoredProcedure objComm.Parameters.Add("@RETURN_VALUE", SqlDbType.Int) objComm.Parameters("@RETURN_VALUE").Direction = ParameterDirection.ReturnValue objComm.Parameters.Add("@maxFloodControl", CType(0, Integer)) objComm.Parameters.Add("@int_memID", memID) Try objComm.ExecuteNonQuery() If Not IsDBNull(objComm.Parameters("@RETURN_VALUE").Value) Then nReturnedValue = CType(objComm.Parameters("@RETURN_VALUE").Value, Integer) End If Catch MsgBox(Err.Description) End Try End Sub The error I get back in the message box is: "Procedure 'spTextCrap' expects parameter @maxFloodControl", which was not supplied." Why the BLEEP not? Didn't I supply it? What the BLEEP am I missing? TIA,
anyone know where the stored procedure wizard went in sql 2005? in 2000 it was so easy to check the type of SP you wanted and then it automatically wrote all the fields and value tsql for that - literally took 1 minute to create an insert update delete stored proc on any table. i don't see that in sql 2005 let me know, if you know. thanks - Jeff
I have installed Standard Sql 2000 . However i don't find the ex stored Procedures xp_sqlinventory and sp_sqlregister .. Can anyone Point out here i can get them?
I've got a field that might have spurious values in it (say, an admin adds a new row but doesn't have an entry for this field). I'm trying to swap in the string no_image_EN.jpg if the value in the db does NOT end in .jpg. That way, any value rreturned is either a valid filename or no_image I'm having trouble with the CASE statement, particularly testing just the last few cahracters of the string: select product_code, CASE can_image_en ?? When (can_image_en LIKE '%.jpg') then can_image_en Else 'no_image_EN.jpg' End as can_image_en, none of these do the trick either (some are bad syntax obviously): ? When (can_image_en LIKE '%.jpg') then can_image_en ? When LIKE '.jpg' then can_image_en ? When '%.jpg' then can_image_en ? When right(can_image_en,4) = '%.jpg' then can_image_en This is the one that has correct syntax, though it seems to return false in ALL cases CASE can_image_en When '%.jpg%' then can_image_en Else 'no_image_EN.jpg'
Used to work fine: (windows 200 server, sql server 2000, JDBC driver SP2.) Two java processes, one sending messages (using jdbc and sql as temp storage), second is receiving and placing on msmq.
After installing SP3a for SQL server, under high load (200 a sec) there are missing messages in msmq. Installed everything from scratch on separate machine, works fine until SP3a is applied. Any help is highly appreciated
I have recently started using replication in SQL 2012 SP1. When a stored procedure is altered on the source, the changes are replicated to the subscribers; however, the comment headers are removed at the subscribers. Due to the vast number of stored procedures I have, I do not want to move the comments below the Create Procedure statement. Are there any other ways to have comment header move with the stored procedures?
Here is what I am experiencing
Source SP
ALTER PROCEDURE [dbo].[SPTest] AS BEGIN SELECT GETDATE() END
Destination SP
ALTER PROCEDURE [dbo].[SPTest] AS BEGIN SELECT GETDATE() END
I'm in the process of trying to optimize a stored procedure with many queries. The execution plan provides a missing non-clustered index on nearly every query, and they're all fairly similar. The only real difference between them are what's in the INCLUDE statement. The two key columns are listed in every missing index. Let's say each query is approximately 5% of the total batch and 90% of the queries all fall into the category I listed above. How should I go about creating the missing indexes? Create all of the missing indexes or create one generic one that has all the INCLUDE columns? Create a minimal index with just a few of the common INCLUDE columns?
Here's an example of what I'm talking about with the missing indexes:
/* USE [DB] GO CREATE NONCLUSTERED INDEX [<Name of Missing Index, sysname,>] ON [dbo].[TABLE_1] ([COLUMN_A],[COLUMN_B]) INCLUDE ([C4ABCD],[C4ARTX],[C4ASTX],[C4ADNB],[C4AFNB],[C4BKVA]) GO */ /*
The Query Processor estimates that implementing the following index could improve the query cost by 99.9044%.
*/ /* USE [DB] GO CREATE NONCLUSTERED INDEX [<Name of Missing Index, sysname,>] ON [dbo].[TABLE_1] ([COLUMN_A],[COLUMN_B]) INCLUDE ([C4ARTX],[C4ASTX],[C4ADNB],[C4CZST]) GO */
/*
The Query Processor estimates that implementing the following index could improve the query cost by 99.5418%.
*/ /* USE [DB] GO CREATE NONCLUSTERED INDEX [<Name of Missing Index, sysname,>] ON [dbo].[TABLE_1] ([COLUMN_A],[COLUMN_B]) INCLUDE ([C4ABCD],[C4ARTX],[C4ASTX],[C4ADNB],[C4AFNB],[C4BKVA]) GO */
Is it possible to force a build to fail when a stored procedure in a project calls another stored procedure with one or more required parameters missing. E.g.:
I am using an extended stored procedure that sends email using SMTP. The procedure can be downloaded here (http://www.sqldev.net/xp/xpsmtp.htm). If I execute the procedure in QA and it fails for some reason, the error message is printed in the Messages tab. Is there any way to capture this message/messages when I use the XP in my stored procedures?
We have a database that has over a 1000 stored procedures. Most of them are used but not all of them. Because it would take to much time to investigate which are used or not, I want to log each execution of a stored procedure for a month. This way I can see which procedures are used and which are not.
Is there a way to do this???
I thought of using a DML trigger that fires after an 'exec' statement but it seems that it can be only triggered after a create, alter or drop statement.
Not sure if this has been asked but quite honestly, I have tried several searches and too many hits are returned.
I use 3 separate stored procs for a process in a .net program where sp1 inserts the header. Then, looping through the details, I use sp2 to insert the detail records and then for each detail, I loop through other sub-records and insert with sp3.
I would like to place the whole update within a transaction so that an error on sp3 will rollback the entire thing.
My Problem: Each of sp1, 2 and 3 call another stored proc, say spLog which logs the process and the error messages. When I roll back, how can I prevent my logs from rolling back?
Hi im finalizing a site for a custmer and now adding a Tell a friend function. I have done those before but not when storing the mailmessage in the SQL server and my question is How do I build this up in a good way...I have done the mailsender and its sends the email but how do I bind it together... I have two columns comming in a single row dataset from the Database: MailSubjectMailBody I dont want to bind it to a gridview or another control and then fetch that to my mail message Public Function TellaFriend(ByVal strEmail As String, ByVal strMyName As String, ByVal cultureid As Integer) As String 'Tell a friend Dim Data As DAL Data = New DAL Dim dsEmail As DataSet = Data.GetEmailMessage(1, cultureid) MyMailMessage.From = New MailAddress(info@company.com, "Customer Service") MyMailMessage.To.Add(New MailAddress(strEmail, "Hint from a friend" & strMyName)) MyMailMessage.Subject = dsEmail("MailSubject") MyMailMessage.IsBodyHtml = False MyMailMessage.Body = dsEmail("MailBody") 'Create the SMTPClient object and DO NOT specify the SMTP server name Dim SMTPServer As New SmtpClient() Dim MailSent As String Try SMTPServer.Send(MyMailMessage) MailSent = "True" Catch ex As SmtpException MailSent = "False" End Try Return MailSentEnd Function Of course this doesnt work but what do I need to do to bind Data.GetEmailMessage(1, cultureid) without using a gridview or any other datapresentation control directly in this function? If you need it this is from my DALFunction GetEmailMessage(ByVal intMessageId As Integer, ByVal intCultureId As Integer) As DataSet Dim DS As DataSetDim objConn As SqlConnectionDim objCmd As SqlDataAdapter objConn = New SqlConnection(_connStr)objCmd = New SqlDataAdapter("sp_GetEmailMessage", objConn)objCmd.SelectCommand.CommandType = CommandType.StoredProcedureobjCmd.SelectCommand.Parameters.Add(New SqlParameter("@messageid", SqlDbType.Int))objCmd.SelectCommand.Parameters("@messageid").Value = intMessageIdobjCmd.SelectCommand.Parameters.Add(New SqlParameter("@cultureid", SqlDbType.Int))objCmd.SelectCommand.Parameters("@cultureid").Value = intCultureIdDS = New DataSet()objCmd.Fill(DS, "dsMailMessage")Return DSEnd FunctionThanks,
Hello,I was wondering if there were any built-in objects to handle error handling, in any of the SQL Server objects, or just to use event log or trace or debug or something like that. Or is it not recommended at all to use try.. catch, for whatever reason.Thanks a lot.
We use SQL Server 2005 and we use lots of stored procedures. Each time a stored procedure run we log the name, execution time and username so we can identify trends and long-running procedures. I would like to add the actual CPU and IO cost of execution to this log. Is there a way to get it? This type of information is viewable in SQL Server's performance tools - so there must be some way to get it. Can someone point me in the right direction please?
I got the following error messages: Msg 111, Level 15, State 1, Procedure sp_getRecords, Line 8 'CREATE/ALTER PROCEDURE' must be the first statement in a query batch. Msg 156, Level 15, State 1, Procedure sp_getRecords, Line 10 Incorrect syntax near the keyword 'PROC'. Msg 156, Level 15, State 1, Procedure sp_getRecords, Line 11 Incorrect syntax near the keyword 'PROC'. Msg 102, Level 15, State 1, Procedure sp_getRecords, Line 14 Incorrect syntax near 'EXE'. Msg 102, Level 15, State 1, Procedure sp_getRecords, Line 20 Incorrect syntax near 'updateRecord'. ///////////////////////////////////////////////////////////////////////////////////////////////////// Please help, tell me what is wrong in my execution of the code and advise me how I can correct this problem. Thanks, Scott Chang
I got the following T-SQL error messages: Msg 111, Level 15, State 1, Procedure sp_getRecords, Line 8 'CREATE/ALTER PROCEDURE' must be the first statement in a query batch. Msg 156, Level 15, State 1, Procedure sp_getRecords, Line 10 Incorrect syntax near the keyword 'PROC'. Msg 156, Level 15, State 1, Procedure sp_getRecords, Line 11 Incorrect syntax near the keyword 'PROC'. Msg 102, Level 15, State 1, Procedure sp_getRecords, Line 14 Incorrect syntax near 'EXE'. Msg 102, Level 15, State 1, Procedure sp_getRecords, Line 20 Incorrect syntax near 'updateRecord'. ///////////////////////////////////////////////////////////////////////////////////////////////////// Please help, tell me what is wrong in my execution of the code and advise me how I can correct this problem. Thanks, Scott Chang
I got the following error messages: Msg 111, Level 15, State 1, Procedure sp_getRecords, Line 8 'CREATE/ALTER PROCEDURE' must be the first statement in a query batch. Msg 156, Level 15, State 1, Procedure sp_getRecords, Line 10 Incorrect syntax near the keyword 'PROC'. Msg 156, Level 15, State 1, Procedure sp_getRecords, Line 11 Incorrect syntax near the keyword 'PROC'. Msg 102, Level 15, State 1, Procedure sp_getRecords, Line 14 Incorrect syntax near 'EXE'. Msg 102, Level 15, State 1, Procedure sp_getRecords, Line 20 Incorrect syntax near 'updateRecord'. ///////////////////////////////////////////////////////////////////////////////////////////////////// Please help, tell me what is wrong in my execution of the code and advise me how I can correct this problem. Thanks, Scott Chang