Grouping Transactions Quarterly By Client

Dec 5, 2007

I have transaction table I am pulling transactions from and can't quite figure out how to get a sum based on a few items.

I am trying to figure out how to show the sum of the InvestorAssumption and group it based on the DealId, then DealTransType and show the sum of the InvestorAssumption.

So I want to see a total of the InvestorAssumption by quarter split up by DealTransType, then DealId.

Not sure how to do this and any help would be greatly appreciated.

Here is my current view.


Code:

SELECT TOP 100 PERCENT dbo.DealTransactions.DealTransId, dbo.DealTransactions.DealId, dbo.DSGvwInvestorPercentage.InvestorID, DATEADD(quarter,
DATEDIFF(quarter, 0, dbo.DealTransactions.DealTransDate), 0) AS TransDateQuart, dbo.DealTransactions.DealTransType,
dbo.DealTransTypes.DealTransTypeName AS TransactionType, dbo.DealTransactions.DealTransAmount,
dbo.DSGvwInvestorPercentage.InvestorPercentage * dbo.DealTransactions.DealTransAmount / 100 AS InvestorAssumption,
dbo.DSGvwInvestorPercentage.InvestorPercentage, dbo.DealTransactions.DealTransDate AS TransDateActual
FROM dbo.DealTransactions INNER JOIN
dbo.DSGvwInvestorPercentage ON dbo.DealTransactions.DealId = dbo.DSGvwInvestorPercentage.DealID INNER JOIN
dbo.DealTransTypes ON dbo.DealTransactions.DealTransType = dbo.DealTransTypes.DealTransTypeId
GROUP BY dbo.DealTransTypes.DealTransTypeName, dbo.DealTransactions.DealTransAmount, dbo.DealTransactions.DealId,
dbo.DSGvwInvestorPercentage.InvestorID, dbo.DSGvwInvestorPercentage.InvestorPercentage * dbo.DealTransactions.DealTransAmount / 100,
dbo.DealTransactions.DealTransType, dbo.DSGvwInvestorPercentage.InvestorPercentage, dbo.DealTransactions.DealTransId,
dbo.DealTransactions.DealTransDate
ORDER BY dbo.DealTransactions.DealId, dbo.DSGvwInvestorPercentage.InvestorID, dbo.DealTransTypes.DealTransTypeName,
dbo.DealTransactions.DealTransAmount

View 1 Replies


ADVERTISEMENT

Grouping And Pairing Transactions Over Time

Jul 27, 2012

I have a table with the below columns. I would like to create the result table below that pairs transactions with "LIKE" transactions. The only exception is that "OUT" can basically stop anything.

compIDcommIDTRANSDATEUNIT
11MSF1/1/2012101
12CS11/1/2012101
13CS22/1/2012101
110OUT5/1/2012101
112MSF5/2/2012301
113CS15/2/2012301
114CS26/2/2012301
115OUT10/2/2012301
24MSF1/1/2012102

[code]...

View 1 Replies View Related

Mirror Goes Down... Affect Client Transactions?

Jan 2, 2007

If the mirror server goes down for any reason, then what happens to client transactions against the principle?

Will any client transactions fail?



Thanks in advance

View 3 Replies View Related

Using Join To Match Transactions To Client Data

Apr 10, 2001

I am running SQL2k on Win2k sp1. I need to match a transaction record (using txn_date) to client data as it would have appeared on the date of the transaction (using client_last_update).

A new row is inserted into my client table every time any part of the clients information changes, thereby leaving the change history in tact. The client_last_update field holds the date the change took place. It is required that the user be provided the client information that was current on the day of the transaction.

Example: A client record (name, address, accountno) was inserted to the client table on 2/1/2000 (the last_update field is empty because it's a new record).

The client record is modified on 4/15/2000 for a name change (making the last_update = 4/15/2000), and again on 12/5/2000 (making the last_update = 12/5/2000).

Transactions are made by the client on 2/5/2000, 6/10/2000, and 3/25/2001. These dates are held in the txn_date field in the transaction table.

The client now has 3 transaction records in the transaction table for his/her account number and 3 client records in the client table.

The transaction on 2/5/2000 should be joined to the initial client record ((2/5/2000 > empty) AND (2/5/2000 < 4/15/2000))

The transaction on 6/10/2000 should be joined to the client record having the last_update = 4/15/2000 (6/10/2000 > 4/15/2000) AND (6/10/2000 < 12/5/2000))

The last transaction, executed on 3/25/2001 should be joined to the most current client record, which has last_update = 12/5/2000 (3/25/2001 > 12/5/2000).

I have been experimenting with the code below, and found it to only return client data where the client record update_date = '4/18/2000'.

select * from transaction t Left Outer Join client c On t.SEC_ACCT = c.Account_No and t.Txn_Date > coalesce(c.Last_Update_Date, '1/1/1900') and t.Txn_Date < (select min(c2.Last_Update_Date) from client c2 where c2.Last_Update_Date > coalesce(c.Last_Update_Date, '1/1/1900'))

An example of a record that DID get returned carried a txn_date of '1/2/2001', and possible client update_dates of: NULL, '5/13/1999', and '4/18/2000'. The row returned carried a client update_date of '4/18/2001', and rightly so.

An example of a record that DID NOT get returned carried a txn_date = '1/2/2001' and possible client update_dates of: NULL, and '6/11/1999. This row was not returned.

View 1 Replies View Related

Transactions/Client-Side Redirect Issue

Mar 23, 2006

Hi there.

With Client-Side Redirect, connections can be dinamically redirected in case of failover. But if a long transaction is running on the principal, when it fails the redirect doesn´t work with the current ado.net connection, connected to the database running that transaction.

So if the principal fails, current running transaction will be lost right ?

 

Thanks in advance.

View 1 Replies View Related

Help With Udf Or Where Cluase To Get Quarterly/annual Due Payments

Jan 9, 2008

I'm trying to build a where clause that looks at two columns to determine if QUARTERLY and ANNUAL payments are due.
rec_day could be any day.
I got the monthly one pretty easily:
WHERE rec_start <= GETDATE() AND rec_frequency = 'Monthly' AND rec_day = DAY(GETDATE())
So if the rec_day was 9 and the rec_frequency was 'Quarterly' then I would be looking to see if todays date is 1/9 or 4/9 or 7/9 or 10/9 (not sure how I do this part)
I'm pretty much stuck on where to go with the quarterly where clause:
WHERE rec_start <= GETDATE() AND rec_frequency = 'Quarterly' AND rec_day = ????
 
I tried the following, but it did not work:
(CAST(DATEPART(Q, GETDATE()) * 3 - 2 AS VARCHAR(2)) + '/' + CAST(rec_day AS VARCHAR(2)) + '/' + CAST(YEAR(GETDATE()) AS VARCHAR(4)) = GETDATE())

View 1 Replies View Related

Quarterly Report - Calculating For Each Of The Next Four Months?

Apr 30, 2008


RE: Quarterly report - calculating for each of the next four months?



As I play with joins and functions to help mold my data.. I'm
thinking
about options.


I have a status table with termination status entries that will
dictate participation spans for members.. a member can have multiple
stop and start status entries in that status table. I've built an
sql function that given a member's ID and a month/year will return the
number of days the member particpated in the month.


I need to produce an SSRS report that given a starting month/year
will report days of activity for every member for the next four months.


So my report will look like this:
memberid 2007/06 2007/07 2007/08 2007/09
001 10 0 20 5
002 0 2 55 1


Should I build a view that given the starting yearmonth returns
month1 - 4's data in a row?

or is there a smarter design? Possibly a row for each month? or SSRS
formulas? Maybe the formula is gonna be a performance killer.


Thanks for any help or information!!!

View 4 Replies View Related

Show Monthly,Quarterly, And YTD Revenue

Dec 7, 2006

Hi All Experts,

I need to show a result of a revenues total for Monthly,Quarterly, and YTD of a given sales person by a given period.

e.g

Period : 7-1-2006 to 8-1-2006

Sales Person Monthy Quarter YTD

SalesPerson1 $1999 $10000 $100000

SalesPerson2 $1999 $10000 $100000

How can i do that?

Thanks in advance.

View 7 Replies View Related

SQL Server 2012 :: How To Get Data On Quarterly Basis

May 12, 2014

I need to get results on quarterly basis, matching 2 quarters AUTOMATICALLY.

- As the new quarter starts, it needs to match the last quarter results.

SELECT DATEADD(mm, (QUARTER - 1) * 3, year_date) StartDate,
DATEADD(dd, -1, DATEADD(mm, QUARTER * 3, year_date)) EndDate,
QUARTER QuarterNo

[Code] ....

Here is my Query, I don't know whether I'm getting it right?

--Quarter 1
SELECTD.MerchantName, A.MID, A.TID, ISNULL(SUM(A.SumTrxnMon), 0) AS SumTrxnMon, E.FullName, E.DxBEmail
INTO#Quarter1
FROMdbo.tblRPT_Spend AS A INNER JOIN
dbo.tblMer_DeployORetrieveTerm AS B ON A.MID = B.MID AND A.TID = B.TID INNER JOIN

[Code] ....

View 4 Replies View Related

Integration Services :: Monthly Versus Quarterly File Load

Jun 17, 2015

I have a file that will be produced both Monthly and Quarterly.  The file name will be the same except for the Month/Quarter in the name:

Monthly file - Inforce Download - APR 2015.txt, Inforce Download - MAY 2015.txt, etc...

Quarterly file - Inforce Download - Q1 2015.txt, Inforce Download - Q2 2015.txt, etc...

The SSIS package will need to accomplish the following:

1. The package will somehow need to know what the file name should be based on the last file processed.  So for example if we just loaded the Jan 2015 file, the next monthly file to drop should be the Feb 2015 file.  For the quarterly files, it should be Q1 2015, then Q2 2015, etc...

2.  Based on the file (Monthly or Quarterly), the package needs to somehow split and process one way for Monthly and another way for Quarterly.

View 3 Replies View Related

Select Daily, Monthly, Weekly, Quarterly And Yearly Values For Graph Report

May 28, 2008



Hi



I am very new to analysis services and using MDX.



I want to select data from a cube using an MDX statement and show the data on a graph report.



I want to select the daily, weekly, monthly and quarterly descriptions all in one column to make it easy to represent it on the report.



Then set the 'Date' Column to the x-axis and the Value column to the y-axis.



The user also must have the option to not show certain periods (Switch of daily and weekly)



My MDX works when I select from the SQL Management Studio but as soon as I copy the MDX over to the SSRS Report Designer is splits the daily, weekly, monthly, quarterly and yearly values into seperate columns which makes it very difficult to report on.

----
Code



SELECT NON EMPTY { ([Measures].[ValueAfterLogic])} ON COLUMNS,

NON EMPTY { [KPI Values].[KPI Name].[KPI Name].ALLMEMBERS * ORDER(

CASE 1 WHEN 1 Then [Time].[Hierarchy].[Day Of Month] ELSE NULL END +

CASE 1 WHEN 1 Then [Time].[Hierarchy].[Week Of Year Name] ELSE NULL END +

CASE 1 WHEN 1 Then [Time].[Hierarchy].[Month] ELSE NULL END +

CASE 1 WHEN 1 Then [Time].[Hierarchy].[Quarter Of Year Name] ELSE NULL END +

CASE 1 WHEN 1 Then [Time].[Hierarchy].[YEAR] ELSE NULL END,

[Measures].[ValueAfterLogic],DESC)

}

DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM

(SELECT ( {[KPI Values].[KPI Id].&[{97754C54-AB43-403D-A2C2-21C04BDE93E3}] } ) ON COLUMNS

FROM [Workplace])

WHERE ( [KPI Values].[KPI Id].&[{97754C54-AB43-403D-A2C2-21C04BDE93E3}])

CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS



The case statement will take paramter values when finished

----------------end of code portion



Is this possible or is it suppose to 'split' the columns when moving to SSRS.





Thans in advance

Dev environment - SQL 2008 Feb CTP, VS 2008

View 5 Replies View Related

Changing Connection Transactions To Database Transactions

May 22, 2005

Hi there,
I have decided to move all my transaction handling from asp.net to stored procedures in a SQL Server 2000 database. I know the database is capable of rolling back the transactions just like myTransaction.Rollback() in asp.net. But what about exceptions? In asp.net, I am used to doing the following:
<code>Try   'execute commands   myTransaction.Commit()Catch ex As Exception   Response.Write(ex.Message)   myTransaction.Rollback()End Try</code>Will the database inform me of any exceptions (and their messages)? Do I need to put anything explicit in my stored procedure other than rollback transaction?
Any help is greatly appreciated

View 3 Replies View Related

Query Or Grouping Problem (some Kind Of Parallel Grouping?)

Nov 26, 2007

I'm really stumped on this one. I'm a self taught SQL guy, so there is probobly something I'm overlooking.

I'm trying to get information like this in to a report:

WO#
-WO Line #
--(Details)
--Work Order Line Detail #1
--Work Order Line Detail #2
--Work Order Line Detail #3
--Work Order Line Detail #etc
--(Parts)
--Work Order Line Parts #1
--Work Order Line Parts #2
--Work Order Line Detail #etc
WO#
-WO Line #
--(Details)
--Work Order Line Detail #1
--Work Order Line Detail #2
--Work Order Line Detail #3
--Work Order Line Detail #etc
--(Parts)
--Work Order Line Parts #1
--Work Order Line Parts #2
--Work Order Line Parts #etc

I'm unable to get the grouping right on this. Since the line details and line parts both are children of the line #, how do you do "parallel groups"?

There are 4 tables:

Work Order Header
Work Order Line
Work Order Line Details
Work Order Line Requisitions

The Header has a unique PK.
The Line uses the Header and a Line # as foreign keys that together are unique.
The Detail and requisition tables use the header and line #'s in addition to their own line number foreign keys. My queries ends up looking like this:

WO WOL WOLR WOLD
226952 10000 10000 10000
226952 10000 10000 20000
226952 10000 10000 30000
226952 10000 10000 40000
226952 10000 20000 10000
226952 10000 20000 20000
226952 10000 20000 30000
226952 10000 20000 40000
399999 10000 NULL 10000
375654 10000 10000 NULL
etc


Hierarchy:
WO > WOL > WOLD
WO > WOL > WOLR

It probobly isn't best practice, but I'm kinda new so I need some guidance. I'd really appreciate any help! Here's my query:

SELECT [Work Order Header].No_ AS WO_No, [Work Order Line].[Line No_] AS WOL_No,
[Work Order Requisition].[Line No_] AS WOLR_No, [Work Order Line Detail].[Line No_] AS WOLD_No
FROM [Work Order Header] LEFT OUTER JOIN
[Work Order Line] ON [Work Order Header].No_ = [Work Order Line].[Work Order No_] LEFT OUTER JOIN
[Work Order Line Detail] ON [Work Order Line].[Work Order No_] = [Work Order Line Detail].[Work Order No_] AND
[Work Order Line].[Line No_] = [Work Order Line Detail].[Work Order Line No_] LEFT OUTER JOIN
[Work Order Requisition] ON [Work Order Line].[Work Order No_] = [Work Order Requisition].[Work Order No_] AND
[Work Order Line].[Line No_] = [Work Order Requisition].[Work Order Line No_]

View 1 Replies View Related

Client With Tcp/ip Produce &#34;time Out Error&#34; While Same Client While Switced To Named Pipes

May 28, 2001

We have 15 clients running our applicaton
14 of then conected to SQL server using TCP/IP and it runs fine

1 of 15 when connected using TCP/IP produce "..Time out error "
but runs fine when swiched from TCP/IP to Named pipes

1.What area should we look to correct problem with Time out using TCP/IP ?
2. Where to get information about using TCP/IP via Named pipes ?

View 1 Replies View Related

Install SQL Server2005 Error:[Native Client]Encryption Not Supported On The Client

May 10, 2006

Product: Microsoft SQL Server 2005 -- Error 29515. SQL Server Setup could not connect to the database service for server configuration. The error was: [Microsoft][SQL Native Client]Encryption not supported on the client. Refer to server error logs and setup logs for more information. For details on how to view setup logs, see "How to View Setup Log Files" in SQL Server Books Online.

View 78 Replies View Related

Client Unable To Establish Connection Encryption Not Supported On SQL Server. (Microsoft SQL Native Client)

May 2, 2006

On Windows XP systems I get the following issue when trying to browse the MSDB folder in SSIS

Client unable to establish connection
Encryption not supported on SQL Server. (Microsoft SQL Native Client)

I have noticed another post where several others have noticed the same issue. It appears to only occur on Windows XP installations. Is there a workaround or fix for this?

View 2 Replies View Related

Setup Error : [SQL Native Client] Encryption Not Supported On The Client

Nov 1, 2006

Hi,

I have SQL2000 installed as the default instance, and now I'm trying to install SQL 2005 standard edition as a named instance.

I receive this error :
SQL Server could not connect to database service for server configuration.. [SQL Native client] Encryption not supported on the client. However I'm able to install client tools

The setup works fine on other box with the same config : SQL 2000/Windows XP, is there any work around for this issue ?

In my SQL 2000 client network utilty "Force proctocol encryption " is desabled and did not find the setting for SQL 2005 !

Thank you

View 1 Replies View Related

Upgrade Client Connectiviity Tools On Client Machines

Jul 23, 2005

Hello,Is it necessary to upgrade the Client Connectivity Tools on all clientmachines after the SQL Server database server is upgraded from Version7.0 to 2000?Thank you in advance!Eddy

View 1 Replies View Related

Sql Native Client Or Sqlserver Client

Mar 3, 2007

Hi,

While using Sql Native Client ,VB Application giving error

"Transcation Cannot Start because more than one ODBC connection is in use"

But when useing SqlServer client then work perfectly ok.

Please guide where to use Sql Native Client.

Thanks

Rizwan



View 1 Replies View Related

SQL NATIVE CLIENT - OLE DB Connection On 64 Bit Client

Apr 23, 2008

I have tried this on several different operating systems (VISTA and XP ) and several versions of SQL NATIVE CLIENT including 2005.90.3042.0

I have a 64 bit "SQL NATIVE CLIENT" connection that fails. The exact same connection and code succeeds on 32 bit.
My customer and I prepend "oledb:" to the connection string and it starts working.

FAILS on 64 bit:
Provider=SQLNCLI.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Wrigley_Test;Data Source=MONGO;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=RIPTIDE;Use Encryption for Data=False;Tag with column collation when possible=False;MARS Connection=False;DataTypeCompatibility=0;Trust Server Certificate=False

WORKS
oledb:Provider=SQLNCLI.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Wrigley_Test;Data Source=MONGO;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=RIPTIDE;Use Encryption for Data=False;Tag with column collation when possible=False;MARS Connection=False;DataTypeCompatibility=0;Trust Server Certificate=False

I debugged my code to the point that I know it is happening when I call CreateAccessor for my SQL statement.


m_hr=m_pIAccessor->CreateAccessor(DBACCESSOR_ROWDATA, GetCols(), (m_pDBBinds+IsBookmarked()), 0, &m_hAccessor, NULL);

Error:

Microsoft SQL Native Client: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

Does anyone have any suggestions?

View 6 Replies View Related

Transactions

Aug 13, 2003

Hi All,
Can anybody suggest me a website where I can find articles on Managing transactions with Sql server. Also a scenario where the transactions take place in a environment involving 2 different databases, Like the bank account and credit card transactions (specifically of 2 way kind)
Thanks

View 5 Replies View Related

Transactions

Apr 6, 2005

I have a web application with a shopping cart, how do I stop all the shopping cart transaction from going into the db log? Is this possible?  These are are only transient data movements, and will never be need to to restore to, and they are cause log bloat. Or is there a better way to stop log bloat?
 
Thanks

View 2 Replies View Related

TRANSACTIONS IN DTS

Apr 17, 2000

Hi All,

How can we change connection properties in a DTS pkg with connection?
You can loop through the connection count but the connection ID is not static one.So can’t rely on that.
Is there another way of changing connection properties?

Thanks in Advance

Barath

View 4 Replies View Related

Help With DTS Transactions

Sep 5, 2000

Hi all....

I am currently designing a DTS Package to import data that is processed daily into a large database.

I have to design the package such that if any step fails when importing, I roll back the entire transaction.

I have designed the package with this in mind, checked "join transaction if present" and "rollback transaction on failure" in all of the workflows. I have also made all workflows serialized.

However, when I run the package, it fails on one of the data pumps with the error:

Transaction context in use by another session.

Any ideas?

Thank you,

Brian

View 2 Replies View Related

I Want To See My Transactions

Dec 1, 2000

I am replicating (finally!!) and on my publishers agent history I can see it says xx transactions with xx commands were delivered. (xx being the number)
Where can I look to see what the transactions or commands are?

Is there a place the system stores this information?

View 1 Replies View Related

Max. Transactions

Oct 17, 2003

what is maximum limit of no. of transactions per sec. in sql server 2000

View 2 Replies View Related

Transactions

Sep 6, 2004

Is there a point to wrapping a single UPDATE or INSERT statement in an explicit TRANSACTION:


BEGIN TRANSACTION

INSERT INTO Table (...) VALUES (...)

COMMIT TRANSACTION


I understand ACID and concept of transactions. However, I thought they were only necessary for multi-statement operations. I'm maintaining code that does this and am wondering if this is necessary. Does SQL Server guarantee ACID for single statements? Are single UPDATE/INSERT statements prone to race condition like affects without using explicit transactions?

View 2 Replies View Related

Transactions

Apr 17, 2008

Are there any scenarios where an un-commited transaction would block further queries?

View 1 Replies View Related

Transactions

May 27, 2008

If you run the Begin Transaction code and then run a create such as an update query and you see that it effects the number of rows that you wanted it to effect is there a way to look at the actual data that changed before you Commit Transaction?

Thanks!

View 7 Replies View Related

Transactions/Sec

Jul 1, 2007

I have a table with around 240 columns and one of the column in the Table is the Inserttime ( DATETIME ) and I using a GETDATE() function in the stored Proc, when we insert data into the table. In the same Milli second 2007-06-27 09:32:58.303 , I have around 7600 records in the database. The Stored Proc is called for each Individual record and we don't bunch the transactions. Is this possible.

I did some bench marking on this server and I can insert only 700 - 800 records approx / sec on this particular table.

Thanks

View 6 Replies View Related

Transactions

Aug 1, 2007

I have a small database that I have been testing.I get an error about a transaction deadlock.The code is in stored procedures and I added transactions to the sp'sbut the error happened again.I wrapped the whole sp in just one transaction and I don't have anyindex on the tables.When I test just by running a program that sends 3 calls at a time itwill get a deadlocked transaction as I send 6 or 9 at a time.I am not sure how it can have a deadlocked transaction after I usedtransactions(begin and commit) in the sp's.Steve

View 4 Replies View Related

Transactions

Oct 8, 2007

I am working with transactions and use try catch to capture errors and in the event of an error i have to rollback the transaction. How can i perform this?, most of the errors which i forsee are either insertion of null values into non nullable columns or violation of Primary keys while inserting duplicates.
I started by coding the following way but it does not rollaback apparently the try catch does not work for above kind of errors..Can somebody help..



DECLARE @REPORTING_PERIOD VARCHAR(6)

BEGIN TRY

BEGIN TRANSACTION

-- SET NOCOUNT ON added to prevent extra result sets from

-- interfering with SELECT statements.

SET NOCOUNT ON;

SET @REPORTING_PERIOD =(Select REPORT_PERIOD_ID from dbo.T_REPORT_PERIOD where C_FLAG_ACTIVITY=1)


--Step 1


INSERT INTO [dbo].[T_COUNTRIES]

([C_COUNTRY]

,[LB_COUNTRY]

,[C_REGION]

,[FK_REPORTING_PERIOD])

SELECT [C_COUNTRY]

,[LB_COUNTRY]

,[C_REGION]

,@REPORTING_PERIOD

FROM [dbo].[IN_T_COUNTRIES]


--Step 2


INSERT INTO [dbo].[T_FLE]

([FK_P_FLE]

,[C_COSMOS]

,[LB_FLE]

,[C_PARETO]

,[C_OPCO_SCOPE]

,[C_LEVEL]

,[C_FLE_TYPE]

,[C_ACTIVITY]

,[F_MATERIAL]

,[C_MATERIAL_PRIORITY]

,[C_CALCULATION_METHOD]

,[F_CREDIT_RISK_MATERIALITY]

,[V_PARTICIPATION]

,[FK_REPORTING_PERIOD])

SELECT Null as [FK_P_FLE]

,[C_COSMOS]

,[LB_FLE]

,[C_PARETO]

,[C_OPCO_SCOPE]

,[C_LEVEL]

,[C_FLE_TYPE]

,@REPORTING_PERIOD

FROM [dbo].[IN_T_FLE]

COMMIT TRANSACTION


END TRY


BEGIN CATCH


SELECT

ERROR_NUMBER() as ErrorNumber,

ERROR_LINE() as ErrorLine,

ERROR_MESSAGE() as ErrorMessage;

-- Test XACT_STATE for 1 or -1.

-- XACT_STATE = 0 means there is no transaction and

-- a commit or rollback operation would generate an error.

-- Test whether the transaction is uncommittable.

IF (XACT_STATE()) = -1

BEGIN

PRINT

N'The transaction is in an uncommittable state. ' +

'Rolling back transaction.'

ROLLBACK TRANSACTION;

END;

-- Test whether the transaction is active and valid.

IF (XACT_STATE()) = 1

BEGIN

PRINT

N'The transaction is committable. ' +

'Committing transaction.'

COMMIT TRANSACTION;

END;





END CATCH;


View 3 Replies View Related

Sql Transactions

Nov 8, 2006

Hello All,

When i am working with Transactions i got one doubt.

If i am inserting any records into a table with primary key if a transaction is rolled back i am finding one primary ID is missing. Is it so.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved