SQL Server 2012 Undetected Deadlock in a table with only one row

  We have migrated our SQL 2000 Enterprise Database to SQL 2012 Enterprise few days ago.
  This is our main database, so most of the applications access it.
  The day after the migration, when users started to run tasks, the database access started to experiment a total failure.
  That is, all processes in the SQL 2k12 database were in lock with each other. This is a commom case of deadlock, but the Database Engine was unable to detect it.
  After some research, we found that the applications were trying to access a very simple table with only one row. This table has a number that is restarted every day and is used to number all the transactions made against the system.   So, client
applications start a new transaction, get the current number, increment it by one and commit the transaction.
  The only solution we found was to kill all user processes in SQL Server every time this situation occurs (no more than 5 minutes when all clients are accessing the database).
  No client application was changed in this migration and this process was working very well for the last 10 years.
  The problem is that SQL 2k12 is unable to handle this situation compared to SQL 2k.
  It seems to occurs with other tables too, but as this is an "entry table" the problem occurs with it first.
  I have searched internet and some suggest some workarounds like using table hints to completely lock the table at the begining of the transaction, but it can't be used to other tables.
  Does anyone have heard this to be a problem with SQL 2k12? Is there any fixes to make SQL 2k12 as good as SQL 2k?

First off re: "Unfortunatelly, this can't be used in production environment as exclusive table lock would serialize the accesses to tables and there will be other tables that will suffer with this problem."
This is incorrect. 
Using a table to generate sequence numbers like this is a bad idea exactly because the access must be serialized.  Since you can't switch to a SEQUENCE object, which is the correct solution, the _entire goal_ of this exercise to find a way to properly
serialize access to this table.  Using exclusive locking will not be necessary for all the tables; just for the single-row table used for generating sequence values with a cursor.
I converted the sample program to VB.NET:
Public Class Form1
Private mbCancel As Boolean = False
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim soConn As ADODB.Connection
Dim soRst As ADODB.Recordset
Dim sdData As Date
Dim slValue As Long
Dim slDelay As Long
'create database vbtest
'go
' CREATE TABLE [dbo].[ControlNumTest](
' [UltData] [datetime] NOT NULL,
' [UltNum] [int] NOT NULL,
' CONSTRAINT [PK_CorreioNumTeste] PRIMARY KEY CLUSTERED
' [UltData] Asc
' )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 80) ON [PRIMARY]
' ) ON [PRIMARY]
mbCancel = False
Do
' Configure the Connection object
soConn = New ADODB.Connection
With soConn
.ConnectionString = "Provider=SQLNCLI11;Initial Catalog=vbtest;Data Source=localhost;trusted_connection=yes"
.IsolationLevel = ADODB.IsolationLevelEnum.adXactCursorStability
.Mode = ADODB.ConnectModeEnum.adModeReadWrite
.CursorLocation = ADODB.CursorLocationEnum.adUseServer
.Open()
End With
' Start a new transaction
Call soConn.BeginTrans()
' Configure the RecordSet object
soRst = New ADODB.Recordset
With soRst
.ActiveConnection = soConn
.CursorLocation = ADODB.CursorLocationEnum.adUseServer
.CursorType = ADODB.CursorTypeEnum.adOpenForwardOnly
.LockType = ADODB.LockTypeEnum.adLockPessimistic
.Open("SELECT * FROM dbo.ControlNumTest")
End With
With soRst
sdData = .Fields!UltData.Value ' Read the last Date (LOCK INFO 1: See comments bello
slValue = .Fields!UltNum.Value ' Read the last Number
If sdData <> Date.Now.Date Then ' Date has changed?
sdData = Date.Now.Date
slValue = 1 ' Restart number
End If
.Fields!UltData.Value = sdData ' Update data
.Fields!UltNum.Value = slValue + 1 ' Next number
End With
Call soRst.Update()
Call soRst.Close()
' Ends the transaction
Call soConn.CommitTrans()
Call soConn.Close()
soRst = Nothing
soConn = Nothing
txtUltNum.Text = slValue + 1 ' Display the last number
Application.DoEvents()
slDelay = Int(((Rnd * 250) + 100) / 100) * 100
System.Threading.Thread.Sleep(slDelay)
Loop While mbCancel = False
If mbCancel = True Then
Call MsgBox("The test was canceled")
End If
Exit Sub
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
mbCancel = True
End Sub
End Class
And created the table
CREATE TABLE [dbo].[ControlNumTest](
[UltData] [datetime] NOT NULL,
[UltNum] [int] NOT NULL,
CONSTRAINT [PK_CorreioNumTeste] PRIMARY KEY CLUSTERED
[UltData] Asc
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = on, FILLFACTOR = 80) ON [PRIMARY]
) ON [PRIMARY]
go insert into ControlNumTest values (cast(getdate()as date),1)
Then ran 3 copies of the program and generated the deadlock:
<deadlock>
<victim-list>
<victimProcess id="processf27b1498" />
</victim-list>
<process-list>
<process id="processf27b1498" taskpriority="0" logused="0" waitresource="KEY: 35:72057594039042048 (a01df6b954ad)" waittime="1970" ownerId="3181" transactionname="implicit_transaction" lasttranstarted="2014-02-14T15:49:31.263" XDES="0xf04da3a8" lockMode="X" schedulerid="4" kpid="9700" status="suspended" spid="51" sbid="0" ecid="0" priority="0" trancount="2" lastbatchstarted="2014-02-14T15:49:31.267" lastbatchcompleted="2014-02-14T15:49:31.267" lastattention="1900-01-01T00:00:00.267" clientapp="vbt" hostname="DBROWNE2" hostpid="21152" loginname="NORTHAMERICA\dbrowne" isolationlevel="read committed (2)" xactid="3181" currentdb="35" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128058">
<executionStack>
<frame procname="adhoc" line="1" stmtstart="80" sqlhandle="0x020000008376181f3ad0ea908fe9d8593f2e3ced9882f5c90000000000000000000000000000000000000000">
UPDATE [dbo].[ControlNumTest] SET [UltData]=@Param000004,[UltNum]=@Param000005 </frame>
<frame procname="unknown" line="1" sqlhandle="0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000">
unknown </frame>
</executionStack>
<inputbuf>
(@Param000004 datetime,@Param000005 int)UPDATE [dbo].[ControlNumTest] SET [UltData]=@Param000004,[UltNum]=@Param000005 </inputbuf>
</process>
<process id="processf6ac9498" taskpriority="0" logused="10000" waitresource="KEY: 35:72057594039042048 (a01df6b954ad)" waittime="1971" schedulerid="5" kpid="30516" status="suspended" spid="55" sbid="0" ecid="0" priority="0" trancount="1" lastbatchstarted="2014-02-14T15:49:31.267" lastbatchcompleted="2014-02-14T15:49:31.267" lastattention="1900-01-01T00:00:00.267" clientapp="vbt" hostname="DBROWNE2" hostpid="27852" loginname="NORTHAMERICA\dbrowne" isolationlevel="read committed (2)" xactid="3182" currentdb="35" lockTimeout="4294967295" clientoption1="671156256" clientoption2="128058">
<executionStack>
<frame procname="adhoc" line="1" sqlhandle="0x020000003c6309232ab0edbe0a7790a816a09c4c5ac6f43c0000000000000000000000000000000000000000">
FETCH API_CURSOR0000000000000001 </frame>
<frame procname="unknown" line="1" sqlhandle="0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000">
unknown </frame>
</executionStack>
<inputbuf>
FETCH API_CURSOR0000000000000001 </inputbuf>
</process>
</process-list>
<resource-list>
<keylock hobtid="72057594039042048" dbid="35" objectname="vbtest.dbo.ControlNumTest" indexname="PK_CorreioNumTeste" id="lockff6e6c80" mode="U" associatedObjectId="72057594039042048">
<owner-list>
<owner id="processf6ac9498" mode="S" />
<owner id="processf6ac9498" mode="U" requestType="wait" />
</owner-list>
<waiter-list>
<waiter id="processf27b1498" mode="X" requestType="convert" />
</waiter-list>
</keylock>
<keylock hobtid="72057594039042048" dbid="35" objectname="vbtest.dbo.ControlNumTest" indexname="PK_CorreioNumTeste" id="lockff6e6c80" mode="U" associatedObjectId="72057594039042048">
<owner-list>
<owner id="processf27b1498" mode="U" />
<owner id="processf27b1498" mode="U" />
<owner id="processf27b1498" mode="X" requestType="convert" />
</owner-list>
<waiter-list>
<waiter id="processf6ac9498" mode="U" requestType="wait" />
</waiter-list>
</keylock>
</resource-list>
</deadlock>
It's the S lock that comes from the cursor read that's the villian here.  U locks are compatible with S locks, so one session gets a U lock and another gets an S lock.  But then the session with an S needs a U, and the session with a U needs an
X.  Deadlock. 
I'm not sure what kind of locks were taken by this cursor code on SQL 2000, but on SQL 2012, this code is absolutely broken and should deadlock.
The right way to fix this code is to add (UPDLOCK,SERIALIZABLE) to the cursor
.Open("SELECT * FROM dbo.ControlNumTest with (updlock,serializable)")
So each session reads the table with a restrictive lock, and you don't mix S, U and X locks in this transaction.  This resolves the deadlock, but requires a code change.
I tried several things that didn't require a code, which did not resolve the deadlock;
1) setting ALLOW_ROW_LOCKS=OFF ALLOW_PAGE_LOCKS=OFF
2) SERIALIZABLE isolation level
3) Switching OleDB providers from SQLOLEDB to SQLNCLI11
Then I replaced the table with a view containing a lock hint:
CREATE TABLE [dbo].[ControlNumTest_t](
[UltData] [datetime] NOT NULL,
[UltNum] [int] NOT NULL,
CONSTRAINT [PK_CorreioNumTeste] PRIMARY KEY CLUSTERED
[UltData] Asc
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = on, FILLFACTOR = 80) ON [PRIMARY]
) ON [PRIMARY]
go
create view ControlNumTest as
select * from ControlNumTest_t with (tablockx)
Which, at least in my limited testing, resovlved the deadlock without any client code change.
David
David http://blogs.msdn.com/b/dbrowne/

Similar Messages

  • Select event not triggered in table with only one row

    Hi all,
    I am building a BI VC application where query data is displayed in a table. When the user clicks on a table row another query is then triggered and output in a second table. The output from table 1 is linked to the input of query2/table2 with a select event.
    The problem that I am facing is that if there is only one row in table 1, the select event is never triggered. If, however there are two or more rows in the table the select event is triggered and query 2 is executed. I have searched the forums but all I could find on select event problems was how to avoid the initial select event.
    Has anyone else experienced this issue and what is the workaround or is this a bug in Visual Composer? We are on VC 7.0 SP19.
    Cheers,
    Astein Meland

    Thanks Chittya,
    Yes we have considered this option as well. But as we have more than one table linked together we would like to avoid having to manually click several buttons.
    In the end I found Note 1364334 describing bugfixes released in VC 7.0 SP20:
    "Normally, when a Visual Composer table is populated from a data service, the first row is selected by default. However, we have found that if only one data row is returned from the data service, this row is not selected by default and cannot be manually selected by clicking on it either."
    So I think we will just have to upgrade our Portal to the latest support packs to solve this problem.
    Thanks,
    Astein

  • Number of Rows, displaying a table with only one row

    Hello,
    I am doing my first VC tests on the discovery System.
    I have an input form where I put in the username, then choose a user from a table and with the user ID I want to show the user details in another table.
    Now since I am only pickling one user, the new table will only have one row. In VC I cannot set the no. of rows to 1 though, since I cannot edit the no. of rows field. I also cannot disable the scroll buttons.
    Why is that?
    Is there another way to display user details? I tried to display it in read-only form, but it is pretty ugly.
    Another question regarding designing in VC:
    Are there any design elements in VC for example to group form fields that belong together? Let's say I have street name, number, postal code and so on, could I use a design element to group them under the label "Address" ?

    Peter,
    For some reason the No. of Rows and Scroll Buttons options are only available if your compiler is set to Web DynPro. Whenever you compile to Flash they're disabled.
    Regards
    Hennie

  • Declare the internal table with only one 10 character  field and use

    Hi,
    I want to declare the internal table with only one 10 character  field and use.
    Jaya

    Hi,
    Go ahead. U can declare IT with only one field
    Example:
    data: begin of zcustlist occurs 1000,
                   custmer(10)  type c,
             end of zcustlist.
    Narendra Reddy.
    Edited by: Narendra Reddy C on Aug 8, 2008 11:39 AM

  • Pages won't allow me to create a table with just one row.

    I'm trying to create a one row, two colum table in Pages. I have no problem with the columns. But I cannot create the table with just one row. Two rows apppears to be the minimum. Any ideas??

    In Pages 5.2, click the equal sign at bottom-left of table and reduce the row count to one.

  • 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.

  • Issue with Selection Listener when the table has only one row

    Hi All ,
    I have developed a table in which I am using Selection Listener to perform some task when any row is selected.
    It is working fine when I have more than 1 row in the table, but when I have only one row in the table , the selection listener do not call the corresponding method in bean.
    I understand that selection event will be raised only when the row is changed, but in the use case when only one row is there, what should be done to make the selection listener work ?
    In the selection listener I have written code to make the selected row as current row , and perform the required task.
    Please suggest a way out for this situation.
    Thanks in advance.

    Hi,
    try removing this attr from table
    selectedRowKeys="#{bindings.xxx_VO1.collectionModel.selectedRow}"

  • SQL Server 2012 Database Email is not working with AWS SES Services

    Hi Greetings to all,
    I have issue with the SQL Server Database mail Services. I have Configured Amazon Simple Email Services (AWS SES) as db profile in SQL Server and for last 2 years its working perfectly. But, from last two days on wards it is not working properly the Emails
    are queued but not sent to the recipients. the SES Services are working fine in outlook. but, not working in SQL Server. 
    Please help on this. tried changing the ports no result only one or two emails only sent remaining are failing.the info messages is as below
    Message
    The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 10 (2015-04-10T17:12:41). Exception Message: Cannot send mails to mail server. (The operation has timed out.).
    RehaanKhan. M

    Hello,
    Try to use port 465, port 2587 or port 587 instead of using port 25, as explained on the following articles.
    http://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-issues.html
    http://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-connect.html
    The first of above URLs is intended for troubleshooting SMTP issues in general.
    Verify you the mail account has not reached any limit. Limit of emails per day, per second, etc.
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Problem with creating an dynamic internal table with only one field.

    Hi,
    i create an internal table like this:
    FIELD-SYMBOLS: <GT_ITAB>      TYPE TABLE,
                   <GS_ITAB>,
                   <FS>.
    DATA: GT_DATA TYPE REF TO DATA.
    DATA: GS_DATA TYPE REF TO DATA.
    DATA: TABNAME   LIKE DD03L-TABNAME.
    DATA: FIELDNAME LIKE DD03L-FIELDNAME.
    DATA: TBFDNAM   TYPE TBFDNAM VALUE 'LFA1-NAME1'.
    SPLIT TBFDNAM AT '-' INTO TABNAME FIELDNAME.
    CREATE DATA GT_DATA TYPE TABLE OF (TABNAME).
    ASSIGN GT_DATA->* TO <GT_ITAB>.
    CREATE DATA GS_DATA  LIKE LINE OF <GT_ITAB>.
    ASSIGN GS_DATA->* TO <GS_ITAB>.
    SELECT * FROM (TABNAME) INTO CORRESPONDING FIELDS OF TABLE <GT_ITAB>.
      BREAK-POINT.
    it works OK.
    Now i want to create an internal table not like LFA1 but with LFA1-NAME1 Field TBFDNAM.
    It's not only LFA1-NAME1 it shell be the value of TBFDNAM.
    When i change
    CREATE DATA GT_DATA TYPE TABLE OF (TABNAME).
    to
    CREATE DATA GT_DATA TYPE TABLE OF ( TBFDNAM).
    i get an shortdump.
    Any idea?
    Regards, Dieter

    Hi Dieter,
    Your approach is ok, but it will create dynamic table without a structure of NAME1. Only the line type will be suitable (but field name will not exists -> hence the error in the select statement).
    In this case you need to create a dynamic table which structure consists of one field named NAME1.
    This code is the appropriate one:
    " your definitions
    DATA: tabname LIKE dd03l-tabname.
    DATA: fieldname LIKE dd03l-fieldname.
    DATA: tbfdnam TYPE tbfdnam VALUE 'LFA1-NAME1'.
    FIELD-SYMBOLS <gt_itab> TYPE table.
    "new ones
    DATA: it_fcat TYPE lvc_t_fcat WITH HEADER LINE.
    DATA: gt_itab TYPE REF TO data.
    " get table and fieldname
    SPLIT tbfdnam AT '-' INTO tabname fieldname.
    " create dynamic table with structure NAME1 (only one field)
    it_fcat-fieldname = fieldname.
    it_fcat-tabname = tabname.
    APPEND it_fcat.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
      EXPORTING
        it_fieldcatalog           = it_fcat[]
      IMPORTING
        ep_table                  = gt_itab
      EXCEPTIONS
        generate_subpool_dir_full = 1
        OTHERS                    = 2.
    CHECK sy-subrc = 0.
    " dereference table
    ASSIGN gt_itab->* TO <gt_itab>.
    " insert data only to NAME1 field
    SELECT * FROM (tabname) INTO CORRESPONDING FIELDS OF TABLE <gt_itab>.
    I checked, this works fine:)
    Regards
    Marcin

  • SQL Server 2012 Express error 9002 while restoring a backup from 2008

    Hi all,
    I have installed SQL Server 2012 Express on my laptop operating with win 8. Then I took the backup in my old laptop with SQL Server 2008R Express / Windows 7 and tried to restore it to the new one.
    After it restored it produced an error messaging saying that restore failed. The error code was 9002 and it says due to NOTHING. I checked the log file it is a file of 1024 kb size, not big. When I installed the SQL 2012 I disabled the autogrowth of the
    log file (exactly same setting as I had with 2008) The log is not big. I tried to further shrink, no change.
    Moreover the db is already there with full records, I can manipulate it.  Even take a back w/o problems. What is this issue? Is it resolved?
    thanks

    an error messaging saying that restore failed. The error code was 9002
    and it says due to NOTHING. I
    select *
    from sys.messages
    where message_id = 9002
    => "The transaction log for database '%ls' is full due to '%ls'. "
    Is your disk may low on free space?
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Finalizing SQL Server 2012 SP2 update

    Hi,
       I just successfully upgraded SQL Server 2012 Developer Edition from SP1 CU8 to SP2.
       Here is the actual portrait I have in my control panel (Installed programs + version):
           Version changed after SP2 update (through Windows Update):
             Microsoft SQL Server 2012 Express LocalDB                          11.2.5058.0
            Microsoft SQL Server 2012 Transact-SQL ScriptDom              11.2.5058.0
            Microsoft SQL Server 2012 Transact-SQL Compiler Service    11.2.5058.0
            Microsoft SQL Server 2012 Native Client                                11.2.5058.0
            Microsoft SQL Server 2012 Policies                                        
    11.2.5058.0
            Microsoft SQL Server 2012 Setup (English)                            11.2.5058.0
            Microsoft VSS Writer for SQL Server 2012                              11.2.5058.0
            Microsoft System CLR Types for SQL Server 2012                  11.2.5058.0
            SQL Server Browser for SQL Server 2012                               11.2.5058.0
          Version changed only after installing corresponding Features Pack component:
             Microsoft SQL Server 2012 T-SQL Language Service              11.2.5058.0    
             SQL Server Report Builder 3 for SQL Server 2012                  11.2.5058.0
             Microsoft SQL Server 2012 Management Objects                   11.2.5058.0
          Version did not change:
             Microsoft SQL Server System CLR Types                                10.51.2500.0
             Microsoft SQL Server 2012 Data-Tier App Framework            11.1.2902.0
    My questions:
    1. Am I missing any components update or is my actual SP2 setup OK?
    2. Even if I tried to install DACFramework SP2 Feature pack by running corresponding installer, it told me that I had an higher version...  Does any of you have a different version number for this component?
    3. I actually have SSDT for VS2010 installed.  The corresponding versions I actually have are the following:
               Microsoft SQL Server Data Tools 2010                                 
    10.3.31009.2
               Microsoft SQL Server Data Tools - enu                                 
    10.3.31009.2
               Microsoft SQL Server Data Tools Build Utilities - enu             10.3.31009.2
        Should I consider upgrading any component so they work with SQL 2012 SP2 properly?  If so, could someone provide me the corresponding download/webpage links?
    4. Finally, should I upgrade to CU2 which is actually available. Among other problems, I notice that it should fix an index rebuild problem.  Any other major issues it targets?  Is there any easy way I can test if I should install this update or
    not?
    Thanks for helping.

    Hi again,
      I knew I was at SP2 level now.  My request is more about the Features Pack components as well as the CU2 which is actually out:
    1- Features Pack components that I couldn't update:
             Microsoft SQL Server System CLR Types                                10.51.2500.0    
    --> presume was for VS2008
             Microsoft SQL Server 2012 Data-Tier App Framework            11.1.2902.0       --> is this the real last version?
    2- SQL Server Data Tools vs Visual Studio 2010 SP1 + SQL Server 2012 SP2
               Microsoft SQL Server Data Tools 2010                                 
    10.3.31009.2
               Microsoft SQL Server Data Tools - enu                                 
    10.3.31009.2
               Microsoft SQL Server Data Tools Build Utilities - enu             10.3.31009.2
        Do I have the last versions possible (VS2010) or should I update something?
    3- SQL Server 2012 SP2 CU2
        What simple test can I do in order to verify if I really need to install this patch or not?
    Thanks for helping!

  • When I use framing in SQL Server 2012 express, error occurred

    Hello, everyone,
    I met a error when I use framing in the SQL Server 2012 Express. Could you help me, thank you!
    the query is:
    SELECT custid, orderid, orderdate, val,
    SUM(val) OVER(PARTITION BY custid
    ORDER BY orderdate, orderid
    ROWS BETWEEN UNBOUNDED PRECEDING
    AND CURRENT ROW) AS runningtotal
    FROM Sales.OrderValues;
    And the error information is:
    Msg 102, Level 15, State 1, Line 4
    Incorrect syntax near 'ROWS'.
    Thank you!

    Hello,
    If you run that statement on SQL Server 2012 (or later), you won’t receive any errors.
    I receive that error message only when I run that statement on SQL Server 2008.
    I didn't try with SQL Server 2012 Express though. I tested with a SQL Server 2012 Standard Edition instance with SP1 CU2, and your statement works.
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • SQL Server 2012 Developer Edition Installation Problem

    Hi,
    I have just been given a new PC by my IT department so am trying to get all the software I need onto the PC. Since I am now running windows 7 I wanted to try SQL Server 2012, however whenever I go to install it, one of the checks always fails as follows:-
    SetupCompatibilityCheck
    Checks whether the current version of SQL Server is compatible with a later installed version.
    This version is not compatible with a later installed version. For more information, see the compatibility information at http://go.microsoft.com/fwlink/?LinkId=160850.
    All other checks are successful but no matter whether I use the MSDN disc the software is on or the downloaded copy, the software doesn't seem to like my PC. I don't understand how the software can believe there is something
    newer than SQL Server 2012 on the system. When I run the discovery tool elsewhere in the installer it reports that nothing is installed.
    Is anyone able to give me some information on what might be triggering this? I did install Visual Studio 2008 and Visual Studio 2010 on the system prior to this, as well as SQL Server 2008 R2, but I have since removed all of these products again in order
    to try and identify the cause of this problem. Now with nothing left on the system again, it still reports this same error. Could it be something is left over from those installations that is causing this problem? 
    Any help would be much appreciated
    Regards
    Paul

    (07) 2012-08-14 09:04:37 Slp: Initializing rule      : SQL Server Setup Product Incompatibility
    (07) 2012-08-14 09:04:37 Slp: Rule is will be executed  : True
    (07) 2012-08-14 09:04:37 Slp: Init rule target object: Microsoft.SqlServer.Configuration.SetupExtension.SetupCompatibilityCheck
    (07) 2012-08-14 09:04:37 Slp: Sco: Attempting to create base registry key HKEY_LOCAL_MACHINE, machine
    (07) 2012-08-14 09:04:37 Slp: Value cannot be null.
    Parameter name: version
    (07) 2012-08-14 09:04:37 Slp:    at System.Version..ctor(String version)
       at Microsoft.SqlServer.Configuration.SetupExtension.SetupCompatibilityCheck.Microsoft.SqlServer.Configuration.RulesEngineExtension.IRuleInitialize.Init(String ruleId)
       at Microsoft.SqlServer.Configuration.RulesEngineExtension.RulesEngine.Execute(Boolean stopOnFailure)
    (07) 2012-08-14 09:04:37 Slp: Rule initialization failed - hence the rule result is assigned as Failed
    Hi Paul,
    Any progress?
    This issue you met may be due to there are still registry keys left related to the SQL Server, even though we have uninstalled the SQL Server.
    To fix the issue, we can remove the left keys manually:
    1. Click 'Start' > 'Run' > type 'regedit' > press Enter key.
    2. Backup this registry keys that related to SQL Server under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
    3. Delete keys that relate to SQL Server under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall.
    4. Restart the setup installation.
    If you have any problem, please feel free to let me know.
    Thanks,
    Maggie
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.

  • SQL Server 2012 with Visual Studio 2013 with SSIS/Integration services project?

    I wanted to build an integration services project to import data from multiple sources using a vendor's API.
    I wish I could recall how I got to the point where I was able to build one and have it run successfully, but I had to install so many things that I honestly don't remember.
    However, I noticed my PC booting really slowly after that, and I saw that I had components of VS 2010, VS 2012 and VS 2013 installed, along with SQL Server 2008 and 2012.  So I uninstalled a bunch of stuff, hoping to get to where I had only the most
    current versions of all, that were compatible with my corporate environment.  So I was aiming for Visual Studio 2013 (Premium, I think) and SQL Server 2012.
    Took me 2 days.  Now I'm at the point where I think - and I'm here to learn if I'm correct - that I cannot get an oData Source component into my project and use VS 2013 IF I want to stick with Sql Server 2012.  Is that correct?  
    I get very confused when trying to determine how the acronyms relate:  SSIS, SSDT, SSDT-BI, etc.

    Hi Anonymous11847,
    SSDT: Microsoft SQL Server Data Tools for Visual Studio 2010, it contains Business Intelligence project templates for Analysis Services, Integration Services, and Reporting Services that support Visual Studio 2010. This can be installed when SQL Server is
    installed. It supports various SQL Server versions as follows:
    SSAS projects can target SQL Server 2012 or lower
    SSRS projects can target SQL Server 2012 or lower
    SSIS projects can target only SQL Server 2012
    SSDT-BI for VS 2012: Microsoft SQL Server Data Tools - Business Intelligence for Visual Studio 2012, it contains Business Intelligence project templates for Analysis Services, Integration Services, and Reporting Services that support Visual Studio 2012.
    This needs to be separately downloaded and installed. It supports various SQL Server versions as follows:
    SSAS projects can target SQL Server 2012 or lower
    SSRS projects can target SQL Server 2012 or lower
    SSIS projects can target only SQL Server 2012
    SSDT-BI for VS 2013: Microsoft SQL Server Data Tools - Business Intelligence for Visual Studio 2013, it contains Business Intelligence project templates for Analysis Services, Integration Services, and Reporting Services that support Visual Studio 2013.
    This needs to be separately downloaded and installed. It supports various SQL Server versions as follows:
    SSAS projects can target SQL Server 2014 or lower
    SSRS projects can target SQL Server 2014 or lower
    SSIS projects can target only SQL Server 2014
    So if the SQL Server version is SQL Server 2012, we should install SSDT or SSDT-BI for VS2012 to create SSIS project.
    Reference:
    Microsoft SQL Server Data Tools Update
    If there are any other questions, please feel free to ask.
    Thanks,
    Kathrine Xiong
    Katherine Xiong
    TechNet Community Support

  • SQL Server 2012 Install Failure

    I am attempting to install SQL Server 2012 Developer Edition with SP1 as a standalone installation.  This is the downloaded version.  en_sql_server_2012_developer_edition_with_sp1_x64_dvd_1228540
    Here is my environment.  Windows 7 X64, SQL Server 2008 R2 Developer Edition,
    I've tried to bypass the update step by executing as:  "setup.exe /ACTION=Install /UpdateEnabled=False".  While this did eliminate the two KB downloads, the same error still occurred.
    I've extracted the ISO to my local machine and attempted the install according to another thread.  Still no joy.
    I installed a hotfix recommended by another thread but still no joy.  System Update Readiness Tool for Windows 7 for x64-based Systems (KB947821) [August 2013]
    The Error occurrs in pop-up during Product Updates. 
    2 updates found
    SQL Server 2012 SP1 GDR Product Update  145MB  KB2793634
    SQL Server 2012 SP1 GDR Setup Update  26MB  KB2793634 
    ERRORS
    TITLE: Microsoft SQL Server 2012 Service Pack 1 Setup
    The following error has occurred:
    An error occurred during the installation of assembly 'policy.8.0.Microsoft.VC80.ATL,version="8.0.50727.6229",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="amd64",type="win32-policy"'. Please refer to Help
    and Support for more information. HRESULT: 0x800736B3.
    For help, click:
    http://go.microsoft.com/fwlink?LinkID=20476&ProdName=Microsoft%20SQL%20Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3000.0&EvtType=0xDF039760%25401201%25401
    BUTTONS:
    OK
    TITLE: Microsoft SQL Server 2012 Service Pack 1 Setup
    The following error has occurred:
    SQL Server Setup has encountered an error when running a Windows Installer file.
    Windows Installer error message: An error occurred during the installation of assembly 'policy.8.0.Microsoft.VC80.ATL,version="8.0.50727.6229",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="amd64",type="win32-policy"'.
    Please refer to Help and Support for more information. HRESULT: 0x800736B3.
    Windows Installer file: C:\Users\jhadden\AppData\Local\Temp\SQL Server 2012\Setup\1033_ENU_LP\x64\setup\sqlsupport_msi\SqlSupport.msi
    Windows Installer log file: C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20131010_091212\SqlSupport_Cpu64_1_ComponentUpdate.log
    Click 'Retry' to retry the failed action, or click 'Cancel' to cancel this action and continue setup.
    For help, click:
    http://go.microsoft.com/fwlink?LinkID=20476&ProdName=Microsoft%20SQL%20Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3000.0&EvtType=0xDC80C325
    BUTTONS:
    &Retry
    Cancel

    Hello,
    Did you install Windows 7 update SP1? If not, please install the SP1 update first.
    What's more, you try to install SQL Server 2012 SP1 together with SP1 Cumulative update (KB2793634)by enable the "UpdateEnabled" and specify the update feature in "UPDATESOURCE".
    You can refer to Ahmed's blog for more details steps:
    http://blogs.msdn.com/b/ai/archive/2013/01/14/installing-sql-server-2012-service-pack-1-sp1-cumulative-update-in-one-installation-using-sql-server-2012-product-update.aspx
    Regards,
    Fanny Liu
    If you have any feedback on our support, please click here.
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

Maybe you are looking for

  • Enhance GRC issue status report columns

    Hello GRC Gurus I am new to GRC application and I have a requirement to enhance u201CIssue Statusu201D report  fields. Process: Goto -> Report Center - > "Issue status" Report -> run based on the condition. It will display ll the issue report in a AL

  • Twitter favourite notifications persist even after I've tapped them

    New to the iPhone and loving it so far - but I have this problem with Twitter notifications.  As the subject line says, when someone's favourited my Tweets the notifications persist even after I've tapped them and gone into the twitter app. Other Twi

  • Home folder location

    In our lab environment we have local home folders for all users, but the home folder name does NOT equal the short name of the user who logins. For example, the home folder in Users is called Local HomeDir. The user who authenticated ldap and logs in

  • IPhoto 6 will not delete pictures anymore!!

    This is a very recent problem...I use to delete a picture while I'm in the "Library" then I'll empty the Trash in iPhoto. Then when I went into the "Finder" window the picture would be deleted....all is fine But now when I go through the same process

  • F4 help taking more time

    Hello All, While selecting vendor from variable selection screen of a query is taking lot of time and finally ends with an error message " program terminated". When i execute query and try selecting vendor from selection screen i am able to select bu