SQL Server 2014 with AGs - Over 6 million DONE tasks in dm_os_tasks

Hello,
We've noticed that our SQL Server deployment has a very high number of tasks in the done state.  On our 5 node cluster we have values in the millions on most servers (depending on last restart time), with our highest server returning over 6 million
for the following query:
select count(*)
from sys.dm_os_tasks
where task_state = 'done'
We also track the count daily, and we have never seen the number of tasks decrease.  The average growth per day is 50,000.  The servers are all running SQL Server 2014 Enterprise Edition CU2 (build 12.0.2370).  The servers host between 4 and 8
availability groups each, with 1 to 3 databases per AG.
We're a little concerned that this behaviour is very reminiscent of that noted in the Memory Leak in 2012 KB 2877100), and wondered if anyone else is having a similar experience with 2014 AGs?
We did open a product support case for a separate issue where we mentioned this, but were told that until we could provide a memory dump of a crashing instance we wouldn't be able to investigate if this was actually a leak.
Any advice or discussion that suggests this behaviour is actually 'worked as intended' would be appreciated.
Kind Regards,
Tim

Hi Tim,
This does indeed look quite reminiscent of 2877100 and this behavior does certainly seem abnormal, particularly if you can establish memory consumption growth over time. I'd recommend providing MSFT additional statistics regarding memory usage via DMVs and
perfmon if you haven't already.
Product support is still definitely the recommended route - and you might try escalating or asking for another engineer.  I understand why they are asking for this information, but perhaps ask if they can provide less invasive methods for root cause
analysis.  If the answer is still "no" - hopefully you have a prod-like environment where you can reproduce this?  And if so, then the memory dump is less of a risk in non-prod.
Best Regards, Joe Sack, MVP, SQL MCM | SackHQ.com

Similar Messages

  • Why can't I log into my "Local" sql server (sql server 2014) with my Sql Server Authentication UID ?

    I just got a new work station (win7 Pro) which has the following sql server
    SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')
    returns
    12.0.2254.0     RTM     Developer Edition (64-bit)
    Select @@version
    returns
    Microsoft SQL Server 2014 - 12.0.2254.0 (X64)
     Jul 25 2014 18:52:51
     Copyright (c) Microsoft Corporation
     Developer Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)
    I added/created a new (random) user account to this server [joe123] and made him sa and mapped him to everything, the password never expires, ...
    when I try to login to this local server the login fails, but I can log into this server with my windows integrated account (also sa).  What do I need to do so that the joe123 account can login to the server
    Rich P

    Check if both "SQL Server and Windows Authentication mode" is set (not just Windows Authentication mode). Server-->right click and select properties -->  Security
    Satish Kartan http://www.sqlfood.com/

  • Backup Database From SQL Server 2014 with expired trial period.

    Hi,
    Looking for some advice. I created a database on a SQL Server 2014 Trial Version i downloaded from the Microsoft website. Our company bought a license for SQL Server 2012 instead of 2014, how can i migrate my database to 2012 without the ability to connect
    to my 2014 Server or Management studio (Because the trial period has expired)?
    Thank You.

    Hi,
    Alternatively, you can stop SQL Services and then locate the mdf & ldf file copy these files to new location.
    Now you try to attach above files in new server.
    Sorry little correction
    I dint pay attention to 2014 to 2012, in this case you need to attach these files on SQL Server 2014 then generate script and execute these script on 2012.
    Please refer following article on how to attach database.
    Attach a Database
    Also refer following post with similar issue.
    MS SQL 2008 Evaluation expired...need to get database backup
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    Praveen Dsa | MCITP - Database Administrator 2008 |
    My Blog | My Page

  • SQL Server 2014 with instance uninstallation

    Hello Team
    As i by-mistake perform the installation of SQL Server 2014 Standard edition on one of our server . I removed that instance completely but still i am able to connect that instance and able to access DB's from there instance (Server rebooted after successfully
    un-installation of SQL Server).
    Can some suggest why it is accessible after complete instance remove from server ?
    Thanks Ranveer Katiyar

    From Add/remove programs > select 2014 and hit on the uninstall > there is pop up open for add/repair and remove > select remove and there is option for instance > choose instance and select all component for instance which one we selected and
    then remove after that i get the below message for successfully installation.
    Thanks Ranveer Katiyar
    Uninstall is perfect so what is issue now I guess you have multiple instances and you have not uninstalled both ? Is that so.
    Can you run below discovery report and post output here
    http://blogs.msdn.com/b/petersad/archive/2009/11/13/sql-server-2008-discovery-report.aspx
    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 Wiki Article
    MVP

  • Unexpected Termination SSIS package - Issue with SSIS packages after upgrading to SQL Server 2014

    Hello everyone.
    We performed an upgrade of SQL Server 2012 installation to SQL Server 2014 (with last CU5 update). We found that all SSIS packages (even the simplest with just Execute SQL tasks) fail with Unexpected termination message. The issue reproduces with both new
    packages (that are created from scratch with SSDT 2014) and old packages (migrated from SQL 2012).
    Any ideas, please? We googled and found that it is a known issue that should have fixed with CU4. But we use CU5 and the issue is still here.
    MCP

    Hi. Yes...
    - <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
    - <System>
      <Provider Name="SQLISServer" /> 
      <EventID Qualifiers="0">1</EventID> 
      <Level>2</Level> 
      <Task>0</Task> 
      <Keywords>0x80000000000000</Keywords> 
      <TimeCreated SystemTime="2015-02-12T07:41:56.000000000Z" /> 
      <EventRecordID>469950</EventRecordID> 
      <Channel>Application</Channel> 
      <Computer>abtru1a11.oneabbott.com</Computer> 
      <Security /> 
      </System>
    - <EventData>
      <Data>The SSIS Execution Process could not write to the IS catalog: ABTRU1A11\DEV:SSISDB Error details: Cannot find the symmetric key 'MS_Enckey_Proj_Param_5', because it does not exist or you do not have permission.; at System.Data.SqlClient.SqlConnection.OnError(SqlException
    exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior
    runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData()
    at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream,
    Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion,
    Int32 timeout, Task& task, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
    behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader() at Microsoft.SqlServer.IntegrationServices.Server.Shared.ExecutionParameterLoader.GetExecutionParameter() at Microsoft.SqlServer.IntegrationServices.Server.ISServerExec.ProjectOperator.StartPackage()
    at Microsoft.SqlServer.IntegrationServices.Server.ISServerExec.ProjectOperator.PerformOperation()</Data> 
      </EventData>
      </Event>
    MCP

  • SQL Server 2014 Management Studio - "The operation could not be completed"

    Hi there!
    I've recently installed SQL Server 2014 Express Edition to my Windows 8.1 x64 computer. It was working fine for one month or so. Now, when I try to open Management Studio I get the error "The operation could not be completed". A few seconds into
    the splash screen. Then the application shuts down.
    I don't have any errors or warnings on Event Viewer. Not even any information lines related to SSMS when opening. I've tried to use ProcMon but I can't see any events related to SSMS.exe that could give this result. I've already installed Cumulative Update
    2 for SQL Server 2014 with no luck. Also, I've repaired SQL Server installation and even reinstalled this instance with the same outcome.
    I know this topic has already been written before but it was related to Windows Server. The response marked as Answer was not applicable to my case. As I said, I'm using Win 8.1 x64.
    I'm out of options for now. Can you please give any help?
    Thank you so much.

    Hello,
    Before reinstalling Windows, please try the .NET Framework Repair Tool.
    http://www.microsoft.com/en-us/download/details.aspx?id=30135
    If the above did not help, you may want to try the automatic repair option.
    http://www.bleepingcomputer.com/tutorials/http-wwwbleepingcomputercom-tutorials-automatically-repair-windows-8-with-automatic-repair-/
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • MS SQL Server 2014 Report Services Link error

    I have installed SQL Server 2014 with Report builder 3 for 2014 report builder is perfect working, but report services is not working when click on this link "http://microsoft:80/ReportServer" then message is alerted " Reporting
    Services error" The permissions granted to user 'Microsoft\MCSD'
    are insufficient for performing this operation. (rsAccessDenied)and when click on this link "http://microsoft:80/Reports" then message is alerted:
    "User 'Microsoft\MCSD' does not have required permissions. Verify that sufficient permissions have been granted and Windows User Account Control (UAC) restrictions have been addressed."
    i am using MCSD account as administrator so how resolve this problem?

    Hi Visio,
    I think this issue can be caused by BUILTIN\Administrators might be deleted by someone else. Local Administrators group is equal to BUILTIN\Administrators group on Report Manager. By default, BUILTIN\Administrators user is granted with Content Manger Role.
    When someone delete the BUILTIN\Administrators group in the Folder Settings, Local Administrators group cannot access report manager and report server any more.
    To fix this issue, please use an account which has access to report server to assign some sufficient permissions to the account “Microsoft\MCSD”.
    Another possible is the operating systems limit the overuse of elevated permissions by removing administrator permissions when accessing applications. To fix this issue, please open the Report Manager in Internet Explorer with Run as administrator option.
    References:
    http://technet.microsoft.com/en-us/library/aa337491(v=sql.105).aspx
    http://social.technet.microsoft.com/Forums/exchange/en-US/f095f769-2081-4173-ac16-b806941f0811/uireportmanager01219c08072014161821-e-error?forum=sqlreportingservices
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • High PREEMPTIVE_SP_SERVER_DIAGNOSTICS wait time in sql server 2014 server

    I am seeing high waittimes for PREEMPTIVE_SP_SERVER_DIAGNOSTICS and the server is runninf with high cpu.
    What could have triggered this high waittime, how can this be fixed,
    WaitType Wait_S
    Resource_S Signal_S
    WaitCount Percentage
    AvgWait_S AvgRes_S
    AvgSig_S
    PREEMPTIVE_SP_SERVER_DIAGNOSTICS 1655043.72
    1655043.72 0.00
    4 39.75
    413760.9305 413760.9305
    0.0000
    PREEMPTIVE_OS_PIPEOPS 935157.21
    935157.21 0.00
    343445 22.46
    2.7229 2.7229
    0.0000
    CXPACKET 259912.58
    250608.73 9303.85
    25115286 6.24
    0.0103 0.0100
    0.0004
    PAGEIOLATCH_SH 206350.14
    205563.18 786.96
    37649420 4.96
    0.0055 0.0055
    0.0000
    SOS_SCHEDULER_YIELD 139263.91
    2430.27 136833.63
    293382681 3.35
    0.0005 0.0000
    0.0005

    Hello,
    I remember I read a user complaining about high waits on PREEMPTIVE_SP_SERVER_DIAGNOSTICS when he installed CU5 for SQL
    Server 2012 SP1, but in your scenario you have a SQL Server 2014 with CU1 (build 2342). I am treating this as a bug and that is the reason I would like you to consider applying CU5, the latest cumulative update, to see if that solves the issue.
    http://support.microsoft.com/kb/3011055/en-us
    This is the first time I read about this happening on SQL Server 2014 though.
    I would like to suggest you to create a Connect item too, to see if the SQL Server team can suggest you another way to
    treat this issue.
    https://connect.microsoft.com/sqlServer/
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • SQL Server 2014 SSRS Login Prompt won't go away

    Hi,
    I'm attempting to set up SQL Server Reporting Services on one of my environments.  The architecture is:
    Database Server: SQL Server 2014 hosting my databases as well as the ReportServer / ReportServerTempDB databases
    SSRS Server: SQL Server 2014 with just SSRS installed, hosting the web front end
    I created a new SSRS database using the SSRS configuration manager.
    When I log into the website on the local machine (http : // localhost/reports),
    I'm prompted for my credentials once and once I authenticate (domain\username), everything works as expected.  However, when I attempt to access the server remotely (either http or https : // reportserver.domain.com/reports)
    I'm prompted for my credentials at least 12 times.  If I keep re-entering them, the SQL Server Reporting Services Home folder/website will eventually re-appear, but if I try to navigate, I'm once again prompted for my credentials.
    I did some research and verified that my AuthenticationTypes in the rsreportserver.config file was set to only RSWindowsNTLM.
    Additional environment info: both servers are hosted on AWS, and we are using an ELB to access the SSRS webserver.  I'm using IE11 to attempt web access.
    Thanks!

    Hi Rob,
    I am not sure why you are using the -A while setting up the SPN, Use  -S to set the SPN and make sure you delete the old one(setspn -D HTTP/<server> domain\user )
    Use the following command line to set the SPN
    SETSPN –S HTTP/hostname.abc.com:<portnumber> DOMAIN\ServiceAccount
    Note: The config file for reporting services also needs to be updated to allow Windows
    authentication. Do the following:
    1. Locate the installation directory of the reporting server instance.
    2. Open the ‘rsreportserver.config’ with a text editor such as Notepad.
    3. Find the following XML parameters
    <Authentication>
    <AuthenticationTypes>
    <RSWindowsNTLM/>
    </AuthenticationTypes>
    4. Change the value
    ‘RSWindowsNTLM’ to ‘RSWindowsNegotiate
    Hope This Helps
    Thanks
    Bhanu

  • SSDT-BI for SQL Server 2014, Command line(silent unattendant automatic) installation script/steps

    Hi,
    I have downloaded SSDT-BI software and looking for commandline steps,config file for this.
    http://www.microsoft.com/en-us/download/details.aspx?id=42313
    Any one have Command line installations steps for SSDT-BI automatic(command line) installation for SQL Server 2014 with giving the files location,where to install.....etc, i mean config.xml.
    I found below but not sure it will work or not. If any one have working correct command line script, please reply on this forum.
    Looking for config.xml file, i searched online and did not find any where with clear config.xml file details.
    --Found below from link and not sure it will work or not
    http://blogs.technet.com/b/ilikesql_by_dandyman/archive/2013/03/10/how-to-automate-the-installation-of-sql-server-ssdt-office-2013-and-visual-studio-2012.aspx
    setup.exe /ACTION=INSTALL /FEATURES=SSDTBI_VS2012 /Q /IACCEPTSQLSERVERLICENSETERMS /norestart
    thanks in advance.

    Hi SQLDBA321,
    The SSDT-BI is automatically installed under xxx:\Program Files\Microsoft SQL Server\. Now matter in GUI or command line, we can't change the path. Because SSDT is a feature of SQL Server, not a feature of Visual Studio. It just use the Visual
    Studio Shell. So SSDT will only be installed with SQL Server.
    Reference:
    Install SQL Server Data Tools - Business Intelligence for Visual Studio 2013
    If you have any question, please feel free to ask. 
    Simon Hou
    TechNet Community Support

  • SQL Server 2005 replaced with SQL Server 2014 trying to connect front end Access as guest (read only ODBC)

    We have replaced a SQL Server 2005 with a SQL Server 2014 (new physical server.)  Have the new server set up to use SQL Server login OR Windows user login. Had old server connecting (for a particular DB) to front end Access (2010 or 2013) as guest for
    anyone logged into the Windows NT Network with a read only ODBC connection. Have the DB in the new server set to include guest as db_datareader (with only SELECT permission for the securables of each table and view being linked) but when any Windows user not
    specifically listed as a SQL DB user tries to use the front end they get an error of:
    Microsoft SQL Server Login
    Connection failed:
    SQL State: '28000'
    SQL Server Error: 18456
    [Microsoft][OCBC SQL Server Driver][SQL Server] Login failed for user {domain\user}.
    After closing that pop-up window a server login window appears. Of course, since the guest user is not specifically listed as a user in the DB that fails also. It seems like there should be a very simple solution to this, but I can't seem to find it. I want
    to allow anyone logged in on the Windows system (locally) to be able to open the MS Access file (on their work station machine) and run their own (read only; select) queries on the SQL Server database. Any suggestions?
    Thanks a billion in advance ----

    Thanks for the response Olaf. I have now spent weeks researching this. I realize that using the guest account in most situations is not advised. As mentioned, I have restricted the guest account to allow the db_datareader role only, and have explicitly denied
    all other roles, as well as allowing select only, and still have no access for the guest account.
    The suggested fix in the second link you provided, of using Windows groups is not plausible for my situation either. We are a scientific field research institution, with a few long term users and lots of users that may have Windows accounts for a few months,
    and then they are gone. It would be a nightmare for the network tech to try to keep a group account up to date, and we need to give access (read only, of course) to anyone logged into the system. Realize that the ONLY access of any kind to this database is
    thru MS Access ACCDB, using a (by default) read only OCDB connection.
    This type of access is used particularly because researchers need to be able to set up their own queries, and the MS Access query interface is particularly convenient for people who are not themselves SQL experts, yet are trying to get some very advanced
    levels of output. Putting the database online is not practical because then we are back to the need for a comprehensive query interface, and just picking up general subsets of the data online (from a basic web page search feature) would be out of the question,
    since the result set would involve hundreds of thousands if not millions of records.
    So - that said - what exactly would you suggest, assuming we don't have the funds to buy a whole new system, and have spent plenty of money with Microsoft's Enterprise level MS Office so that all work stations have MS Access, and Microsoft's SQL Server,
    as well as running our network on Microsoft's network software.

  • SQL Server 2014 Always on HA takes 8-14 seconds to fail over. Application side timeouts occur

    Hi All,
    I have a very similar post in the SQL Server 2014 forums too (https://social.technet.microsoft.com/Forums/sqlserver/en-US/adb5e338-907e-4405-aa62-d3ea93c7a98a/sql-server-2014-always-on-ha-takes-814-seconds-to-fail-over-application-side-timeouts-occur?forum=sqldisasterrecovery) -
    advice in the end was to post a question here.
    SQL Server Nodes, 2014 (12.0.2480.0)
    1 Share witness (on separate subnet)
    1 Cluster
    1 Listener
    I have been testing the response time to failovers – both manual (right-click, fail over in SSMS) and Automatic (shut down the primary host). The way I am testing response is to have a SSMS query running on my desktop, connected to the listener querying
    a small table and hit execute.
    The Query response time, from execute to receiving the result, has been between 8 and 14 seconds based on my testing. My previous experience (in a separate environment) showed around 2 second fail over times in a very similar configuration.
    Availability DB is 200Mb and is not actively used. The nodes are synchronised.
    SQL Server Hosts: Windows 2012, 2 cpu, 8gb RAM.
    Questions:
    1: It’s a big question but what should I expect for a ‘normal’ fail over time. Keep in mind this scenario is about as simple as it gets.
    2: As it stands an 8 to 14 second ‘outage’ could cause some applications to time out. Or am I being un-reasonable? I am seeing the very simple query in SSMS to time out with this:
    Msg 983, Level 14, State 1, Line 2
    Unable to access availability database 'DATABASE' because the database replica is not in the PRIMARY or SECONDARY role. Connections to
    an availability database is permitted only when the database replica is in the PRIMARY or SECONDARY role. Try the operation again later.
    Cluster logs are long - this section accounts for 8 seconds of the 11 second outage I experienced. I can supply the full log if required. Also this log is just the 2 cluster nodes, I removed the witness share to make sure it was as simple as possible.
    00001090.00002128::2015/02/25-03:05:08.255 INFO  [GEM] Node 2: Deleting [1:65 , 1:71] (both included) as it has been ack'd by every node
    00001ee4.00002130::2015/02/25-03:05:10.107 INFO  [RES] Network Name: Agent: Sending request Netname/RecheckConfig to NN:5b81e7bd-58fe-4be9-a68a-c48ba2aa552b:Netbios
    00001090.00002128::2015/02/25-03:05:11.888 INFO  [GEM] Node 2: Deleting [1:72 , 1:73] (both included) as it has been ack'd by every node
    00001090.00002698::2015/02/25-03:05:11.889 INFO  [GUM] Node 2: Processing RequestLock 2:49
    00001090.00002128::2015/02/25-03:05:11.890 INFO  [GUM] Node 2: Processing GrantLock to 2 (sent by 1 gumid: 67)
    00001090.00002698::2015/02/25-03:05:11.890 INFO  [GUM] Node 2: executing request locally, gumId:68, my action: /dm/update, # of updates: 1
    00001090.00002128::2015/02/25-03:05:12.890 INFO  [GEM] Node 2: Deleting [1:74 , 1:74] (both included) as it has been ack'd by every node
    00001ee4.00002130::2015/02/25-03:05:15.107 INFO  [RES] Network Name: Agent: Sending request Netname/RecheckConfig to NN:5b81e7bd-58fe-4be9-a68a-c48ba2aa552b:Netbios
    00001090.00002128::2015/02/25-03:05:16.988 INFO  [GUM] Node 2: Processing RequestLock 1:28
    Thanks in advance.
    Keegan

    Hi Keegan,
    From these event log , what I can see is "Sending request Netname" wasted the time .
    Could you please tell us the network configuration of that cluster nodes ?
    If I recall correctly , it is recommended to only remain Tcp/IP protocol and disable NetBIOS over TCP/IP for "Private Network" , also do not configure DNS/Wins default gateway for "Private Network" :
    https://support.microsoft.com/kb/258750?wa=wsignin1.0
    After that please test again .
    Best Regards,
    Elton JI
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected] .

  • MS SQL Server 2014: Error inserting into Temp table with index and identity field

    In this thread, I mentioned a problem with SQL Server 2014:
    SQL Server 2014: Bug with IDENTITY INSERT ON
    The question was answered, it is a bug. To keep you informed on this issue, I open this discussion.
    Problem:
    The code below works perfectly fine on MS SQL Server 2008 R2 and MS SQL Server 2012, but gives an error every second time the proc is executed on MS SQL Server 2014. If I do not define any index on the temp table, the problem disappears. Defining the index
    after the insert, does not help.
    SET NOCOUNT ON
    GO
    IF EXISTS (SELECT 1 FROM sys.procedures WHERE name = 'usp_Test') DROP PROC dbo.usp_Test;
    GO
    CREATE PROC dbo.usp_Test AS
    BEGIN
    SET NOCOUNT ON
    CREATE TABLE #Source(ID integer NOT NULL);
    INSERT INTO #Source VALUES (1), (2), (3);
    CREATE TABLE #Dest (ID integer IDENTITY(1,1) NOT NULL);
    CREATE INDEX #IDX_Dest ON #Dest (ID);
    PRINT 'Check if the insert might cause an identity crisis';
    SELECT 'Source' AS SourceTable, * FROM #Source;
    SELECT 'Destination' AS DestTable, * FROM #Dest;
    SET IDENTITY_INSERT #Dest ON;
    PRINT 'Do the insert';
    INSERT INTO #Dest (ID) SELECT ID FROM #Source;
    PRINT 'Insert ready';
    SET IDENTITY_INSERT #Dest OFF;
    SELECT * FROM #Dest;
    DROP TABLE #Source;
    DROP TABLE #Dest;
    END;
    GO
    PRINT 'First execution of the proc, everything OK';
    EXEC dbo.usp_Test;
    PRINT '';
    PRINT 'Second execution of the proc, the insert fails.';
    PRINT 'Removing the index #IDX_Dest causes the error to disappear.';
    EXEC dbo.usp_Test;
    GO
    DROP PROC dbo.usp_Test;
    GO

    There is some progress. Communication from a former Microsoft employee tells us this:
    Shivendra Vishal
    Engineer at Microsoft
    I am no longer with MS, and I do not have code access, however from the public symbols, I could make out following:
    sqlmin!SetidentI2I4+0x1f3:
    000007fe`f4d865d3 488b10 mov rdx,qword ptr [rax] ds:00000000`00000000=????????????????
    ExceptionAddress: 000007fef4d865d3 (sqlmin!SetidentI2I4+0x00000000000001f3)
    ExceptionCode: c0000005 (Access violation)
    ExceptionFlags: 00000000
    NumberParameters: 2
    Parameter[0]: 0000000000000000
    Parameter[1]: 0000000000000000
    Attempt to read from address 0000000000000000
    This is a read AV and from registers it is clear that we were trying to move the value of location pointed by qword of register rax which is not valid:
    rax=0000000000000000 rbx=0000000000000038 rcx=0000000000001030
    rdx=0000000000000006 rsi=00000001f55def98 rdi=00000000106fd070
    rip=000007fef4d865d3 rsp=00000000106fcf40 rbp=00000000106fcfe9
    r8=0000000000000000 r9=00000001f55def60 r10=00000001f55defa0
    r11=00000000106fcd20 r12=0000000000000000 r13=0000000000000002
    r14=00000001f49c3860 r15=00000001f58c0040
    iopl=0 nv up ei pl nz na po nc
    cs=0033 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010206
    The stack is:
    # Child-SP RetAddr Call Site
    00 00000000`106fcf40 000007fe`f30c1437 sqlmin!SetidentI2I4+0x1f3
    01 00000000`106fd050 000007fe`f474e7ce sqlTsEs!CEsExec::GeneralEval4+0xe7
    02 00000000`106fd120 000007fe`f470e6ef sqlmin!CQScanUpdateNew::GetRow+0x43d
    03 00000000`106fd1d0 000007fe`f08ff517 sqlmin!CQueryScan::GetRow+0x81
    04 00000000`106fd200 000007fe`f091cebe sqllang!CXStmtQuery::ErsqExecuteQuery+0x36d
    05 00000000`106fd390 000007fe`f091ccb9 sqllang!CXStmtDML::XretDMLExecute+0x2ee
    06 00000000`106fd480 000007fe`f08fa058 sqllang!CXStmtDML::XretExecute+0xad
    07 00000000`106fd4b0 000007fe`f08fb66b sqllang!CMsqlExecContext::ExecuteStmts<1,1>+0x427
    08 00000000`106fd5f0 000007fe`f08fac2e sqllang!CMsqlExecContext::FExecute+0xa33
    09 00000000`106fd7e0 000007fe`f152cfaa sqllang!CSQLSource::Execute+0x86c
    0a 00000000`106fd9b0 000007fe`f152c9e8 sqllang!CStmtExecProc::XretLocalExec+0x25a
    0b 00000000`106fda30 000007fe`f152a1d8 sqllang!CStmtExecProc::XretExecExecute+0x4e8
    0c 00000000`106fe1e0 000007fe`f08fa058 sqllang!CXStmtExecProc::XretExecute+0x38
    0d 00000000`106fe220 000007fe`f08fb66b sqllang!CMsqlExecContext::ExecuteStmts<1,1>+0x427
    0e 00000000`106fe360 000007fe`f08fac2e sqllang!CMsqlExecContext::FExecute+0xa33
    0f 00000000`106fe550 000007fe`f0902267 sqllang!CSQLSource::Execute+0x86c
    10 00000000`106fe720 000007fe`f0909087 sqllang!process_request+0xa57
    11 00000000`106feee0 000007fe`f2bf49d0 sqllang!process_commands+0x4a3
    12 00000000`106ff200 000007fe`f2bf47b4 sqldk!SOS_Task::Param::Execute+0x21e
    13 00000000`106ff800 000007fe`f2bf45b6 sqldk!SOS_Scheduler::RunTask+0xa8
    14 00000000`106ff870 000007fe`f2c136ff sqldk!SOS_Scheduler::ProcessTasks+0x279
    15 00000000`106ff8f0 000007fe`f2c138f0 sqldk!SchedulerManager::WorkerEntryPoint+0x24c
    16 00000000`106ff990 000007fe`f2c13246 sqldk!SystemThread::RunWorker+0x8f
    17 00000000`106ff9c0 000007fe`f2c13558 sqldk!SystemThreadDispatcher::ProcessWorker+0x3ab
    18 00000000`106ffa70 00000000`775d59ed sqldk!SchedulerManager::ThreadEntryPoint+0x226
    19 00000000`106ffb10 00000000`7780c541 kernel32!BaseThreadInitThunk+0xd
    1a 00000000`106ffb40 00000000`00000000 ntdll!RtlUserThreadStart+0x21
    Unassembling the function:
    000007fe`f4d8658e 4c8b10 mov r10,qword ptr [rax]
    000007fe`f4d86591 4533e4 xor r12d,r12d
    000007fe`f4d86594 410fb7d5 movzx edx,r13w
    000007fe`f4d86598 4533c9 xor r9d,r9d
    000007fe`f4d8659b 4533c0 xor r8d,r8d
    000007fe`f4d8659e 488bc8 mov rcx,rax
    000007fe`f4d865a1 4489642420 mov dword ptr [rsp+20h],r12d
    000007fe`f4d865a6 41ff5230 call qword ptr [r10+30h]
    000007fe`f4d865aa 8b5597 mov edx,dword ptr [rbp-69h]
    000007fe`f4d865ad 4c8b10 mov r10,qword ptr [rax]
    000007fe`f4d865b0 4489642438 mov dword ptr [rsp+38h],r12d
    000007fe`f4d865b5 4489642430 mov dword ptr [rsp+30h],r12d
    000007fe`f4d865ba 458d442401 lea r8d,[r12+1]
    000007fe`f4d865bf 4533c9 xor r9d,r9d
    000007fe`f4d865c2 488bc8 mov rcx,rax
    000007fe`f4d865c5 c644242801 mov byte ptr [rsp+28h],1
    000007fe`f4d865ca 4488642420 mov byte ptr [rsp+20h],r12b
    000007fe`f4d865cf 41ff5250 call qword ptr [r10+50h]
    000007fe`f4d865d3 488b10 mov rdx,qword ptr [rax] <=================== AV happened over here
    000007fe`f4d865d6 488bc8 mov rcx,rax
    000007fe`f4d865d9 4c8bf0 mov r14,rax
    000007fe`f4d865dc ff5268 call qword ptr [rdx+68h]
    000007fe`f4d865df 488d55e7 lea rdx,[rbp-19h]
    000007fe`f4d865e3 4c8b00 mov r8,qword ptr [rax]
    000007fe`f4d865e6 488bc8 mov rcx,rax
    000007fe`f4d865e9 41ff5010 call qword ptr [r8+10h]
    000007fe`f4d865ed f6450a04 test byte ptr [rbp+0Ah],4
    I remember few issues with scan2ident function, I am not sure if they have fixed it however it appears that this is intoduced to SQL 2014 and we need help from MS to get this resolved as it needs code analysis.
    It is not getting simulated for other versions of SQL apart from SQL 2014.
    Also to add, interestingly, the value of rax is not visibly changed and it was successfully passed on to rcx, which has a valid value, so something should have changed the value of rax inside call to function using call qword ptr [r10+50h], and looking at this
    it appears that it might be a list of functions and we are going at particular offset [50h]. So, bottom line is that the call to function qword ptr [r10+50h], should be changing something in rax, and debugging/analyzing this code might give us some more idea.

  • SQL Server 2014 Bug - with Clustered Index On Temp Table with Identity Column

    Hi,
    Here's a stored procedure.  (It could be shorter, but this will show the problem.)
              CREATE PROCEDURE dbo.SGTEST_TBD_20141030 AS
              IF OBJECT_ID('TempDB..#Temp') IS NOT NULL
                 DROP TABLE #Temp
              CREATE TABLE #Temp
               Col1        INT NULL
              ,Col2        INT IDENTITY NOT NULL
              ,Col3        INT NOT NULL
              CREATE CLUSTERED INDEX ix_cl ON #Temp(Col2)
              SET IDENTITY_INSERT #Temp ON;
              RAISERROR('Preparing to INSERT INTO #Temp...',0,1) WITH NOWAIT;
              INSERT INTO #Temp (Col1, Col2, Col3)
              SELECT 1,2,3
              RAISERROR('Insert Success!!!',0,1) WITH NOWAIT;
              SET IDENTITY_INSERT #Temp OFF;
    In SQL Server 2014, If I execute this (EXEC dbo.SGTEST_TBD_20141030)   It works.   If I execute it a second time - It fails hard with: 
            Msg 0, Level 11, State 0, Line 0
            A severe error occurred on the current command.  The results, if any, should be discarded.
            Msg 0, Level 20, State 0, Line 0
            A severe error occurred on the current command.  The results, if any, should be discarded.
    In SQL Server 2012, I can execute it over and over, with no problem.  I've discovered two work-a-rounds:   
    1) Add "WITH RECOMPILE" to the SP CREATE/ALTER statement, or 
    2) Declare the cluster index in the TABLE CREATE statement, e.g. ",UNIQUE CLUSTERED (COL2)" 
    This second option only works though, if the column is unique.    I've opted for the "WITH RECOMPILE" for now.  But, thought I should share.

    Hi,
    I did not get any error Message:
             CREATE TABLE #Temp
               Col1        INT NULL
              ,Col2        INT IDENTITY NOT NULL
              ,Col3        INT NOT NULL
              CREATE CLUSTERED INDEX ix_cl ON #Temp(Col2)
              SET IDENTITY_INSERT #Temp ON;
              RAISERROR('Preparing to INSERT INTO #Temp...',0,1) WITH NOWAIT;
              INSERT INTO #Temp (Col1, Col2, Col3)
              SELECT 1,2,3
              RAISERROR('Insert Success!!!',0,1) WITH NOWAIT;
              SET IDENTITY_INSERT #Temp OFF;
    SELECT * FROM #Temp
    OUTPUT:
    Col1 Col2
    Col3
    1 2 3
    1 2 3
    1 2 3
    Select @@version
    --Microsoft SQL Server 2012 (SP1) - 11.0.3000.0 (X64) 
    Oct 19 2012 13:38:57 
    Copyright (c) Microsoft Corporation
    Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)
    Thanks Shiven:) If Answer is Helpful, Please Vote

  • DB-Library BCP issue with SQL Server 2014

    Hello,
    My application uses DB-Library (ntwdblib.dll) to communicate with SQL Server 2014. We are having issues calling bcp related functions like bcp_init which always returns FAIL status. Our application was working fine with SQL Server 2012 and all other previous
    SQL releases. But we are getting below error in SQL 2014,
    msg 4801, state 1, severity 16 : Insert bulk is not supported over this access protocol.
    Can anyone please help ?
    Thanks,
    Himanshu

    Hi Himanshu_kus,
    Is this still an issue, or can we close the thread?
    [Personal Site] [Blog] [Facebook]

Maybe you are looking for

  • Sync more than one iphone in the same PC

    I have sync 3 iphones in my PC with 3 different Apple ID. Now when i try to sync mine, at the begining i can pass my photos to my pc although i can do this, the name of my phone is not present but i see the other phone names. I have make sign in/out

  • HP 7130 won't print in color

    I've installed the most recent driver from HP. Can get some of the printer's functionality but cannot print colors. Not sure if I'm missing a setting or if it is a problem with the HP driver for Leopard (as I've seen in other posts). Printer is conne

  • ATM to Gigabit Ethernet Migration

    Hi, How do you migrate from ATM to GE running a parallel backbone, from ELAN TO VLANS ? The ATM switches are Madge switches and the GE switches are 6509s. Any help is much appreciated. Thanks, Paul

  • Itunes App question

    I've got the new 5s, my phone is up to date with my Mac computer.  My itunes on my phone will not open.  I've tried restarting it already and that didn't work.  Is there any way to trouble shoot the Itunes application?

  • Modification of BOM Report! (CS03 )

    Dear Experts, Actually iam required to add an additional field in to a standard BOM Report i.e. CS03 In this report the requirement is to have the additional field for 'stock quantity' available. Now in order to accomplish this i need to have a custo