Oct 10, 2007
Hi,
I noted some strange errors on my server log (SQL 2005):
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
Date,Source,Severity,Message
10/02/2007 09:15:24,Server,Unknown,A user request from the session with SPID 191 generated a fatal exception. SQL Server is terminating this session. Contact Product Support Services with the dump produced in the log directory.
10/02/2007 09:15:24,Server,Unknown,Error: 17310<c/> Severity: 20<c/> State: 1.
10/02/2007 09:15:24,spid191,Unknown,External dump process return code 0x20000001.<nl/>External dump process returned no errors.
10/02/2007 09:15:23,spid191,Unknown,Stack Signature for the dump is 0x724D13B0
10/02/2007 09:15:23,spid191,Unknown,78132A36 Module(MSVCR80+00002A36)
10/02/2007 09:15:23,spid191,Unknown,781329AA Module(MSVCR80+000029AA)
10/02/2007 09:15:23,spid191,Unknown,010D83F0 Module(sqlservr+000D83F0)
10/02/2007 09:15:23,spid191,Unknown,010D746E Module(sqlservr+000D746E)
10/02/2007 09:15:23,spid191,Unknown,010D7B71 Module(sqlservr+000D7B71)
10/02/2007 09:15:23,spid191,Unknown,010D764A Module(sqlservr+000D764A)
10/02/2007 09:15:23,spid191,Unknown,010086E7 Module(sqlservr+000086E7)
10/02/2007 09:15:23,spid191,Unknown,010089C5 Module(sqlservr+000089C5)
10/02/2007 09:15:23,spid191,Unknown,0100889F Module(sqlservr+0000889F)
10/02/2007 09:15:23,spid191,Unknown,01041C35 Module(sqlservr+00041C35)
10/02/2007 09:15:23,spid191,Unknown,010438E5 Module(sqlservr+000438E5)
10/02/2007 09:15:23,spid191,Unknown,0102C5F8 Module(sqlservr+0002C5F8)
10/02/2007 09:15:23,spid191,Unknown,011D37E7 Module(sqlservr+001D37E7)
10/02/2007 09:15:23,spid191,Unknown,01BDBEB6 Module(sqlservr+00BDBEB6)
10/02/2007 09:15:23,spid191,Unknown,013C6DB8 Module(sqlservr+003C6DB8)
10/02/2007 09:15:23,spid191,Unknown,01C11D65 Module(sqlservr+00C11D65)
10/02/2007 09:15:23,spid191,Unknown,0102C5F8 Module(sqlservr+0002C5F8)
10/02/2007 09:15:23,spid191,Unknown,011D37E7 Module(sqlservr+001D37E7)
10/02/2007 09:15:23,spid191,Unknown,01BDBEB6 Module(sqlservr+00BDBEB6)
10/02/2007 09:15:23,spid191,Unknown,0103D0C6 Module(sqlservr+0003D0C6)
10/02/2007 09:15:23,spid191,Unknown,0103D23D Module(sqlservr+0003D23D)
10/02/2007 09:15:23,spid191,Unknown,0103D2FE Module(sqlservr+0003D2FE)
10/02/2007 09:15:23,spid191,Unknown,0103D441 Module(sqlservr+0003D441)
10/02/2007 09:15:23,spid191,Unknown,010784B4 Module(sqlservr+000784B4)
10/02/2007 09:15:23,spid191,Unknown,01E22809 Module(sqlservr+00E22809)
10/02/2007 09:15:23,spid191,Unknown,01E28713 Module(sqlservr+00E28713)
10/02/2007 09:15:23,spid191,Unknown,01E15AA8 Module(sqlservr+00E15AA8)
10/02/2007 09:15:23,spid191,Unknown,01E15B68 Module(sqlservr+00E15B68)
10/02/2007 09:15:23,spid191,Unknown,0102E827 Module(sqlservr+0002E827)
10/02/2007 09:15:23,spid191,Unknown,019E9DEB Module(sqlservr+009E9DEB)
10/02/2007 09:15:23,spid191,Unknown,01DA687B Module(sqlservr+00DA687B)
10/02/2007 09:15:23,spid191,Unknown,01DA9914 Module(sqlservr+00DA9914)
10/02/2007 09:15:23,spid191,Unknown,010D3CAC Module(sqlservr+000D3CAC)
10/02/2007 09:15:23,spid191,Unknown,010040C2 Module(sqlservr+000040C2)
10/02/2007 09:15:23,spid191,Unknown,01002C90 Module(sqlservr+00002C90)
10/02/2007 09:15:23,spid191,Unknown,* Short Stack Dump
10/02/2007 09:15:23,spid191,Unknown,* -------------------------------------------------------------------------------
10/02/2007 09:15:23,spid191,Unknown,* *******************************************************************************
10/02/2007 09:15:23,spid191,Unknown,* SegSs: 0000002B:
10/02/2007 09:15:23,spid191,Unknown,* Esp: 1054EBAC: 00000038 C02280E8 00000001 00000000 00000000 1054EBE4
10/02/2007 09:15:23,spid191,Unknown,* EFlags: 00010246: 0057005C 004E0049 004F0044 00530057 0073005C 00730079
10/02/2007 09:15:23,spid191,Unknown,* SegCs: 00000023:
10/02/2007 09:15:23,spid191,Unknown,* Ebp: 1054EBC0: 1054EBE4 010040C2 0000096C FFFFFFFF 1054EC10 00000000
10/02/2007 09:15:23,spid191,Unknown,* Eip: 01002C90: 0AB10FF0 850FC085 0005BAD0 0F003B83 0013C685 0C7D8300
10/02/2007 09:15:23,spid191,Unknown,* Edx: 00000028:
10/02/2007 09:15:23,spid191,Unknown,* Ecx: 0000096C:
10/02/2007 09:15:23,spid191,Unknown,* Ebx: 00000020:
10/02/2007 09:15:23,spid191,Unknown,* Eax: 00000000:
10/02/2007 09:15:23,spid191,Unknown,* Esi: C02280E8: 00000000 00000000 BAA660F0 CF2BC0F0 00000001 009C61F0
10/02/2007 09:15:23,spid191,Unknown,* Edi: 00000028:
10/02/2007 09:15:23,spid191,Unknown,*
10/02/2007 09:15:23,spid191,Unknown,* dbghelp 0D190000 0D2A7FFF 00118000
10/02/2007 09:15:23,spid191,Unknown,* MSVCR71 7C340000 7C395FFF 00056000
10/02/2007 09:15:23,spid191,Unknown,* XPMetaphone 0DD00000 0DD07FFF 00008000
10/02/2007 09:15:23,spid191,Unknown,* xplog70 0DE00000 0DE02FFF 00003000
10/02/2007 09:15:23,spid191,Unknown,* xplog70 0DD20000 0DD2BFFF 0000c000
10/02/2007 09:15:23,spid191,Unknown,* xpsqlbot 0EA50000 0EA55FFF 00006000
10/02/2007 09:15:23,spid191,Unknown,* xpstar90 0DC00000 0DC25FFF 00026000
10/02/2007 09:15:23,spid191,Unknown,* SQLSVC90 0DBF0000 0DBF2FFF 00003000
10/02/2007 09:15:23,spid191,Unknown,* odbcint 0DBD0000 0DBE6FFF 00017000
10/02/2007 09:15:23,spid191,Unknown,* ATL80 7C630000 7C64AFFF 0001b000
10/02/2007 09:15:23,spid191,Unknown,* SqlResourceLoader 0D8F0000 0D8F5FFF 00006000
10/02/2007 09:15:23,spid191,Unknown,* SQLSVC90 0D8C0000 0D8D9FFF 0001a000
10/02/2007 09:15:23,spid191,Unknown,* BatchParser90 0D890000 0D8ADFFF 0001e000
10/02/2007 09:15:23,spid191,Unknown,* ODBC32 0D850000 0D88CFFF 0003d000
10/02/2007 09:15:23,spid191,Unknown,* SQLSCM90 0D830000 0D838FFF 00009000
10/02/2007 09:15:23,spid191,Unknown,* xpstar90 0D7D0000 0D814FFF 00045000
10/02/2007 09:15:23,spid191,Unknown,* msxml3 72E50000 72F61FFF 00112000
10/02/2007 09:15:23,spid191,Unknown,* msxml2 0B7E0000 0B88EFFF 000af000
10/02/2007 09:15:23,spid191,Unknown,* msxmlsql 78800000 788DEFFF 000df000
10/02/2007 09:15:23,spid191,Unknown,* msftepxy 09790000 097A4FFF 00015000
10/02/2007 09:15:23,spid191,Unknown,* SQLNCLIR 095D0000 09602FFF 00033000
10/02/2007 09:15:23,spid191,Unknown,* comdlg32 762B0000 762F9FFF 0004a000
10/02/2007 09:15:23,spid191,Unknown,* COMCTL32 77530000 775C6FFF 00097000
10/02/2007 09:15:23,spid191,Unknown,* sqlncli 337A0000 339BDFFF 0021e000
10/02/2007 09:15:23,spid191,Unknown,* CLBCatQ 777B0000 77832FFF 00083000
10/02/2007 09:15:23,spid191,Unknown,* xpsp2res 10000000 102C4FFF 002c5000
10/02/2007 09:15:23,spid191,Unknown,* ntdsapi 766F0000 76704FFF 00015000
10/02/2007 09:15:23,spid191,Unknown,* SAMLIB 094A0000 094AEFFF 0000f000
10/02/2007 09:15:23,spid191,Unknown,* NTMARTA 77E00000 77E21FFF 00022000
10/02/2007 09:15:23,spid191,Unknown,* dssenh 094B0000 094D3FFF 00024000
10/02/2007 09:15:23,spid191,Unknown,* imagehlp 76C10000 76C38FFF 00029000
10/02/2007 09:15:23,spid191,Unknown,* WINTRUST 76BB0000 76BDAFFF 0002b000
10/02/2007 09:15:23,spid191,Unknown,* dbghelp 09130000 09247FFF 00118000
10/02/2007 09:15:23,spid191,Unknown,* msfte 08ED0000 09127FFF 00258000
10/02/2007 09:15:23,spid191,Unknown,* security 71F60000 71F63FFF 00004000
10/02/2007 09:15:23,spid191,Unknown,* rasadhlp 76F80000 76F84FFF 00005000
10/02/2007 09:15:23,spid191,Unknown,* wshtcpip 07DB0000 07DB7FFF 00008000
10/02/2007 09:15:23,spid191,Unknown,* hnetcfg 07D10000 07D68FFF 00059000
10/02/2007 09:15:23,spid191,Unknown,* WLDAP32 76F10000 76F3DFFF 0002e000
10/02/2007 09:15:23,spid191,Unknown,* winrnr 76F70000 76F76FFF 00007000
10/02/2007 09:15:23,spid191,Unknown,* DNSAPI 76ED0000 76EF8FFF 00029000
10/02/2007 09:15:23,spid191,Unknown,* WSOCK32 07AD0000 07AD8FFF 00009000
10/02/2007 09:15:23,spid191,Unknown,* VERSION 77B90000 77B97FFF 00008000
10/02/2007 09:15:23,spid191,Unknown,* MTXCLU 74F40000 74F58FFF 00019000
10/02/2007 09:15:23,spid191,Unknown,* msvcp60 07A60000 07AC4FFF 00065000
10/02/2007 09:15:23,spid191,Unknown,* MSDTCPRX 079E0000 07A57FFF 00078000
10/02/2007 09:15:23,spid191,Unknown,* XOLEHLP 079D0000 079D5FFF 00006000
10/02/2007 09:15:23,spid191,Unknown,* COMRES 77010000 770D5FFF 000c6000
10/02/2007 09:15:23,spid191,Unknown,* schannel 76750000 76776FFF 00027000
10/02/2007 09:15:23,spid191,Unknown,* cryptdll 766E0000 766EBFFF 0000c000
10/02/2007 09:15:23,spid191,Unknown,* Kerberos 71CA0000 71CF7FFF 00058000
10/02/2007 09:15:23,spid191,Unknown,* iphlpapi 76CF0000 76D09FFF 0001a000
10/02/2007 09:15:23,spid191,Unknown,* msv1_0 76C90000 76CB6FFF 00027000
10/02/2007 09:15:23,spid191,Unknown,* msnsspc 71E20000 71E6FFFF 00050000
10/02/2007 09:15:23,spid191,Unknown,* MSVCRT40 78080000 78090FFF 00011000
10/02/2007 09:15:23,spid191,Unknown,* msapsspc 71E00000 71E13FFF 00014000
10/02/2007 09:15:23,spid191,Unknown,* MSCOREE 79000000 79044FFF 00045000
10/02/2007 09:15:23,spid191,Unknown,* AUTHZ 76C40000 76C53FFF 00014000
10/02/2007 09:15:23,spid191,Unknown,* rsaenh 06450000 0647EFFF 0002f000
10/02/2007 09:15:23,spid191,Unknown,* SQLOS 344D0000 344D4FFF 00005000
10/02/2007 09:15:23,spid191,Unknown,* sqlevn70 4F610000 4F7A0FFF 00191000
10/02/2007 09:15:23,spid191,Unknown,* RESUTILS 74EF0000 74F02FFF 00013000
10/02/2007 09:15:23,spid191,Unknown,* OLEAUT32 77D00000 77D8BFFF 0008c000
10/02/2007 09:15:23,spid191,Unknown,* ole32 77670000 777A3FFF 00134000
10/02/2007 09:15:23,spid191,Unknown,* CLUSAPI 74DE0000 74DF1FFF 00012000
10/02/2007 09:15:23,spid191,Unknown,* instapi 48060000 48069FFF 0000a000
10/02/2007 09:15:23,spid191,Unknown,* psapi 76B70000 76B7AFFF 0000b000
10/02/2007 09:15:23,spid191,Unknown,* comctl32 7DBD0000 7DCD2FFF 00103000
10/02/2007 09:15:23,spid191,Unknown,* SHLWAPI 77DA0000 77DF1FFF 00052000
10/02/2007 09:15:23,spid191,Unknown,* SHELL32 7C8D0000 7D0D2FFF 00803000
10/02/2007 09:15:23,spid191,Unknown,* NETAPI32 71C40000 71C97FFF 00058000
10/02/2007 09:15:23,spid191,Unknown,* opends60 333E0000 333E6FFF 00007000
10/02/2007 09:15:23,spid191,Unknown,* USERENV 76920000 769E3FFF 000c4000
10/02/2007 09:15:23,spid191,Unknown,* WS2HELP 71BF0000 71BF7FFF 00008000
10/02/2007 09:15:23,spid191,Unknown,* WS2_32 71C00000 71C16FFF 00017000
10/02/2007 09:15:23,spid191,Unknown,* MSWSOCK 7DB30000 7DBAFFFF 00080000
10/02/2007 09:15:23,spid191,Unknown,* Secur32 7D8D0000 7D91FFFF 00050000
10/02/2007 09:15:23,spid191,Unknown,* MSASN1 76190000 761A1FFF 00012000
10/02/2007 09:15:23,spid191,Unknown,* CRYPT32 761B0000 76242FFF 00093000
10/02/2007 09:15:23,spid191,Unknown,* GDI32 7D800000 7D88FFFF 00090000
10/02/2007 09:15:23,spid191,Unknown,* USER32 7D930000 7D9FFFFF 000d0000
10/02/2007 09:15:23,spid191,Unknown,* RPCRT4 7DA20000 7DAFFFFF 000e0000
10/02/2007 09:15:23,spid191,Unknown,* ADVAPI32 77F50000 77FEBFFF 0009c000
10/02/2007 09:15:23,spid191,Unknown,* MSVCP80 7C420000 7C4A6FFF 00087000
10/02/2007 09:15:23,spid191,Unknown,* msvcrt 77BA0000 77BF9FFF 0005a000
10/02/2007 09:15:23,spid191,Unknown,* MSVCR80 78130000 781CAFFF 0009b000
10/02/2007 09:15:23,spid191,Unknown,* kernel32 7D4C0000 7D5EFFFF 00130000
10/02/2007 09:15:23,spid191,Unknown,* ntdll 7D600000 7D6EFFFF 000f0000
10/02/2007 09:15:23,spid191,Unknown,* sqlservr 01000000 02BA7FFF 01ba8000
10/02/2007 09:15:23,spid191,Unknown,* MODULE BASE END SIZE
10/02/2007 09:15:23,spid191,Unknown,*
10/02/2007 09:15:23,spid191,Unknown,*
10/02/2007 09:15:23,spid191,Unknown,* TableConfig where number = 186
10/02/2007 09:15:23,spid191,Unknown,* 4240-8be7-b3e5e3a0398e";Local Database="db_name"select val from dbo.Tab
10/02/2007 09:15:23,spid191,Unknown,* c8faa7889b9e53cd3d8b#198;Service="SqlQueryNotificationService-70595aa0-5133-
10/02/2007 09:15:23,spid191,Unknown,* #362; #154;180f615b-9449-472b-bea0-64a372ffd178;c39a6e91984467e28bf6
10/02/2007 09:15:23,spid191,Unknown,* Input Buffer 496 bytes -
10/02/2007 09:15:23,spid191,Unknown,* Access Violation occurred writing address 00000028
10/02/2007 09:15:23,spid191,Unknown,* Exception Code = c0000005 EXCEPTION_ACCESS_VIOLATION
10/02/2007 09:15:23,spid191,Unknown,* Exception Address = 01002C90 Module(sqlservr+00002C90)
10/02/2007 09:15:23,spid191,Unknown,*
10/02/2007 09:15:23,spid191,Unknown,*
10/02/2007 09:15:23,spid191,Unknown,* 10/02/07 09:15:23 spid 191
10/02/2007 09:15:23,spid191,Unknown,* BEGIN STACK DUMP:
10/02/2007 09:15:23,spid191,Unknown,*
10/02/2007 09:15:23,spid191,Unknown,* *******************************************************************************
10/02/2007 09:15:23,spid191,Unknown,SqlDumpExceptionHandler: Process 191 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.
10/02/2007 09:15:23,spid191,Unknown,***Stack Dump being sent to d:Microsoft SQL ServerMSSQL.1MSSQLLOGSQLDump2875.txt
10/02/2007 09:15:22,spid191,Unknown,Using 'dbghelp.dll' version '4.0.5'
10/02/2007 09:14:47,Server,Unknown,A user request from the session with SPID 243 generated a fatal exception. SQL Server is terminating this session. Contact Product Support Services with the dump produced in the log directory.
10/02/2007 09:14:47,Server,Unknown,Error: 17310<c/> Severity: 20<c/> State: 1.
10/02/2007 09:14:47,spid243,Unknown,External dump process return code 0x20000001.<nl/>External dump process returned no errors.
10/02/2007 09:14:46,spid243,Unknown,Stack Signature for the dump is 0x724D13B0
10/02/2007 09:14:46,spid243,Unknown,78132A36 Module(MSVCR80+00002A36)
10/02/2007 09:14:46,spid243,Unknown,781329AA Module(MSVCR80+000029AA)
10/02/2007 09:14:46,spid243,Unknown,010D83F0 Module(sqlservr+000D83F0)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
Could somebody explain me what may cause this error and how repair this, please.
--
Regards,
anxcomp
View 5 Replies
View Related
Oct 9, 2007
I received the following error today while migrating some code from SQL 2000 standard to SQL 2005 standard:
The query processor ran out of stack space during query optimization. Please simplify the query.
From what I gather, this error is usually an indication that one of the SQL Server 2005 maximum capacity specifications has been exceeded. However, I'm not sure which one. The only one that seems suspect is the number of nested subqueries (32), however I believe the numerous subqueries in my query would be classified as correlated rather than nested.
An example of my code is below. It is necessarily messy, as the output needs to be denormalized somewhat. Note that this runs just fine on SQL 2000, and it retrieves the 1500 or so rows of data in about 30 seconds. Thanks in advance for any ideas as to what may be causing this error. (Sorry for not using code-block, but all the html tags it threw in were exceeding the 50,000 character limit for the message)
BEGIN
SELECT
(SELECT Agent FROM Agent a WHERE a.Card_Number = c.Card_Number AND Agent_Number = 1) AS A5,
(SELECT Agent FROM Agent a WHERE a.Card_Number = c.Card_Number AND Agent_Number = 2) AS A6,
(SELECT Agent FROM Agent a WHERE a.Card_Number = c.Card_Number AND Agent_Number = 3) AS A7,
(SELECT Agent FROM Agent a WHERE a.Card_Number = c.Card_Number AND Agent_Number = 4) AS A8,
dbo.f_formatpseudodate(Accrued_Interest_To) AS AI,
dbo.f_getmiscdescription('AM', c.Card_Number, Amended) AS AM,
Basis_Shareblock_1 AS B1,
Basis_Shareblock_2 AS B2,
Basis_Shareblock_3 AS B3,
Basis_Shareblock_4 AS B4,
Basis AS BS,
dbo.f_getmiscdescription('C1', c.Card_Number, Price_Code_1) AS C1,
dbo.f_getmiscdescription('C2', c.Card_Number, Price_Code_2) AS C2,
dbo.f_getmiscdescription('C3', c.Card_Number, Price_Code_3) AS C3,
dbo.f_getmiscdescription('C4', c.Card_Number, Price_Code_4) AS C4,
dbo.f_getmiscdescription('C5', c.Card_Number, Price_Code_5) AS C5,
dbo.f_getmiscdescription('C6', c.Card_Number, Price_Code_6) AS C6,
CAST(Card_Date AS smalldatetime) AS CD,
c.Card_Number AS CN,
dbo.f_getisocurrencycode(Currency_Code) AS CR,
Card_Status AS CS,
dbo.f_formatpseudodate(Record_Date) AS CT,
Currency_Description AS CU,
(SELECT New_Issue_Description FROM New_Issue ni WHERE ni.Card_Number = c.Card_Number AND New_Issue_Number = 1) AS D1,
(SELECT New_Issue_Description FROM New_Issue ni WHERE ni.Card_Number = c.Card_Number AND New_Issue_Number = 2) AS D2,
(SELECT New_Issue_Description FROM New_Issue ni WHERE ni.Card_Number = c.Card_Number AND New_Issue_Number = 3) AS D3,
(SELECT New_Issue_Description FROM New_Issue ni WHERE ni.Card_Number = c.Card_Number AND New_Issue_Number = 4) AS D4,
(SELECT New_Issue_Description FROM New_Issue ni WHERE ni.Card_Number = c.Card_Number AND New_Issue_Number = 5) AS D5,
(SELECT New_Issue_Description FROM New_Issue ni WHERE ni.Card_Number = c.Card_Number AND New_Issue_Number = 6) AS D6,
dbo.f_formatboolean(Dutch_Auction) AS DA,
dbo.f_formatpseudodate(Dated_Date) AS DD,
dbo.f_getmiscdescription('DI', c.Card_Number, Distribution_In) AS DI,
Dealer_Manager_2 AS DL,
Dealer_Manager_1 AS DM,
dbo.f_getmiscdescription('DV', c.Card_Number, Dividend_In) AS DV,
Basis_Surrender_1 AS E1,
Basis_Receive_1_1 AS E2,
Basis_Amount_1_1 AS E3,
Basis_CUSIP_1_1 AS E4,
Basis_Receive_1_2 AS E5,
Basis_Amount_1_2 AS E6,
Basis_CUSIP_1_2 AS E7,
Basis_Receive_1_3 AS E8,
Basis_Amount_1_3 AS E9,
dbo.f_getmiscdescription('EC', c.Card_Number, Record_Date_Code) AS EC,
Equity_Debt AS ED,
dbo.f_getmiscdescription('EF', c.Card_Number, Effective_Date_Code) AS EF,
dbo.f_getmiscdescription('EX', c.Card_Number, Expiration_Date_Code) AS EX,
dbo.f_getmiscdescription('F1', c.Card_Number, Refer_Code_1) AS F1,
dbo.f_getmiscdescription('F2', c.Card_Number, Refer_Code_2) AS F2,
dbo.f_getmiscdescription('F3', c.Card_Number, Refer_Code_3) AS F3,
dbo.f_formatpseudodate(Effective_Date) AS FD,
File_Activity_Type AS FT,
dbo.f_getmiscdescription('G1', c.Card_Number, Rights_Ratio_1) AS G1,
dbo.f_getmiscdescription('G2', c.Card_Number, Rights_Ratio_2) AS G2,
dbo.f_getmiscdescription('G3', c.Card_Number, Rights_Ratio_3) AS G3,
RTRIM(LTRIM(Original_Card_Number)) AS GC,
dbo.f_getmiscdescription('GD', c.Card_Number, Ex_Rights_Date_Code) AS GD,
dbo.f_getmiscdescription('GT', c.Card_Number, Rights_To) AS GT,
Basis_Amount_2_3 AS H1,
Basis_CUSIP_2_3 AS H2,
Basis_Surrender_3 AS H3,
Basis_Receive_3_1 AS H4,
Basis_Amount_3_1 AS H5,
Basis_CUSIP_3_1 AS H6,
Basis_Receive_3_2 AS H7,
Basis_Amount_3_2 AS H8,
Basis_CUSIP_3_2 AS H9,
Information_Agent_1 AS I1,
Information_Agent_2 AS I2,
Interest_Rate AS [IN],
dbo.f_getmiscdescription('J1', c.Card_Number, Subscription_Ratio_Code_1) AS J1,
dbo.f_getmiscdescription('J2', c.Card_Number, Subscription_Ratio_Code_2) AS J2,
dbo.f_getmiscdescription('J3', c.Card_Number, Subscription_Ratio_Code_3) AS J3,
Basis_CUSIP_4_2 AS K1,
Basis_Receive_4_3 AS K2,
Basis_Amount_4_3 AS K3,
Basis_CUSIP_4_3 AS K4,
Basis_Receive_3_3 AS L1,
Basis_Amount_3_3 AS L2,
Basis_CUSIP_3_3 AS L3,
Basis_Surrender_4 AS L4,
Basis_Receive_4_1 AS L5,
Basis_Amount_4_1 AS L6,
Basis_CUSIP_4_1 AS L7,
Basis_Receive_4_2 AS L8,
Basis_Amount_4_2 AS L9,
dbo.f_formatpseudodate(Withdrawal_After) AS LA,
dbo.f_getmiscdescription('LC', c.Card_Number, Withdrawal_After_Code) AS LC,
dbo.f_getmiscdescription('LG', c.Card_Number, Eligibility) AS LG,
Withdrawal_After_Time AS LT,
dbo.f_getmiscdescription('LZ', c.Card_Number, Withdrawal_After_Zone) AS LZ,
Option_Expiration_Time AS M1,
Rights_Expire_Time AS M3,
Expiration_Date_Time AS M4,
dbo.f_formatpseudodate(Maturity_Date) AS MD,
Maximum_Eligibility AS ME,
dbo.f_validatecardnumber(Refer_Card_1) AS N1,
dbo.f_validatecardnumber(Refer_Card_2) AS N2,
dbo.f_validatecardnumber(Refer_Card_3) AS N3,
dbo.f_getmiscdescription('NT', c.Card_Number, Interest_Rate_Code) AS NT,
DTC_Match_Card_Number AS O3,
Offer_By AS OB,
Odd_Lot AS OD,
dbo.f_getmiscdescription('OV', c.Card_Number, OverSubscription) AS OV,
dbo.f_formatpseudodate(Option_Expiration_Date) AS OX,
(SELECT Agent_Telephone FROM Agent a WHERE a.Card_Number = c.Card_Number AND Agent_Number = 4) AS P1,
Information_Agent_Telephone_1 AS P2,
Information_Agent_Telephone_2 AS P3,
Dealer_Manager_Telephone_1 AS P4,
Dealer_Manager_Telephone_2 AS P5,
CUSIP_Number AS PN,
dbo.f_formatpseudodate(Pro_Ration_Date) AS PO,
dbo.f_getmiscdescription('PY', c.Card_Number, Payable_To) AS PY,
dbo.f_getmiscdescription('PZ', c.Card_Number, Protect_Period) AS PZ,
Price_1 AS R1,
Price_2 AS R2,
Price_3 AS R3,
Price_4 AS R4,
Price_5 AS R5,
Price_6 AS R6,
dbo.f_getmiscdescription('RB', c.Card_Number, Rights_Transferable) AS RB,
Rights_CUSIP AS RC,
Issuer_Description AS RD,
dbo.f_getmiscdescription('RI', c.Card_Number, Pro_Ration_Date_Code) AS RI,
Record_Type AS RT,
dbo.f_formatpseudodate(Rights_Expire_Date) AS RX,
CAST(Subscription_Ratio_1 AS varchar(12)) + Subscription_Ratio_1_Unit AS S1,
CAST(Subscription_Ratio_2 AS varchar(12)) + Subscription_Ratio_2_Unit AS S2,
CAST(Subscription_Ratio_3 AS varchar(12)) + Subscription_Ratio_3_Unit AS S3,
dbo.f_getmiscdescription('SC', c.Card_Number, Source_Name) AS SC,
Service_Type AS SE,
dbo.f_getmiscdescription('ST', c.Card_Number, Subscription_To) AS ST,
(SELECT Redemption_Agent_Telephone FROM Redemption_Agent ra WHERE ra.Card_Number = c.Card_Number AND Redemption_Agent_Number = 1) AS T2,
(SELECT Redemption_Agent_Telephone FROM Redemption_Agent ra WHERE ra.Card_Number = c.Card_Number AND Redemption_Agent_Number = 2) AS T3,
(SELECT Redemption_Agent_Telephone FROM Redemption_Agent ra WHERE ra.Card_Number = c.Card_Number AND Redemption_Agent_Number = 3) AS T4,
(SELECT Redemption_Agent_Telephone FROM Redemption_Agent ra WHERE ra.Card_Number = c.Card_Number AND Redemption_Agent_Number = 4) AS T5,
(SELECT Agent_Telephone FROM Agent a WHERE a.Card_Number = c.Card_Number AND Agent_Number = 1) AS T7,
(SELECT Agent_Telephone FROM Agent a WHERE a.Card_Number = c.Card_Number AND Agent_Number = 2) AS T8,
(SELECT Agent_Telephone FROM Agent a WHERE a.Card_Number = c.Card_Number AND Agent_Number = 3) AS T9,
Tickler_Date AS TK,
dbo.f_getmiscdescription('TP', c.Card_Number, To_Purchase) AS TP,
dbo.f_getmiscdescription('TS', c.Card_Number, Transaction_Status) AS TS,
dbo.f_gettxtext(c.Card_Number) AS TX,
Basis_CUSIP_1_3 AS U1,
Basis_Surrender_2 AS U2,
Basis_Receive_2_1 AS U3,
Basis_Amount_2_1 AS U4,
Basis_CUSIP_2_1 AS U5,
Basis_Receive_2_2 AS U6,
Basis_Amount_2_2 AS U7,
Basis_CUSIP_2_2 AS U8,
Basis_Receive_2_3 AS U9,
RTRIM(Issue_Description) AS UD,
Voluntary_Mandatory AS VM,
(SELECT New_Issue_CUSIP FROM New_Issue ni WHERE ni.Card_Number = c.Card_Number AND New_Issue_Number = 1) AS W1,
(SELECT New_Issue_CUSIP FROM New_Issue ni WHERE ni.Card_Number = c.Card_Number AND New_Issue_Number = 2) AS W2,
(SELECT New_Issue_CUSIP FROM New_Issue ni WHERE ni.Card_Number = c.Card_Number AND New_Issue_Number = 3) AS W3,
(SELECT New_Issue_CUSIP FROM New_Issue ni WHERE ni.Card_Number = c.Card_Number AND New_Issue_Number = 4) AS W4,
(SELECT New_Issue_CUSIP FROM New_Issue ni WHERE ni.Card_Number = c.Card_Number AND New_Issue_Number = 5) AS W5,
(SELECT New_Issue_CUSIP FROM New_Issue ni WHERE ni.Card_Number = c.Card_Number AND New_Issue_Number = 6) AS W6,
dbo.f_formatpseudodate(Withdrawal_Prior_To) AS WD,
Withdrawal_Prior_To_Time AS WH,
dbo.f_getmiscdescription('WO', c.Card_Number, Withdrawal_Prior_To_Code) AS WO,
dbo.f_getmiscdescription('WZ', c.Card_Number, Withdrawal_Prior_To_Zone) AS WZ,
(SELECT Payable_Rate_Amount FROM Payable_Rate pr WHERE pr.Card_Number = c.Card_Number AND Payable_Rate_Number =3) AS X1,
(SELECT Payable_Rate_CUSIP FROM Payable_Rate pr WHERE pr.Card_Number = c.Card_Number AND Payable_Rate_Number = 3) AS X2,
dbo.f_formatpseudodate(Expiration_Date) AS XD,
dbo.f_formatpseudodate(Ex_Rights_Date) AS XR,
dbo.f_getmiscdescription('XT', c.Card_Number, Rights_Expire_Code) AS XT,
Payable_Rate_Shareblock AS Y1,
Payable_Rate_Surrender AS Y2,
(SELECT Payable_Rate_Receive FROM Payable_Rate pr WHERE pr.Card_Number = c.Card_Number AND Payable_Rate_Number =1) AS Y3,
(SELECT Payable_Rate_Amount FROM Payable_Rate pr WHERE pr.Card_Number = c.Card_Number AND Payable_Rate_Number =1) AS Y4,
(SELECT Payable_Rate_CUSIP FROM Payable_Rate pr WHERE pr.Card_Number = c.Card_Number AND Payable_Rate_Number =1) AS Y5,
(SELECT Payable_Rate_Receive FROM Payable_Rate pr WHERE pr.Card_Number = c.Card_Number AND Payable_Rate_Number =2) AS Y6,
(SELECT Payable_Rate_Amount FROM Payable_Rate pr WHERE pr.Card_Number = c.Card_Number AND Payable_Rate_Number =2) AS Y7,
(SELECT Payable_Rate_CUSIP FROM Payable_Rate pr WHERE pr.Card_Number = c.Card_Number AND Payable_Rate_Number =2) AS Y8,
(SELECT Payable_Rate_Receive FROM Payable_Rate pr WHERE pr.Card_Number = c.Card_Number AND Payable_Rate_Number =3) AS Y9,
dbo.f_formatpseudodate(Payment_Date) AS YD,
dbo.f_getmiscdescription('YR', c.Card_Number, Payable_Rate) AS YR,
dbo.f_getmiscdescription('Z1', c.Card_Number, Option_Expiration_Zone) AS Z1,
Rights_Expire_Zone AS Z3,
Expiration_Date_Zone AS Z4
FROM COMMON c
INNER JOIN DC_DailyCard dc ON c.Card_Number = dc.Card_Number
WHERE c.Card_Status = 'R' AND c.Card_Date BETWEEN @start_date AND @end_date
END
View 2 Replies
View Related