SQL Server Service Broker Updating Stored procedure

how can you update the service broker stored procedure. when i update the stored procedure the changes dont come into affect. i have tried to alter the queue, waited for all jobs to finish, but some how still the old stored procedure is running. is there any
way i can force changes to the stored procedure.
i have tried sql profiler tracing but that didnt show any changes.
I cannot alter the service broker stored procedure, when I update the stored procedure it does not show any error and successfully gets updated but the changes does not come into affect.
Is it because I need to stop the queue of the service broker on both databases before the changes could come into affect?
Note: the service broker stored procedures produce and read xmls.

Presumably, this is because the procedure is executing when you alter the procedure. And if the procedure never exits, the old code will keep on running. One way to address this is to have the procedure to return if a new message has not been picked up in,
say, 1000 milliseconds.
Here is a repro to shows what I'm talking about.
------------------------------- Service Broker Objects ------------------------------------------
CREATE MESSAGE TYPE OrderRequest VALIDATION = NONE
CREATE MESSAGE TYPE OrderResponse VALIDATION = NONE
go
CREATE CONTRACT OrderContract
   (OrderRequest SENT BY INITIATOR,
    OrderResponse SENT BY TARGET)
go
CREATE QUEUE OrderRequests WITH STATUS = OFF
CREATE QUEUE OrderResponses WITH STATUS = ON
go
CREATE SERVICE OrderRequests ON QUEUE OrderRequests (OrderContract)
CREATE SERVICE OrderResponses ON QUEUE OrderResponses (OrderContract)
go
-- Procedure to send a message and receive a response.
CREATE PROCEDURE send_and_get_answer AS
DECLARE @handle uniqueidentifier,
         @binary varbinary(MAX)
      SELECT @binary = CAST (N'Kilroy was here' AS varbinary(MAX))
      BEGIN DIALOG CONVERSATION @handle
      FROM  SERVICE OrderResponses
      TO    SERVICE 'OrderRequests'
      ON    CONTRACT OrderContract
      WITH ENCRYPTION = OFF
      ;SEND ON CONVERSATION @handle
      MESSAGE TYPE OrderRequest (@binary)
   WAITFOR (RECEIVE TOP (1)
                     @handle = conversation_handle,
                     @binary = message_body
            FROM    OrderResponses)
   SELECT cast(@binary AS nvarchar(MAX)) AS response
   END CONVERSATION @handle
go
-- Procedure to process a message
CREATE PROCEDURE ProcessOrders AS
SET NOCOUNT, XACT_ABORT ON
DECLARE @DialogHandle  uniqueidentifier,
        @MessageType   sysname,
        @binarydata    varbinary(MAX)
-- Get next message of the queue.
WAITFOR (
   RECEIVE TOP (1) @DialogHandle = conversation_handle,
                     @MessageType  = message_type_name,
                     @binarydata   = message_body
   FROM    OrderRequests
SELECT @binarydata = CAST( reverse( CAST( @binarydata AS nvarchar(MAX) )) AS varbinary(MAX))
; SEND ON CONVERSATION @DialogHandle
MESSAGE TYPE OrderResponse (@binarydata)
END CONVERSATION @DialogHandle
go       
-- Make this an activaton procedure.
ALTER QUEUE OrderRequests WITH
      STATUS = ON,
      ACTIVATION (STATUS = ON,
                  PROCEDURE_NAME = ProcessOrders,
                  MAX_QUEUE_READERS = 1,
                  EXECUTE AS OWNER)
go
-------------------------------- Send a message  -------------------------------------------
EXEC send_and_get_answer
go
------------------------ Change the procedure --------------------------------
ALTER PROCEDURE ProcessOrders AS
SET NOCOUNT, XACT_ABORT ON
DECLARE @DialogHandle  uniqueidentifier,
        @MessageType   sysname,
        @binarydata    varbinary(MAX)
-- Get next message of the queue.
WAITFOR (
   RECEIVE TOP (1) @DialogHandle = conversation_handle,
                     @MessageType  = message_type_name,
                     @binarydata   = message_body
   FROM    OrderRequests
SELECT @binarydata = CAST( upper( CAST( @binarydata AS nvarchar(MAX) )) AS varbinary(MAX))
; SEND ON CONVERSATION @DialogHandle
MESSAGE TYPE OrderResponse (@binarydata)
END CONVERSATION @DialogHandle
go
-------------------------------- Send new message -------------------------------------------
EXEC send_and_get_answer    -- Still produces a message in reverse.
EXEC send_and_get_answer    -- Now we get the expected result.
go
DROP SERVICE OrderRequests
DROP SERVICE OrderResponses
DROP QUEUE OrderRequests
DROP QUEUE OrderResponses
DROP PROCEDURE ProcessOrders
DROP PROCEDURE send_and_get_answer
DROP CONTRACT OrderContract
DROP MESSAGE TYPE OrderRequest
DROP MESSAGE TYPE OrderResponse
go
Erland Sommarskog, SQL Server MVP, [email protected]

Similar Messages

  • Monitor SQL Server service Broker queue status

    I need to monitor SQL Server service Broker queue status.  If the queue is disabled, send me an email alert.
    Can you let me know what's the best way to accomplish it using SCOM?

    1) create a queue for notification
    2) create a service on notification queue
    3)Create an event notification for broker queue disable. Associate this with the queue that you are monitoring.
    4)Create a procedure that send you and email with this event happens
    Example:
    ---- Notification
    CREATE
    QUEUENotify_queue
    -- Service
    CREATE
    SERVICE[http://queue_Notify]
    ONQUEUENotify_queue([http://schemas.microsoft.com/SQL/Notifications/PostEventNotification]);
    --Event 
    CREATE
    EVENTNOTIFICATION[http://queue_Notify_event]
    ONQUEUETarget_queue
    FORBROKER_QUEUE_DISABLED
    TOSERVICE'http://queue_Notify','current
    database';
    GO
    procedure will be something like...
    WAITFOR
    RECEIVETOP(1)
    @RecvReqMsgName=message_type_name,
    @RecvReplyMsg=message_body,
    @RecvReplyDlgHandle=conversation_handle
    FROMNotify_queue),TIMEOUT5000
    IF(@RecvReqMsgName='http://schemas.microsoft.com/SQL/Notifications/EventNotification')
    BEGIN
    DECLARE@cmdNVARCHAR(MAX)
    SET@cmd='dbo.sp_send_dbmail
    @profile_name="Name XYZ",
    @recipients="[email protected]",
    @body="CAST(@RecvReplyMsg as NVARCHAR(MAX)",
    @subject="Queue Disabled Detected";'
    EXEC
    (@cmd)
    END

  • Alert: SQL Server Service Broker or Database Mirroring Transport stopped

    Hi Team,
    I got this error message even no one DB configured as mirroring ???
    Alert: SQL Server Service Broker or Database Mirroring Transport stopped Priority: 0 Severity: 2 Resolution state: New
    Alert description: The Database Mirroring protocol transport has stopped listening for connections.

    Can you check the rule. By default the configurations are disabled state that is the reason you are getting the alert.
    If it's not configured properly then you might need to override it
    --Prashanth

  • [Microsoft][ODBC SQL Server Driver][SQL Server]Could not find stored procedure 'dbo.sp_SPNAMEHERE'.

    OK, something seemed to have changed with my system because this error is NEW. It might be related to my system upgrade from Vista to Win7, but just guessing here.
    I run a database on a corporate MS Sql Server (2005) and an ASP application that connects via ODBC. The real world application works fine, however when I attempt to access Stored Procedures from Dreamweaver (on my development machine)  I am getting the following error:
    [Microsoft][ODBC SQL Server Driver][SQL Server]Could not find stored procedure 'dbo.sp_SPNAMEHERE'.
    This only seems to happen on Stored procedures that RETURN a recordset.
    system:
    Win7
    Dreamweaver CS4
    Code: VBScript/Classic ASP
    SQL Server 2005
    Connecting via ODBC: MM_MY_STRING = "Driver={SQL Server};Server=wscxxxxxxxxx;Database=dbsystem;Uid=username;Pwd=XXXXXXXXXXXX"
    Stored procedures that do not return a recordset are not an issue.... this has put my development work at a standstill!!
    Thanks in advance!

    Well, I hate bumps, but I am really running out of solutions. I have now tried to use a system DSN on my development machine and that didnt solve the problem. I just un-installed DW and re-installed it and that didnt solve my problem either.
    This is very frustrating, because I cannot use any stored procs that return recordsets... I am stuck... can anybody think of a relatively easy work-around to working in DW w/ recordsets that come from SPs when you cant actually access them?
    The really weird thing is, when I build the command, and choose the stored proc, and give it valid input variables, and TEST it from the TEST button, everything works and data is returned as expected. Once I click "OK" and actually add it to the ASP page the recordset that should be visible isnt... and when I click the plus sign in the bindings window I get the error...
    Help!!

  • SQL server service broker

    Hi All,
    I have requirement to implement SQL server service broker in SQL server 2008, please guide me for that, how and why we use for that, then have any other option to achieve. 
    Please give any good stuff to learn service broker.
    Thanks,
    Jai.

    This is a very good book to learn about Service Broker:
    http://www.amazon.com/Rational-Server-Service-Broker-Guides/dp/1932577270/ref=sr_1_1?ie=UTF8&qid=1418942042&sr=8-1&keywords=%22roger+wolter%22+%22service+broker%22&pebp=1418942044114
    In difference from many other computer books, this is not a brick, but only 220 pages.
    Also, Remus Rusanu's blog covers many important concepts with Service Broker:
    http://rusanu.com/?s=service+broker
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Trying to report bug in SQL Server Replication with sp_MSdetect_nonlogged_shutdown stored procedure

    I've just tried to "Submit Feedback" but the page just gives me an error which means nothing to anyone which says "You are not authorized to submit the feedback for this connection.". Why am I not authorised how do I become authorised etc
    etc. Anyway :-)
    I've trying to report that the stored procedure in Sql Server Replication in 12.0.2000 has an issue with data type lengths. This procedure sp_MSdetect_nonlogged_shutdown uses data lengths of nvarchar(2048) but the MSDB sysjobhistory table has a message field
    length of 4000. Which causes the above stored procedure to crash.
    Best Regards
    Richard

    This is the work around
    1. Stop SQL Server service.
    2. On command prompt run the following command to run the server in single user mode – be sure to replace the MSSQLSERVER with the actual instance name
    C:\>”C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\sqlservr.exe” -sMSSQLSERVER -m
    3. Connect to SQL server with SSMS as the server administrator
    4. Run the following to change the database to the system resource database: “USE mssqlsystemresource”
    5. Run the following to update the stored procedure (only change is to make NVARCHAR(4000))
    SET ANSI_NULLS OFF
    GO
    SET QUOTED_IDENTIFIER OFF
    GO
    ALTER procedure [sys].[sp_MSdetect_nonlogged_shutdown]
        @subsystem nvarchar(60),
        @agent_id int
    as
    begin
        declare @job_id binary(16)
        declare @agent_name sysname
        declare @message nvarchar(4000)
        declare @retcode int
        declare @runstatus int
        declare @run_date int
        declare @run_time int
        declare @run_date_orig int
        declare @run_time_orig int
        declare @merge_session_id int
        -- security check
        -- only db_owner can execute this
        if (is_member ('db_owner') != 1) 
        begin
            raiserror(14260, 16, -1)
            return (1)
        end
        -- Detect if the agent was shutdown without a logged reason
        if UPPER(@subsystem collate SQL_Latin1_General_CP1_CS_AS) = 'SNAPSHOT'
        begin
            if exists (select runstatus from MSsnapshot_history where 
                agent_id = @agent_id and
                runstatus <> 2 and 
    --CAC       runstatus <> 5 and 
                runstatus <> 6 and
                timestamp = (select max(timestamp) from MSsnapshot_history where agent_id = @agent_id))
                begin
                    select @job_id = job_id, @agent_name = name from MSsnapshot_agents where id = @agent_id
                end
        end
        else if UPPER(@subsystem collate SQL_Latin1_General_CP1_CS_AS) = 'LOGREADER'
        begin
            if exists (select runstatus from MSlogreader_history where 
                agent_id = @agent_id and
                runstatus <> 2 and 
    --CAC           runstatus <> 5 and 
                runstatus <> 6 and
                timestamp = (select max(timestamp) from MSlogreader_history where agent_id = @agent_id))
                begin
                    select @job_id = job_id, @agent_name = name from MSlogreader_agents where id = @agent_id
                end
        end
        else if UPPER(@subsystem collate SQL_Latin1_General_CP1_CS_AS) = 'DISTRIBUTION'
        begin
            if exists (select runstatus from MSdistribution_history where 
                agent_id = @agent_id and
                runstatus <> 2 and 
    --CAC           runstatus <> 5 and 
                runstatus <> 6 and
                timestamp = (select max(timestamp) from MSdistribution_history where agent_id = @agent_id))
                begin
                    select @job_id = job_id, @agent_name = name from MSdistribution_agents where id = @agent_id
                end
        end
        else if UPPER(@subsystem collate SQL_Latin1_General_CP1_CS_AS) = 'MERGE'
        begin
            if exists (select runstatus from dbo.MSmerge_sessions where 
                agent_id = @agent_id and
                runstatus <> 2 and 
    --CAC           runstatus <> 5 and 
                runstatus <> 6 and
                session_id = (select top 1 session_id from dbo.MSmerge_sessions where agent_id = @agent_id order by session_id desc))
                begin
                    select @job_id = job_id, @agent_name = name from dbo.MSmerge_agents where id = @agent_id
                    select top 1 @merge_session_id = session_id from dbo.MSmerge_sessions 
    where agent_id = @agent_id 
    order by session_id desc
                end
        end
        else if UPPER(@subsystem collate SQL_Latin1_General_CP1_CS_AS) = 'QUEUEREADER'
        begin
            if exists (select runstatus from MSqreader_history where 
                agent_id = @agent_id and
                runstatus <> 2 and 
    --CAC       runstatus <> 5 and 
                runstatus <> 6 and
                timestamp = (select max(timestamp) from MSqreader_history where agent_id = @agent_id))
                begin
                    select @job_id = job_id, @agent_name = name from MSqreader_agents where id = @agent_id
                end
        end
        -- If no job_id assume shutdown was logged properly
        if @job_id is null
            return 0
        -- Get last message from SQL Agent History table
        create table #JobHistory (
            instance_id int NOT NULL, 
            job_id uniqueidentifier NOT NULL,
            job_name sysname NOT NULL,
            step_id int NOT NULL,
            step_name nvarchar(100) NOT NULL, 
            sql_message_id int NOT NULL,
            sql_severity int NOT NULL,
            message nvarchar(4000) NOT NULL,
            run_status int NOT NULL,
            run_date int NOT NULL,
            run_time int NOT NULL,
            run_duration int NOT NULL,
            operator_emailed sysname NULL,
            operator_netsent sysname NULL,
            operator_paged sysname NULL,
            retries_attempted int NOT NULL,
            server sysname NOT NULL
        if @@error <> 0
            return 1
        -- Insert last history for step_id 2 (Agent running)
        insert TOP(2) into #JobHistory exec sys.sp_MSreplhelp_jobhistory @job_id = @job_id, @step_id = 2, 
            @mode = 'FULL'          
    declare cursorHistory cursor local fast_forward for
        select message, 
        run_status,
        run_date,
        run_time
        from #JobHistory
        order by run_date desc, 
        run_time desc, 
        instance_id asc
        open cursorHistory
        fetch cursorHistory into @message, @runstatus, @run_date, @run_time
        select @run_date_orig = @run_date, 
      @run_time_orig = @run_time
        while @@fetch_status <> -1
        begin   
        -- as long as we are looking at the history for the same run 
        -- date and time then we should log all rows. there should 
        -- be 2 rows since we perform a TOP on exec sp_help_jobhistory
    if @run_date_orig = @run_date
      and @run_time_orig = @run_time
    begin
       -- Map SQL Agent runstatus to Replication runstatus
       set @runstatus = 
       case @runstatus
           when 0 then 6   -- Fail mapping
           when 1 then 2   -- Success mapping
           when 2 then 5   -- Retry mapping
           when 3 then 2   -- Shutdown mapping
           when 4 then 3   -- Inprogress mapping
           when 5 then 0   -- Unknown is mapped to never run
       end
       -- If no message, provide a default message
    -- Also overwrite all inprogress messages to be "See SQL Agent history log".
    -- This is to prevent "Agent running. See monitor" to be logged into repl monitor.
    -- In this case (the last job history message is InProgress), we know that
    -- there have been failures of SQL Server Agent history logging.
    -- In fact, the only possible "in progress" msg in SQL Agent job step
    -- history for push jobs is "Agent running. See monitor". It is confusing that those
    -- messages showed up in repl monitor.
       if @message is null or @runstatus = 3
       begin
           raiserror(20557, 10, -1, @agent_name)
           select @message = formatmessage(20557, @agent_name)
       end
       if UPPER(@subsystem collate SQL_Latin1_General_CP1_CS_AS) = 'SNAPSHOT'
           exec @retcode = sys.sp_MSadd_snapshot_history @agent_id = @agent_id, @runstatus = @runstatus,
                   @comments = @message
       else if UPPER(@subsystem collate SQL_Latin1_General_CP1_CS_AS) = 'LOGREADER'
           exec @retcode = sys.sp_MSadd_logreader_history @agent_id = @agent_id, @runstatus = @runstatus,
                   @comments = @message
       else if UPPER(@subsystem collate SQL_Latin1_General_CP1_CS_AS) = 'DISTRIBUTION'
           exec @retcode = sys.sp_MSadd_distribution_history @agent_id = @agent_id, @runstatus = @runstatus,
                   @comments = @message
       else if UPPER(@subsystem collate SQL_Latin1_General_CP1_CS_AS) = 'MERGE'
    exec @retcode = sys.sp_MSadd_merge_history @agent_id = @agent_id, @runstatus = @runstatus,
                   @comments = @message, @called_by_nonlogged_shutdown_detection_agent = 1, @session_id_override = @merge_session_id
       else if UPPER(@subsystem collate SQL_Latin1_General_CP1_CS_AS) = 'QUEUEREADER'
           exec @retcode = sys.sp_MSadd_qreader_history @agent_id = @agent_id, @runstatus = @runstatus,
                   @comments = @message
       if @@error <> 0 or @retcode <> 0
           return 1
    end
    fetch cursorHistory into @message, @runstatus, @run_date, @run_time
    end
    close cursorHistory
    deallocate cursorHistory
        drop table #JobHistory
    end
    6. Return the system resource database to read-only – “alter database mssqlsystemresource set read_only”
    7. Shutdown the instance – “shutdown”
    8. Start the instance using the service as usual

  • How to stop SQL Server Agent Job if Stored Procedure returns value 0

    I have SQL Server 2012 SSIS.
    I have 2 SSIS packages.
    I have created SQL Server Agent Job for running packages.
    I have created steps. If first step have run succesfully next step is run.
    I have need to add new logic.
    I have validation stored procedure, which validate DB table values and returns 1 or 0.
    I would like to create logic where first of all this SP is runned. Return value of SP determines if steps are run or not.
    I was thinking to use Execute SQL Task for running SP.
    If value 1 is returned, then run rest of Tasks is run.
    If value 0 is returned, what should I do so that Job is stopped? I need assistance! 
    I want current step to stop never moved to next step.
    Is there any SSIS tasks, which can stop the Job?
    Or should I make Step for running validation SP?
    How to do so that if value 0 is returned stop Job.
    Kenny_I

    Please refer the below link:
    http://technet.microsoft.com/en-us/library/aa260308(v=sql.80).aspx
    Please read Remarks carefully!!!
    Remarks
    If a job is currently executing a step of type CmdExec, the process being run (for example, MyProgram.exe) is forced to end prematurely. Premature ending can result in unpredictable behavior such as files in use by the process being held open. Consequently,
    sp_stop_job should be used only in extreme circumstances if the job contains steps of type CmdExec.
    Permissions
    Execute permissions default to the public role in the
    msdb database. A user who can execute this procedure and is a member of the
    sysadmin fixed role can stop any job. A user who is not a member of the
    sysadmin role can use sp_stop_job to stop only the jobs he/she owns.
    When sp_stop_job is invoked by a user who is a member of the
    sysadmin fixed server role, sp_stop_job will be executed under the security context in which the SQL Server service is running. When the user is not a member of the
    sysadmin group, sp_stop_job will impersonate the SQL Server Agent proxy account, which is specified using
    xp_sqlagent_proxy_account. If the proxy account is not available,
    sp_stop_job will fail. This is only true for Microsoft® Windows® NT 4.0 and Windows 2000. On Windows 9.x, there is no impersonation and
    sp_stop_job is always executed under the security context of the Windows 9.x user who started SQL Server.

  • Permissions needed for sql server job to execute stored procedure on linked server?

    Hi all
    I have a job step which attempts to call a stored procedure on a linked server.
    This step is failing with a permission denied error. How can I debug or resolve this?
    The job owner is sysadmin on both servers so should have execute permission to the database/proc I'm calling, right?
    The error is:
    The EXECUTE permission was denied on the object 'myProc', database 'myDatabase', schema 'dbo'. [SQLSTATE 42000] (Error 229).  The step failed.
    My code is:
    EXEC [LinkedServer].myDatabase.dbo.myProc
    Also tried:
    SELECT * FROM OPENQUERY([LinkedServer], 'SET FMTONLY OFF EXEC myDatabase.dbo.myProc')
    With the same result.
    Any help appreciated.

    The job owner may be sysadmin on the remote server. The service account for SQL Server Agent may not. And it is the latter that counts, since the it the service accounts that logs in and impersonates the job owner. But the impersonation inside SQL Server
    does not count much in Windows, and it is through Windows connection is made to the other site.
    One way to resolve this is to set up a login mapping for the job owner. The login mapping must be for an SQL login on the remote server.
    You can verify the theory, but running this query from the job:
       SELECT * FROM OPENQUERY([LinkedServer], 'SELECT SYSTEM_USER')
    By the way, putting SET FMTONLY OFF in OPENQUERY is a terrible idea. This has the effect that the procedure is executed twice. (Unless both servers are SQL 2012 or higher in which case FMTONLY has no effect at all.)
    Erland Sommarskog, SQL Server MVP, [email protected]

  • SQL Server connection in Java Stored Procedures

    Is it possible to establish a connection to microsoft sql server through java stored procedures. When I try to create a connetion to SQL Server I am getting the following exception in trace file
    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
    at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
    at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
    at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
    at com.microsoft.jdbc.sqlserver.tds.TDSConnection.<init>(Unknown Source)
    at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown Source)
    at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown Source)
    at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)
    at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
    at java.sql.DriverManager.getConnection(DriverManager.java)
    at java.sql.DriverManager.getConnection(DriverManager.java)
    The connection details are correct and I am able to connect when I run the java code externally. Thanks in advance for the help

    Can you connect to the MSSQL database from inside Oracle in (say) a SQL*Plus or SQL Developer session?
    In other words, is the problem in the Java or the database linkages? Are you using Heterogeneous Services or Transparent Gateways?
    Cheers, APC
    blog: http://radiofreetooting.blogspot.com

  • Bug? SQL server 7 - Oracle 8i stored procedures

    I'm having a problem converting some SQL 7 stored procedures to Oracle using MW. The cursor definition appears to be garbage in some cases. See example as follows:
    *********** SQL 7 stored procedure *********
    CREATE PROCEDURE CLCClaim
    /* Procedure: CLCClaim */
    /* Description: Cascading delete to child tables */
    /* Table: CLClaim */
    /* Generated: 4/23/01 2:31:21 PM */
    @AuditUserId int,
    @AuditLctn varchar(20),
    @ClaimId int
    AS
    DECLARE
    @Trncnt int,
    @ErrorNumber int,
    @Id int,
    @Rows int,
    @ClsnId int
    SELECT @ErrorNumber = -1
    /* Save transaction count value */
    SELECT @Trncnt = @@TRANCOUNT
    /* Issue begin transaction if not already in a transaction */
    If @Trncnt = 0
    BEGIN TRANSACTION T1
    /* Build a cursor for finding child CLClaimAtchm rows */
    DECLARE CLClaimAtchmCursor Cursor For
    SELECT ClaimAtchmId, ClsnId
    FROM dbo.CLClaimAtchm
    WHERE ClaimId = @ClaimId
    /* Open the cursor */
    OPEN CLClaimAtchmCursor
    SELECT @ErrorNumber = @@ERROR
    If @ErrorNumber <> 0 GoTo ErrorHandler
    FETCH Next
    FROM CLClaimAtchmCursor
    INTO @Id, @ClsnId
    ... more follows, but this is the gist of it
    **** Oracle Procedure created by MW
    CREATE OR REPLACE PROCEDURE CLCClaim(
    AuditUserId NUMBER ,
    AuditLctn VARCHAR2 ,
    ClaimId NUMBER )
    AS
    StoO_selcnt INTEGER;
    StoO_error INTEGER;
    StoO_rowcnt INTEGER;
    StoO_crowcnt INTEGER := 0;
    StoO_fetchstatus INTEGER := 0;
    StoO_errmsg VARCHAR2(255);
    StoO_sqlstatus INTEGER;
    Trncnt NUMBER(10,0);
    ErrorNumber NUMBER(10,0);
    Id NUMBER(10,0);
    Rows_ NUMBER(10,0);
    ClsnId NUMBER(10,0);
    CURSOR CLClaimAtchmCursor IS SELECT omwb_emulation.globalPkg.trancount
    FROM CLClaimAtchm
    WHERE ClaimId = CLCClaim.ClaimId;
    CURSOR CLClaimDiagCursor IS SELECT StoO_error
    FROM CLClaimDiag
    WHERE ClaimId = CLCClaim.ClaimId;
    CURSOR CLClaimAdjdCursor IS SELECT StoO_error
    FROM CLClaimAdjd
    WHERE ClaimId = CLCClaim.ClaimId;
    CURSOR CLSvcLineCursor IS SELECT StoO_error
    FROM CLSvcLine
    WHERE ClaimId = CLCClaim.ClaimId;
    /* Procedure: CLCClaim */
    /* Description: Cascading delete to child tables */
    /* Table: CLClaim */
    /* Generated: 4/23/01 2:31:21 PM */
    /* Save transaction count value */
    BEGIN
    CLCClaim.ErrorNumber := -1;
    /* Issue begin transaction if not already in a transaction */
    CLCClaim.Trncnt := omwb_emulation.globalPkg.trancount;
    IF CLCClaim.Trncnt = 0 THEN
    /* Build a cursor for finding child CLClaimAtchm rows */
    /* Emulating @@TRANCOUNT functionality in Oracle model */
    omwb_emulation.globalPkg.trancount:=omwb_emulation.globalPkg.trancount+1;
    SAVEPOINT T1;
    END IF;
    NULL;/*DECLARE CURSOR CLClaimAtchmCursor */
    /* Open the cursor */
    BEGIN
    StoO_error := 0;
    StoO_rowcnt := 0;
    StoO_crowcnt := 0;
    OPEN CLClaimAtchmCursor;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    NULL;
    WHEN OTHERS THEN
    StoO_error := SQLCODE;
    StoO_errmsg := SQLERRM;
    END;
    CLCClaim.ErrorNumber := StoO_error;
    IF CLCClaim.ErrorNumber <> 0 THEN
    GOTO ErrorHandler;
    END IF;
    BEGIN
    StoO_error := 0;
    StoO_rowcnt := 0;
    StoO_crowcnt := 0;
    FETCH CLClaimAtchmCursor INTO CLCClaim.Id, CLCClaim.ClsnId;
    EXCEPTION
    WHEN OTHERS THEN
    StoO_rowcnt := 0;
    StoO_selcnt := 0;
    StoO_error := SQLCODE;
    StoO_errmsg := SQLERRM;
    END;
    ...more follows, but the error is in the SELECT clause of the CURSOR declaration
    I'm having to manually fix the CURSOR declarations for these converted procedures.
    Is there a fix or workaround to prevent me from growing my collection of gray hairs?
    Thanks,
    Billy Smith

    William,
    I did a quick check on our latest code and got the following output:
    CREATE OR REPLACE PROCEDURE CLCClaim(
    AuditUserId INTEGER DEFAULT NULL,
    AuditLctn VARCHAR2 DEFAULT NULL,
    ClaimId INTEGER DEFAULT NULL)
    AS
    StoO_selcnt INTEGER;
    StoO_error INTEGER;
    StoO_rowcnt INTEGER;
    StoO_crowcnt INTEGER := 0;
    StoO_fetchstatus INTEGER := 0;
    StoO_errmsg VARCHAR2(255);
    StoO_sqlstatus INTEGER;
    Trncnt INTEGER;
    ErrorNumber INTEGER;
    Id INTEGER;
    Rows INTEGER;
    ClsnId INTEGER;
    CURSOR CLClaimAtchmCursor IS
    SELECT ClaimAtchmId, ClsnId
    FROM /*standalone*/sa.CLClaimAtchm
    WHERE ClaimId = CLCClaim.ClaimId;
    /* Procedure: CLCClaim */
    /* Description: Cascading delete to child tables */
    /* Table: CLClaim */
    /* Generated: 4/23/01 2:31:21 PM */
    /* Save transaction count value */
    BEGIN
    CLCClaim.ErrorNumber := -1;
    /*[SPCONV-ERR(26)]:('@TRANCOUNT') Global Variable treated as variable*/
    /* Issue begin transaction if not already in a transaction */
    CLCClaim.Trncnt := CLCClaim.TRANCOUNT;
    IF CLCClaim.Trncnt = 0 THEN
    /* Build a cursor for finding child CLClaimAtchm rows */
    SAVEPOINT T1;
    END IF;
    NULL;/*DECLARE CURSOR CLClaimAtchmCursor */
    /* Open the cursor */
    BEGIN
    StoO_error := 0;
    StoO_rowcnt := 0;
    StoO_crowcnt := 0;
    OPEN CLClaimAtchmCursor;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    NULL;
    WHEN OTHERS THEN
    StoO_error := SQLCODE;
    StoO_errmsg := SQLERRM;
    END;
    CLCClaim.ErrorNumber := StoO_error;
    IF CLCClaim.ErrorNumber <> 0 THEN
    GOTO ErrorHandler;
    END IF;
    BEGIN
    StoO_error := 0;
    StoO_rowcnt := 0;
    StoO_crowcnt := 0;
    FETCH CLClaimAtchmCursor INTO
    CLCClaim.Id, CLCClaim.ClsnId;
    EXCEPTION
    WHEN OTHERS THEN
    StoO_rowcnt := 0;
    StoO_selcnt := 0;
    StoO_error := SQLCODE;
    StoO_errmsg := SQLERRM;
    END;
    IF CLClaimAtchmCursor%NOTFOUND THEN
    StoO_sqlstatus := 2;
    StoO_fetchstatus := -1;
    ELSE
    StoO_sqlstatus := 0;
    StoO_fetchstatus := 0;
    END IF;
    END CLCClaim;
    If this is not sufficient please give a complete testcase and migration workbench version to support email address: [email protected] so the bug can be reproduced and logged.
    Turloch
    Oracle Migration Workbench Team

  • Sql server services give error the remote procedure call failed [0x800706be] in sql server 2008

    sql server services give error the remote procedure call failed [0x800706be] in sql server 2008.
    To resolve this issue, I executed the following mofcomp command in command prompt to re-register the *.mof files:
    mofcomp.exe "C:\Program Files (x86)\Microsoft SQL Server\100\Shared\sqlmgmproviderxpsp2up.mof".
    but it does not work.
    Plz give the exact soln to solve this error.

    sql server services give error the remote procedure call failed [0x800706be] in sql server 2008.
    To resolve this issue, I executed the following mofcomp command in command prompt to re-register the *.mof files:
    mofcomp.exe "C:\Program Files (x86)\Microsoft SQL Server\100\Shared\sqlmgmproviderxpsp2up.mof".
    but it does not work.
    Plz give the exact soln to solve this error.
    So when you tried starting SQL server service it gave the error right  ?  or when you click on SQL server services in SQL server configuration manager(SSCM) you get this error. Can you be more clear.  As far as I read your question it has something
    to do with permission. Close SSCM window and this time  right click on SQL server configuration manager and select run as administrator and check if you can see SQL server services
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
    My Technet Articles

  • SAP List of Supported SQL Server Service Packs and Cumulative Updates

    Does SAP provide a list of SQL Server Service Packs and Cumulative Updates that will work with BPC 7.0 and 7.5? I see that CU 12 is out for SP1 and CU 2 is out for SP2. I would like to know if I can move the SP2 CU2 or SP1 CU12. My install docs are outdated specifying SP1 CU6.
    Any direction is appreciated.
    Joe

    Hi,
    Please take a look at the below list of the supported OS: This excerpt is from the installation guide.
    SP04 or later: Windows Server 2008 R2 Standard or Enterprise Edition with or without Hyper-V
    Windows Server 2008 Standard or Enterprise Edition with or without Hyper-V, or
    Windows Server 2008 Data Center with or without Hyper-V
    Windows Server 2003 Standard or Enterprise Edition SP2
    Windows Server 2003 Standard configured on the SQL database or OLAP server components only
    Windows Server 2003 R2 Standard or Enterprise Edition SP2
    SAP recommends using Windows Server 2008 64 bit over Windows Server 2003 64 bit. Otherwise, supportability is limited.
    I am not sure what did you mean by the front end. Having said that, 32 bit is supported both on the server and the client machines.
    Hope this helps.

  • Sql server service crashes a few times yesterday, however, there is no .MDMP file generated in the log folder

    hi there:
     I've experienced several sql server service crashes yesterday, service was brought up after a few secs as we have an autostart feature. 
    Today, I'd like to dig more into the errors and on the event viewer -> Application, I saw errors below
    "Faulting application sqlservr.exe, version 2009.100.4302.0, time stamp 0x52f5d194, faulting module ntdll.dll, version 6.0.6001.18538, time stamp 0x4cb73957, exception code 0xc0000374, fault offset 0x00000000000a7857, process id 0x15ec, application
    start time 0x01cfd7e72b2997d3.
    People suggested to check dump file inside C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQL2008R2\MSSQL\Log
    However, the lastest .mdmp file was  on April 11, 2014. Do I need to turn on some settings on sql server in order to have this dump file? 
    Thanks
    Hui
    --Currently using Reporting Service 2000; Visual Studio .NET 2003; Visual Source Safe SSIS 2008 SSAS 2008, SVN --

    Results after sp_readerrorlog 1
    LogDate ProcessInfo
    Text
    2014-09-24 04:03:28.460 Server
    Microsoft SQL Server 2008 R2 (SP2) - 10.50.4302.0 (X64) 
    Feb  7 2014 17:23:24 
    Copyright (c) Microsoft Corporation
    Enterprise Edition (64-bit) on Windows NT 6.0 <X64> (Build 6001: Service Pack 1)
    2014-09-24 04:03:28.460 Server
    (c) Microsoft Corporation.
    2014-09-24 04:03:28.460 Server
    All rights reserved.
    2014-09-24 04:03:28.460 Server
    Server process ID is 5612.
    2014-09-24 04:03:28.460 Server
    System Manufacturer: 'IBM', System Model: 'IBM System x3650 -[7979AC1]-'.
    2014-09-24 04:03:28.460 Server
    Authentication mode is MIXED.
    2014-09-24 04:03:28.460 Server
    Logging SQL Server messages in file 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQL2008R2\MSSQL\Log\ERRORLOG'.
    2014-09-24 04:03:28.460 Server
    This instance of SQL Server last reported using a process ID of 6780 at 9/24/2014 4:03:20 AM (local) 9/24/2014 11:03:20 AM (UTC). This is an informational message only; no user action is required.
    2014-09-24 04:03:28.460 Server
    Registry startup parameters: 
    -d C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQL2008R2\MSSQL\DATA\master.mdf
    -e C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQL2008R2\MSSQL\Log\ERRORLOG
    -l C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQL2008R2\MSSQL\DATA\mastlog.ldf
    2014-09-24 04:03:28.480 Server
    SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
    2014-09-24 04:03:28.480 Server
    Detected 4 CPUs. This is an informational message; no user action is required.
    2014-09-24 04:03:28.480 Server
    Cannot use Large Page Extensions:  lock memory privilege was not granted.
    2014-09-24 04:03:28.580 Server
    Using dynamic lock allocation.  Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node.  This is an informational message only.  No user action is required.
    2014-09-24 04:03:28.700 Server
    Node configuration: node 0: CPU mask: 0x000000000000000f:0 Active CPU mask: 0x000000000000000f:0. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required.
    2014-09-24 04:03:28.870 spid7s
    Starting up database 'master'.
    2014-09-24 04:03:28.940 spid7s
    1 transactions rolled forward in database 'master' (1). This is an informational message only. No user action is required.
    2014-09-24 04:03:28.940 spid7s
    0 transactions rolled back in database 'master' (1). This is an informational message only. No user action is required.
    2014-09-24 04:03:28.940 spid7s
    Recovery is writing a checkpoint in database 'master' (1). This is an informational message only. No user action is required.
    2014-09-24 04:03:29.040 spid7s
    CHECKDB for database 'master' finished without errors on 2014-09-20 12:00:01.697 (local time). This is an informational message only; no user action is required.
    2014-09-24 04:03:29.050 spid7s
    Resource governor reconfiguration succeeded.
    2014-09-24 04:03:29.050 spid7s
    SQL Server Audit is starting the audits. This is an informational message. No user action is required.
    2014-09-24 04:03:29.050 spid7s
    SQL Server Audit has started the audits. This is an informational message. No user action is required.
    2014-09-24 04:03:29.050 spid7s
    FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'SQL2008R2'.
    2014-09-24 04:03:29.070 spid7s
    SQL Trace ID 1 was started by login "sa".
    2014-09-24 04:03:29.070 spid7s
    Starting up database 'mssqlsystemresource'.
    2014-09-24 04:03:29.090 spid7s
    The resource database build version is 10.50.4302. This is an informational message only. No user action is required.
    2014-09-24 04:03:29.600 spid10s
    Starting up database 'model'.
    2014-09-24 04:03:29.600 spid7s
    Server name is 'BPWDB046\SQL2008R2'. This is an informational message only. No user action is required.
    2014-09-24 04:03:29.880 spid13s
    A new instance of the full-text filter daemon host process has been successfully started.
    2014-09-24 04:03:29.960 spid14s
    Starting up database 'msdb'.
    2014-09-24 04:03:29.960 spid17s
    Starting up database 'DW_Detail'.
    2014-09-24 04:03:29.960 spid16s
    Starting up database 'ReportServer_MSSQLSSRSTempDB'.
    2014-09-24 04:03:29.960 spid13s
    Starting up database 'Billing_Rep'.
    2014-09-24 04:03:29.960 spid15s
    Starting up database 'ReportServer_MSSQLSSRS'.
    2014-09-24 04:03:29.960 spid18s
    Starting up database 'BCBio_DW'.
    2014-09-24 04:03:29.960 spid19s
    Starting up database 'ODS'.
    2014-09-24 04:03:29.960 spid20s
    Starting up database 'ReportServer$SQL2008'.
    2014-09-24 04:03:29.970 spid21s
    Starting up database 'ReportServer$SQL2008TempDB'.
    2014-09-24 04:03:29.970 spid22s
    Starting up database 'Billing'.
    2014-09-24 04:03:29.970 spid23s
    Starting up database 'Billing_Snap'.
    2014-09-24 04:03:29.970 spid24s
    Starting up database 'DBA'.
    2014-09-24 04:03:30.000 Server
    A self-generated certificate was successfully loaded for encryption.
    2014-09-24 04:03:30.000 Server
    Server is listening on [ 'any' <ipv6> 52328].
    2014-09-24 04:03:30.000 Server
    Server is listening on [ 'any' <ipv4> 52328].
    2014-09-24 04:03:30.000 Server
    Server local connection provider is ready to accept connection on [ \\.\pipe\SQLLocal\SQL2008R2 ].
    2014-09-24 04:03:30.000 Server
    Server local connection provider is ready to accept connection on [ \\.\pipe\MSSQL$SQL2008R2\sql\query ].
    2014-09-24 04:03:30.010 Server
    Server is listening on [ ::1 <ipv6> 52329].
    2014-09-24 04:03:30.010 Server
    Server is listening on [ 127.0.0.1 <ipv4> 52329].
    2014-09-24 04:03:30.010 Server
    Dedicated admin connection support was established for listening locally on port 52329.
    2014-09-24 04:03:30.060 spid10s
    CHECKDB for database 'model' finished without errors on 2014-09-20 12:00:17.583 (local time). This is an informational message only; no user action is required.
    2014-09-24 04:03:30.060 spid10s
    Clearing tempdb database.
    2014-09-24 04:03:30.140 Server
    The SQL Server Network Interface library successfully registered the Service Principal Name (SPN) [ MSSQLSvc/BPWDB046.bcbio.org:SQL2008R2 ] for the SQL Server service. 
    2014-09-24 04:03:30.140 Server
    The SQL Server Network Interface library successfully registered the Service Principal Name (SPN) [ MSSQLSvc/BPWDB046.bcbio.org:52328 ] for the SQL Server service. 
    2014-09-24 04:03:30.140 Server
    SQL Server is now ready for client connections. This is an informational message; no user action is required.
    2014-09-24 04:03:30.480 spid21s
    CHECKDB for database 'ReportServer$SQL2008TempDB' finished without errors on 2014-09-20 16:13:10.043 (local time). This is an informational message only; no user action is required.
    2014-09-24 04:03:30.520 spid14s
    2933 transactions rolled forward in database 'msdb' (4). This is an informational message only. No user action is required.
    2014-09-24 04:03:30.650 spid7s
    0 transactions rolled back in database 'msdb' (4). This is an informational message only. No user action is required.
    2014-09-24 04:03:30.650 spid7s
    Recovery is writing a checkpoint in database 'msdb' (4). This is an informational message only. No user action is required.
    2014-09-24 04:03:30.770 spid14s
    CHECKDB for database 'msdb' finished without errors on 2014-09-20 12:00:18.473 (local time). This is an informational message only; no user action is required.
    2014-09-24 04:03:30.950 spid10s
    Starting up database 'tempdb'.
    2014-09-24 04:03:30.990 spid52
    Attempting to load library 'xpstar.dll' into memory. This is an informational message only. No user action is required.
    2014-09-24 04:03:31.010 spid52
    Using 'xpstar.dll' version '2009.100.1600' to execute extended stored procedure 'xp_sqlagent_monitor'. This is an informational message only; no user action is required.
    2014-09-24 04:03:31.060 spid14s
    The Service Broker protocol transport is disabled or not configured.
    2014-09-24 04:03:31.060 spid14s
    The Database Mirroring protocol transport is disabled or not configured.
    2014-09-24 04:03:31.070 spid14s
    Service Broker manager has started.
    2014-09-24 04:03:31.330 spid16s
    CHECKDB for database 'ReportServer_MSSQLSSRSTempDB' finished without errors on 2014-09-20 12:00:39.873 (local time). This is an informational message only; no user action is required.
    2014-09-24 04:03:31.500 spid20s
    2 transactions rolled forward in database 'ReportServer$SQL2008' (11). This is an informational message only. No user action is required.
    2014-09-24 04:03:31.960 spid7s
    0 transactions rolled back in database 'ReportServer$SQL2008' (11). This is an informational message only. No user action is required.
    2014-09-24 04:03:31.960 spid7s
    Recovery is writing a checkpoint in database 'ReportServer$SQL2008' (11). This is an informational message only. No user action is required.
    2014-09-24 04:03:32.150 spid20s
    CHECKDB for database 'ReportServer$SQL2008' finished without errors on 2014-09-20 16:13:07.583 (local time). This is an informational message only; no user action is required.
    2014-09-24 04:03:33.170 spid24s
    CHECKDB for database 'DBA' finished without errors on 2014-09-20 16:22:41.603 (local time). This is an informational message only; no user action is required.
    2014-09-24 04:03:33.600 spid13s
    Recovery of database 'Billing_Rep' (8) is 0% complete (approximately 1537 seconds remain). Phase 1 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:03:34.820 spid15s
    CHECKDB for database 'ReportServer_MSSQLSSRS' finished without errors on 2014-09-20 12:00:32.067 (local time). This is an informational message only; no user action is required.
    2014-09-24 04:03:48.290 spid13s
    Recovery of database 'Billing_Rep' (8) is 1% complete (approximately 1488 seconds remain). Phase 1 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:03:49.520 spid17s
    1 transactions rolled forward in database 'DW_Detail' (7). This is an informational message only. No user action is required.
    2014-09-24 04:03:50.070 spid7s
    0 transactions rolled back in database 'DW_Detail' (7). This is an informational message only. No user action is required.
    2014-09-24 04:03:50.070 spid7s
    Recovery is writing a checkpoint in database 'DW_Detail' (7). This is an informational message only. No user action is required.
    2014-09-24 04:03:50.070 spid7s
    Recovery completed for database DW_Detail (database ID 7) in 5 second(s) (analysis 251 ms, redo 4314 ms, undo 44 ms.) This is an informational message only. No user action is required.
    2014-09-24 04:03:50.520 spid22s
    CHECKDB for database 'Billing' finished without errors on 2013-04-25 18:47:20.743 (local time). This is an informational message only; no user action is required.
    2014-09-24 04:03:51.620 spid17s
    CHECKDB for database 'DW_Detail' finished without errors on 2014-09-20 12:00:46.917 (local time). This is an informational message only; no user action is required.
    2014-09-24 04:04:03.740 spid13s
    Recovery of database 'Billing_Rep' (8) is 2% complete (approximately 1493 seconds remain). Phase 1 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:04:13.040 spid13s
    Recovery of database 'Billing_Rep' (8) is 0% complete (approximately 8052 seconds remain). Phase 1 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:04:23.220 spid18s
    Database BCBio_DW has more than 1000 virtual log files which is excessive. Too many virtual log files can cause long startup and backup times. Consider shrinking the log and using a different growth increment to reduce the number of virtual log files.
    2014-09-24 04:04:23.420 spid18s
    Recovery of database 'BCBio_DW' (9) is 0% complete (approximately 4664 seconds remain). Phase 1 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:04:25.640 spid18s
    Recovery of database 'BCBio_DW' (9) is 0% complete (approximately 4954 seconds remain). Phase 1 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:04:25.640 spid18s
    Recovery of database 'BCBio_DW' (9) is 3% complete (approximately 74 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:04:25.730 spid18s
    Recovery of database 'BCBio_DW' (9) is 2% complete (approximately 98 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:04:26.000 spid18s
    Recovery of database 'BCBio_DW' (9) is 12% complete (approximately 18 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:04:28.000 spid19s
    Database ODS has more than 1000 virtual log files which is excessive. Too many virtual log files can cause long startup and backup times. Consider shrinking the log and using a different growth increment to reduce the number of virtual log files.
    2014-09-24 04:04:28.350 spid19s
    CHECKDB for database 'ODS' finished without errors on 2014-09-20 16:07:22.603 (local time). This is an informational message only; no user action is required.
    2014-09-24 04:04:29.370 spid18s
    Recovery of database 'BCBio_DW' (9) is 19% complete (approximately 24 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:04:31.380 spid18s
    Recovery of database 'BCBio_DW' (9) is 25% complete (approximately 22 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:04:32.490 spid18s
    Recovery of database 'BCBio_DW' (9) is 32% complete (approximately 18 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:04:33.150 spid13s
    Recovery of database 'Billing_Rep' (8) is 0% complete (approximately 9805 seconds remain). Phase 1 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:04:33.860 Logon
    Error: 18456, Severity: 14, State: 38.
    2014-09-24 04:04:33.860 Logon
    Login failed for user 'ETLAdmin'. Reason: Failed to open the explicitly specified database. [CLIENT: 172.20.101.33]
    2014-09-24 04:04:34.040 spid18s
    Recovery of database 'BCBio_DW' (9) is 39% complete (approximately 15 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:04:35.600 spid18s
    Recovery of database 'BCBio_DW' (9) is 46% complete (approximately 13 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:04:36.740 spid18s
    Recovery of database 'BCBio_DW' (9) is 53% complete (approximately 10 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:04:37.220 spid13s
    Recovery of database 'Billing_Rep' (8) is 0% complete (approximately 10106 seconds remain). Phase 1 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:04:37.230 spid13s
    Recovery of database 'Billing_Rep' (8) is 2% complete (approximately 2587 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:04:37.360 spid13s
    Recovery of database 'Billing_Rep' (8) is 1% complete (approximately 3654 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:04:37.560 spid13s
    Recovery of database 'Billing_Rep' (8) is 3% complete (approximately 1564 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:04:38.070 spid13s
    Recovery of database 'Billing_Rep' (8) is 4% complete (approximately 1328 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:04:38.830 spid18s
    Recovery of database 'BCBio_DW' (9) is 61% complete (approximately 8 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:04:40.080 spid13s
    Recovery of database 'Billing_Rep' (8) is 5% complete (approximately 1268 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:04:40.680 spid18s
    Recovery of database 'BCBio_DW' (9) is 69% complete (approximately 6 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:04:42.960 spid18s
    Recovery of database 'BCBio_DW' (9) is 77% complete (approximately 4 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:04:44.870 spid18s
    Recovery of database 'BCBio_DW' (9) is 85% complete (approximately 3 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:04:44.870 spid18s
    3 transactions rolled forward in database 'BCBio_DW' (9). This is an informational message only. No user action is required.
    2014-09-24 04:04:45.120 spid18s
    Recovery of database 'BCBio_DW' (9) is 85% complete (approximately 3 seconds remain). Phase 3 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:04:46.870 spid7s
    0 transactions rolled back in database 'BCBio_DW' (9). This is an informational message only. No user action is required.
    2014-09-24 04:04:46.870 spid7s
    Recovery is writing a checkpoint in database 'BCBio_DW' (9). This is an informational message only. No user action is required.
    2014-09-24 04:04:46.870 spid7s
    Recovery completed for database BCBio_DW (database ID 9) in 23 second(s) (analysis 2417 ms, redo 19227 ms, undo 1745 ms.) This is an informational message only. No user action is required.
    2014-09-24 04:04:47.610 spid18s
    CHECKDB for database 'BCBio_DW' finished without errors on 2014-09-20 14:02:10.680 (local time). This is an informational message only; no user action is required.
    2014-09-24 04:04:47.820 spid23s
    Database Billing_Snap has more than 1000 virtual log files which is excessive. Too many virtual log files can cause long startup and backup times. Consider shrinking the log and using a different growth increment to reduce the number of virtual log files.
    2014-09-24 04:04:48.570 spid23s
    CHECKDB for database 'Billing_Snap' finished without errors on 2014-09-20 16:13:11.037 (local time). This is an informational message only; no user action is required.
    2014-09-24 04:04:52.970 spid13s
    Recovery of database 'Billing_Rep' (8) is 6% complete (approximately 1247 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:05:05.540 spid13s
    Recovery of database 'Billing_Rep' (8) is 7% complete (approximately 1224 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:05:17.980 spid13s
    Recovery of database 'Billing_Rep' (8) is 8% complete (approximately 1202 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:05:22.450 spid13s
    Recovery of database 'Billing_Rep' (8) is 8% complete (approximately 1196 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:05:22.450 spid13s
    1 transactions rolled forward in database 'Billing_Rep' (8). This is an informational message only. No user action is required.
    2014-09-24 04:05:22.560 spid13s
    Recovery of database 'Billing_Rep' (8) is 8% complete (approximately 1196 seconds remain). Phase 3 of 3. This is an informational message only. No user action is required.
    2014-09-24 04:05:22.710 spid13s
    CHECKDB for database 'Billing_Rep' finished without errors on 2014-09-20 13:25:01.597 (local time). This is an informational message only; no user action is required.
    2014-09-24 04:05:22.720 spid13s
    0 transactions rolled back in database 'Billing_Rep' (8). This is an informational message only. No user action is required.
    2014-09-24 04:05:22.720 spid13s
    Recovery is writing a checkpoint in database 'Billing_Rep' (8). This is an informational message only. No user action is required.
    2014-09-24 04:05:22.730 spid13s
    Recovery completed for database Billing_Rep (database ID 8) in 109 second(s) (analysis 63983 ms, redo 45211 ms, undo 154 ms.) This is an informational message only. No user action is required.
    2014-09-24 04:05:22.750 spid7s
    Recovery is complete. This is an informational message only. No user action is required.
    2014-09-24 07:00:06.930 spid53
    Common language runtime (CLR) functionality initialized using CLR version v2.0.50727 from C:\Windows\Microsoft.NET\Framework64\v2.0.50727\.
    2014-09-24 07:00:07.720 spid53
    AppDomain 2 (mssqlsystemresource.sys[runtime].1) created.
    2014-09-24 07:13:38.590 spid51
    SQL Server blocked access to STATEMENT 'OpenRowset/OpenDatasource' of component 'Ad Hoc Distributed Queries' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'Ad
    Hoc Distributed Queries' by using sp_configure. For more information about enabling 'Ad Hoc Distributed Queries', see "Surface Area Configuration" in SQL Server Books Online.
    2014-09-24 07:13:53.870 Logon
    Error: 18456, Severity: 14, State: 38.
    2014-09-24 07:13:53.870 Logon
    Login failed for user 'BCBIO\sqlservice'. Reason: Failed to open the explicitly specified database. [CLIENT: 172.20.100.6]
    2014-09-24 07:13:56.560 Logon
    Error: 18456, Severity: 14, State: 38.
    2014-09-24 07:13:56.560 Logon
    Login failed for user 'BCBIO\sqlservice'. Reason: Failed to open the explicitly specified database. [CLIENT: 172.20.100.6]
    2014-09-24 07:13:57.460 Logon
    Error: 18456, Severity: 14, State: 38.
    2014-09-24 07:13:57.460 Logon
    Login failed for user 'BCBIO\sqlservice'. Reason: Failed to open the explicitly specified database. [CLIENT: 172.20.100.6]
    2014-09-24 07:13:57.560 Logon
    Error: 18456, Severity: 14, State: 38.
    2014-09-24 07:13:57.560 Logon
    Login failed for user 'BCBIO\sqlservice'. Reason: Failed to open the explicitly specified database. [CLIENT: 172.20.100.6]
    2014-09-24 07:13:57.950 Logon
    Error: 18456, Severity: 14, State: 38.
    2014-09-24 07:13:57.950 Logon
    Login failed for user 'BCBIO\sqlservice'. Reason: Failed to open the explicitly specified database. [CLIENT: 172.20.100.6]
    2014-09-24 07:14:04.410 Logon
    Error: 18456, Severity: 14, State: 38.
    2014-09-24 07:14:04.410 Logon
    Login failed for user 'BCBIO\sqlservice'. Reason: Failed to open the explicitly specified database. [CLIENT: 172.20.100.6]
    2014-09-24 07:14:04.960 Logon
    Error: 18456, Severity: 14, State: 38.
    2014-09-24 07:14:04.960 Logon
    Login failed for user 'BCBIO\sqlservice'. Reason: Failed to open the explicitly specified database. [CLIENT: 172.20.100.6]
    2014-09-24 07:34:13.330 spid54
    Error: 17053, Severity: 16, State: 1.
    2014-09-24 07:34:13.330 spid54
    V:\log\templog.ldf: Operating system error 112(There is not enough space on the disk.) encountered.
    2014-09-24 07:34:14.430 spid54
    Error: 9002, Severity: 17, State: 4.
    2014-09-24 07:34:14.430 spid54
    The transaction log for database 'tempdb' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases
    --Currently using Reporting Service 2000; Visual Studio .NET 2003; Visual Source Safe SSIS 2008 SSAS 2008, SVN --

  • SQL Server Service won't start on SQL Server 2008

    Hi everyone,
    I'm having trouble starting SQL Server service after stopping and starting the service. Before this happened, I created a Stored Procedure for marking all tables at once along with a maintenance plan for differential backup on all my databases based on the
    recommendation from this link, http://msdn.microsoft.com/en-us/library/ms253070.aspx.
    When I realized that the differential backup failed with some databases displaying (Restoring...) post-fix to the database name, I decided to stop SQL Server service and start it up. That is when I won't be able to start the service again.
    Is there a fix for starting the SQL Server service? Any help is very much appreciated.
    Additional information:
    - With administrator permission granted.
    - Service Pack 1 for SQL Server 2008 installed.
    - Using default database instance.
    - Tried C:\Program Files\Microsoft SQL Server\MSSQL.....\Binn>net start MSSQLSERVER /T3608 ( return msg: System error 5 has occurred. Access is denied.
    - When I start SQL Server service, I keep getting this dialog msg:
    "Windowns could not start the SQL Server (MSSQLSERVER) on Local Computer. For more information, review the System Event Log. If this is a non-Microsoft service, contact the service vendor, and refer to service-specific error code 1814."
    The event log does not explain or provide any hint on how to fix the problem.
    - Log msg:
    2010-07-22 10:30:25.09 Server      (c) 2005 Microsoft Corporation.
    2010-07-22 10:30:25.09 Server      All rights reserved.
    2010-07-22 10:30:25.09 Server      Server process ID is 6076.
    2010-07-22 10:30:25.10 Server      Authentication mode is MIXED.
    2010-07-22 10:30:25.10 Server      Logging SQL Server messages in file 'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Log\ERRORLOG'.
    2010-07-22 10:30:25.11 Server      This instance of SQL Server last reported using a process ID of 5708 at 7/21/2010 3:27:01 PM (local) 7/21/2010 10:27:01 PM (UTC). This is an informational message only; no user action is required.
    2010-07-22 10:30:25.11 Server      Registry startup parameters:
         -d C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\master.mdf
         -e C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Log\ERRORLOG
         -l C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\mastlog.ldf
    2010-07-22 10:30:25.14 Server      SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
    2010-07-22 10:30:25.14 Server      Detected 4 CPUs. This is an informational message; no user action is required.
    2010-07-22 10:30:25.23 Server      Using locked pages for buffer pool.
    2010-07-22 10:30:25.43 Server      Using dynamic lock allocation.  Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node.  This is an informational message only.  No user action is required.
    2010-07-22 10:30:25.73 Server      Node configuration: node 0: CPU mask: 0x000000000000000f Active CPU mask: 0x000000000000000f. This message provides a description of the NUMA configuration for this computer. This is an informational
    message only. No user action is required.
    2010-07-22 10:30:25.81 spid7s      Starting up database 'master'.
    2010-07-22 10:30:26.14 spid7s      CHECKDB for database 'master' finished without errors on 2010-07-19 21:15:02.823 (local time). This is an informational message only; no user action is required.
    2010-07-22 10:30:26.18 spid7s      Resource governor reconfiguration succeeded.
    2010-07-22 10:30:26.18 spid7s      SQL Server Audit is starting the audits. This is an informational message. No user action is required.
    2010-07-22 10:30:26.18 spid7s      SQL Server Audit has started the audits. This is an informational message. No user action is required.
    2010-07-22 10:30:26.19 spid7s      FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'MSSQLSERVER'.
    2010-07-22 10:30:26.28 spid7s      SQL Trace ID 1 was started by login "sa".
    2010-07-22 10:30:26.29 spid7s      Starting up database 'mssqlsystemresource'.
    2010-07-22 10:30:26.31 spid7s      The resource database build version is 10.00.2531. This is an informational message only. No user action is required.
    2010-07-22 10:30:26.43 spid10s     Starting up database 'model'.
    2010-07-22 10:30:26.43 spid7s      Server name is 'XXXXXXXXXXXXXX'. This is an informational message only. No user action is required.
    2010-07-22 10:30:26.47 spid10s     The database 'model' is marked RESTORING and is in a state that does not allow recovery to be run.
    2010-07-22 10:30:26.47 spid10s     Error: 927, Severity: 14, State: 2.
    2010-07-22 10:30:26.47 spid10s     Database 'model' cannot be opened. It is in the middle of a restore.
    2010-07-22 10:30:26.59 spid10s     Could not create tempdb. You may not have enough disk space available. Free additional disk space by deleting other files on the tempdb drive and then restart SQL Server. Check for additional errors in
    the event log that may indicate why the tempdb files could not be initialized.
    2010-07-22 10:30:26.59 spid10s     SQL Trace was stopped due to server shutdown. Trace ID = '1'. This is an informational message only; no user action is required.

    Hello,
    Could you please copy the model.mdf and modellog.ldf from
    C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Binn\Templates
    To
    C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA
    Rebuilding the system databases you will lose lose logins, jobs, SSIS packages. You may have to restore or attach user databases.
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • How do I merge data from table1 on server 1 to final table on server 2 with a stored procedure to execute every so many hours.

    How do I merge data from table1 on server 1 to final table on server 2 with a stored procedure to execute every so
    many hours.

    How big is the table on server B? Is that possible to bring the all data into a server A and merge the data locally?
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

Maybe you are looking for