Not using MSDTC in SQL Cluster when using SSIS

I have an SSIS package that reads data from Oracle and inserts it into SQL Server.
The SQL Server is clustered (node1, node2) but it doesn't have MSDTC. The package runs fine without problems.
I have read that if you are using SSIS package then MSDTC is a must when configuring SQL Server cluster. But I am not using it and still package is working fine so I wanted to ask what's the use of MSDTC? How is my package working without it?

Please refer below link and determine if you need it. If you are using distributed transaction in SSIS package you will require it.
Do i need to configure MSDTC
Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers
My TechNet Wiki Articles

Similar Messages

  • Install db using sapinst on sql cluster

    I'm having an issue installing the ep6 db using sapinst on a sql cluster. sapinst wants to install to the localhost/default, but I need to specify the "virtual" sql cluster name.
    Is there a workaround using sapinst, or is there some special way one needs to backup/restore onto the cluster from another machine..
    any ideas?
    jm

    <snip>
    Marty McCormick  
    Posts: 17
    Registered: 2/25/04 
    Hi Gabor-
    Although it's not supported, you can get EP6 SP2 to work with clustered SQL server 2000 on a virtual MSCS cluster. (We have it working here on Win2003)
    The instructions were posted somewhere on this discussion board before, but here they are again:
    1) Install SQL as a default local instance with the DB files on a clustered drive. Make sure to choose custom install and select Binary 850 collation.
    2) Select a clustered drive for the SQL data files.
    3) Install SQL SP3
    4) Install SQL hotfix xxxx
    5) Run instcoll.exe on the local instance to upgrade to 850 BIN2
    6) Run SAPinst, choose ?Database? and allow the setup to create the databases PCD and WCM
    7) Detach the databases (Right click on the DB in SQL Enterprise Manger and Detach)
    8) Upgrade the local SQL instance to a clustered instance (Note: when running sql setup again, make sure there is no other default instance running on the other node or you will not have the upgrade option). You will have to give the SQL install an instance name at this point.
    9) Re-install SQL SP3
    10) Re-install hotfix xxx
    11) Re-run instcoll.exe (Note: You will have to do this while SQL services are running. Instcoll will prompt you to stop them using the SQL Services Manager, follow the instructions Instcoll displays).
    12) Attach the PCD and WCM databases.
    13) Run SAPInst on your portal servers and point the install at the clustered SQL virtual server name / instance.
    General comments:
    There are 3 main considerations when installing EP6 with a clustered SQL backend:
    1) You can only run SAPinst ? Database (creates PCD and WCM databases, SAPPCD and SAPWCM users) against a local non-named instance of SQL (SAPinst used the local SQL pipe to connect)
    2) Instcoll.exe will NOT run against a SQL installation that has the two EP6 databases (PCD/WCM) attached, hence the need to detach them before running setup / instcoll.
    3) Be very careful with collations. After the upgrade to cluster operation the collation will not be the same. If you attach the PCD and WCM databases to a SQL server running the wrong collation YOU WILL CORRUP THE DATABASES! 
    </snip>

  • Index not used on view when table stats exist

    Hello,
    I would be grateful if someone comes with ideas on the following problem I'm currently facing.
    I have a table with XMLTYPE data type column:
    sql-->desc ACFBNK_STMT008
    RECID     NOT NULL     VARCHAR2(200)
    XMLRECORD XMLTYPE
    I have a view V_ACFBNK_STMT008 on that table, in which the view columns are defined as extracted tags values from the XMLTYPE field, e.g. for the view field N_BOOKING_DATE:
    numcast(extractValue(xmlrecord,'/row/c25')) "N_BOOKING_DATE"
    (note: numcast is just a simple function that returns TO_NUMBER of its input argument)
    I have also a function-based index on this field of the table:
    CREATE INDEX train4.NIX_ACFBNK_STMT008_C25
    ON train4.ACFBNK_STMT008("TRAIN4"."NUMCAST"(extractValue(xmlrecord,'/row/c25')))
    And so, I'm executing on the view the following SQL statement:
    SELECT RECID FROM V_ACFBNK_STMT008 WHERE (N_BOOKING_DATE > TO_NUMBER('20070725'));
    Now, the problem comes: when statistics exist on the view base table (that is ACFBNK_STMT008) then the above statement is not using the index and is making a "table access full". When I delete the statistics for the table then the SQL runs fast with an "index range scan".
    Which is further strange - when I change the ">" operand with a "=" the SQL statement correctly captures the index regardless of whether or not statistics exist.
    I've tried to manually rewrite the SQL and include the "numcast" function in it:
    SELECT RECID FROM TRAIN4.V_ACFBNK_STMT008 WHERE ( N_BOOKING_DATE>train4.numcast(TO_NUMBER( '20010725' ) ));
    And in this way the index is used OK even with statistics existing!
    But regretfully I don't have a way to change the application and the SQL, so the only things I can change is the view and/or the index.
    Thank you in advance,
    Evgeni
    P.S.
    I've tried gathering statistics in both the following ways but still the problem persists:
    sql-->analyze table train4.ACFBNK_STMT008 compute statistics;
    sql-->exec dbms_stats.gather_table_stats(ownname=>'TRAIN4', tabname=>'ACFBNK_STMT008', CASCADE=>TRUE, partname=>NULL);

    Oh, and I forgot to mention: I cannot change the view definition as well (for example, to remove the "numcast"), since every now and then the application would recreate it automatically with the same code. :(

  • SQL Agent Job failing - not using credentials in the config file for Data source

    Hi
    We have an SSIS pkg, that is secheduled as SQL Agent job using proxy account. The pkg contanins data source for connecting different SQL servers and the proxy account do not have access to the external DBs. The data source credentials are stored in the Config
    file.
    Why the job is not using the credentials in the config file and try to use the proxy account and failing.
    Do the proxy account need access to all the external dbs in the pkg, and then what is the purpose of the config file.
    I am sorry, i am not SSIS person trying to understand. If any one can explain tha will be great!!
    Thank you!
    VR

    Please take a look at these URLs:
    Schedule a Package by using SQL Server Agent
    SSIS package does not run when called from a SQL Server Agent job step
    Cheers,
    Saeid Hasani
    Database Consultant
    Please feel free to contact me at [email protected] as well as on Twitter and Facebook.
    [My Writings on TechNet Wiki] [T-SQL Blog] [Curah!]
    [Twitter] [Facebook] [Email]

  • Is RTMT can monitor when the first Route Group of a Route List is not used ?

    Hi everyone,
    I want to find how monitor this event in RTMT without success. I hope someone will have an idea to suggest !
    My problem :
    I have one Route List (RL_Remote) wich is used to route calls between two sites. This Route List has two Route Group :
    - the first is a SIP trunk connected to my remote site (RG_SIP)
    - the second is a local route group wich used PSTN (RG_PSTN) [BACKUP]
    Is it possible that RTMT sends me an alarm when calls are routing via RL_Remote but are not using RG_SIP ?
    In fact, I want to receive an alarm as soon as the Backup Route Group (RG_PSTN in my example) is used.
    Thanks for your help !
    Have a nice day,
    Franck-Emanuel

    More or less correct yes:
    Core Issue
    This issue can occur if an available route is not found in the indicated route list.
    If  the call fails on the current gateway, Cisco CallManager attempts to  extend the call to the next route in the route list. This occurs until  it reaches the last route. If the call cannot be completed with the last  gateway, the Route List Exhausted event is logged.
    These are possible reasons for a failure on the current gateway:
    Unallocated number, such as a non-existing destination
    Busy user
    Out of bandwidth   
    Gateway fails to respond to the call setup request 
    The user receives alerts similar to this in the Real-Time Monitoring Tool (RTMT):
    Most  Recent Alert Raised: At 09:19:27 on 12/21/2005 on cluster  CALLMANAGER1-Cluster. Number of RouteListExhausted events exceed 0  within 60 minutes.
    There  are at least five RouteListExhausted events (up to 30) received during  the monitoring interval from 09:07:27, 12/21/2005 to 10:07:27,  12/21/2005.
    https://supportforums.cisco.com/docs/DOC-29032

  • SQL Injection when using Search by Example on a View Object

    It seems that the SQL queries generated by "Search by Example" pattern (When you drop a view object as a Search Form) are not using bind parameters, and will be vulnerable to SQL injection attacks. This pattern is very handy and could be very useful to create search pages. Is there a way to avoid SQL Injection and still use this feature in ADF?
    Chandresh

    Hi,
    from a training slide developed by Duncan Mills:
    When the user is in Find mode and enters some information, he or she is constructing a ViewCriteria row. Each attribute in the View object exists in this row and any values that the user enters into the fields are mapped into these attributes.
    In most circumstances, you will only ever have one criteria row, although the developer can allow multiple rows if the Create operation is called during Find mode.
    To parse the entered query values, you need to look at each row, and then at each attribute. Calling getAttribute() returns the value the user entered (if any) for that field. You can then pass that string to a filter routine (shown in the next slide), which inspects this value for errors.
    The filter routine can then change the example value if required and reset the criteria.
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    protected String detectInjection(String criteria) {
      boolean reject = false;
      String testPattern =       "^(>=|<=|=<|=>|<|>|<>|!=|=|BETWEEN|IN|LIKE|IS)";
      String testCriteria = criteria.trim().toUpperCase();
        if (testCriteria != null && testCriteria.length() > 0) {
          Pattern pattern = Pattern.compile(testPattern);
          Matcher matcher = pattern.matcher(testCriteria);
          if (matcher.find())
            reject = true;
        return reject?null:criteria;
      }Frank

  • Why is my SQL not using an index?

    I have a small SQL query (10g) where I join to basic table together on a customer_id column.
    select *
    from customer c
    inner join work_item sp1 ON sp1.customer_id = c.customer_id
    and I am using TOAD, which tells me (in the Explain Plan area), that I'm doing a "TABLE ACCESS FULL" scan on the customer table.
    But when I look at the details of BOTH tables, I can clearly see that they both have an index on the customer field, and they are both the same data types...
    The interesting thing, is that if I change the query to only select data from the work_item table,
    select sp1.*
    from customer c
    inner join work_item sp1 ON sp1.customer_id = c.customer_id
    I can see that the indexes are being used...
    Why is this? I must be able to select certain columns from the customer table, but why would it not use an index when I do?
    Thanks!

    If I understand correctly, below is a simple test case.
    I created a small table and indexed "object_id" column.
    When I issue "Select * from t" optimizer goes with FULL TABLE SCAN, whereas wehn "select OBJECT_ID from t" is issued, optimizer chooses to read from the index instead of accessing the table. This is because FAST FULL SCAN is far cheaper than a FTS in this case.
    SQL> create table t as select object_id, object_name from all_objects;
    Table created.
    SQL> exec dbms_stats.gather_table_stats(user, 't');
    PL/SQL procedure successfully completed.
    SQL> create index t_idx1 on t(object_id);
    Index created.
    SQL> set autotrace traceonly exp
    SQL> select * from t;
    Execution Plan
    Plan hash value: 1601196873
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      | 37932 |  1074K|    55   (2)| 00:00:01 |
    | 1 | TABLE ACCESS FULL| T | 37932 | 1074K| 55 (2)| 00:00:01 |
    SQL> select object_id from t;
    Execution Plan
    Plan hash value: 3958994525
    | Id  | Operation            | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT     |        | 37932 |   185K|    25   (0)| 00:00:01 |
    | 1 | INDEX FAST FULL SCAN| T_IDX1 | 37932 | 185K| 25 (0)| 00:00:01 |
    SQL>

  • Sql is not using index

    SELECT DISTINCT eval.match_student_name (a.booking_id,
                                             2059980
                                            ) "Student Name",
                    NVL (b.student_email, b.email_address) email_address,
                    a.booking_id "Student Registration Number",
                    b.customer_name "Company Name",
                    DECODE (b.pmt_confirmed,
                            'E', 'Exception',
                            'Y', 'Yes',
                            'N', 'No'
                           ) "Confirmed Commitment ",
                    '1' "Edit", a.title "Class Id",
                    b.exception_comments "Exception Comments",
                    NVL (b.opn_member, 'N') "OPN_Member",
                    NVL (b.opn_partner_name, '-') "OPN Company Name",
                    a.booking_id "View Attendance",
                    DECODE (eval.check_bookingid_push_gsi (a.booking_id),
                            1, apex_item.checkbox (1, a.booking_id, 'Checked'),
                            apex_item.checkbox (1, a.booking_id, 'Disabled')
                           ) "Select",
                    DECODE
                       (eval.check_bookingid_push_gsi (a.booking_id),
                        1, 'Ready TO push TO GSI',
                        2, 'In Progress',
                        3, 'Complete',
                        'MANUAL'
                       ) "Booking ID Status"
               FROM ( select * from eval.eattend_student_attendance where title = 2059980 ) a,
                    ( select * from eval.eattend_student_info where verified_by IS NOT NULL ) b
              WHERE
                --AND b.verified_by IS NOT NULL
            a.title = b.title
           AND a.booking_id = b.booking_id
           ORDER BY a.booking_idExecution Plan
    Plan hash value: 3921177175
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 11 | 1870 | 353 (3)| 00:00:05 |
    | 1 | SORT ORDER BY | | 11 | 1870 | 353 (3)| 00:00:05 |
    | 2 | HASH UNIQUE | | 11 | 1870 | 352 (3)| 00:00:05 |
    | 3 | NESTED LOOPS | | | | | |
    | 4 | NESTED LOOPS | | 11 | 1870 | 351 (2)| 00:00:05 |
    |* 5 | TABLE ACCESS FULL | EATTEND_STUDENT_ATTENDANCE | 11 | 176 | 318 (3)|
    |* 6 | INDEX RANGE SCAN | PERF_EATTEND_STUDENT_INFO_N98 | 1 | | 2 (0)| 0
    |* 7 | TABLE ACCESS BY INDEX ROWID| EATTEND_STUDENT_INFO | 1 | 154 | 3 (0)| 0
    pls see the table full access of EATTEND_STUDENT_ATTENDANCE , i have a index in that table for a column being used in sql. why index not used ???
    thanks
    Raj

    Because Optimizer thinks that the query will take longer when using an index.
    http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:736825544526
    http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:9422487749968
    Please use:
    explain plan for [your query];and then
    select * from table(dbms_xplan.display);when you want an execution plan.

  • USE a SQL Alias when configuring SSRS wizard.

    I am using SSRS 2008 R2.
    on my SSRS machine. I went and created the SQL Alias (both for 32 bit and the other one)
    Then I ran the SSRS configuration wizard and tried to configure teh SSRS service to create a report server database by using a SQL Alias.
    it connects to the DB fine but at the last step it gives an error saying no such host.
    Has anyone been able to configure SSRS Service when they used an alias for the sql server?
    val it: unit=()

    Hi,
    I have created a report server database using a SQL Server Account, and everything goes well. Generally, the error message “No such host is known” indicates the target server is not available or refusing the connection. First, ensure the target database
    server is configured to use the “SQL Server and Windows Authentication mode”. 
    From your description, on the “Database Server” tab of the “Report Server Database Configuration Wizard”, it connects to the database server successfully after typing the SQL Server Account credentials. Right?
    If so, please ensure to select “SQL Server Credentials” on the “Credentials” tab.
    If not, please input the SQL Server account credentials on the “Database Server” tab, and test the connection.
    If the issue persists, please post the error details as well as the related error message in the Reporting Services Log file.
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

  • Route-List not using 2nd Route-Group when PRI cable is removed from H323 gw

    CCM 4.1.3sr3b
    Router - 2811 - 12.4.4T2
    1 site with 2 gateways, gw1 and gw2
    RL has both gateways as RG's.
    If gw1 has its PRI cable removed, CCM RL will not pass call into gw2 - Not working.
    If gw1 is turned of/Ethernet removed RL will wait the h323 timeout before passing call to gw2 - Working OK.
    Is this how H323 works if the PRI is down ?
    I know MGCP would work but is not an option.
    I would have thought that the H323 gw1 would report that there are no resources available in the cause code and the CCM when then use the second choice in the RL.
    Now, this is a service parameter "Stop Routing on User Busy Flag*" which is set to true, but this only relates to intercluster trunks.
    I've tried playing with the few voice hunt command on the router with no luck.
    Any advice or pointers.
    Thanks

    Yes, saw this next to the user busy flag, but the help says this about "Stop routing on unallocated number"
    "This parameter determines routing behavior for intercluster trunk calls to an unalloc ted number. An unallocated number represents a dialed directory number that does not exist in a Cisco cluster. Valid values specify True or False. When the parameter is set to True and a call that is being routed to a remote Cisco cluster through a route list is released by a remote Cisco CallManager because of the unallocated number, a local Cisco CallManager will stop routing the call to a next device in the route list. When the parameter is set to False, the local Cisco CallManager will route the call to the next device."
    Again, it talks about intercluster links, I will try on Monday.
    Thanks

  • Email Not Ready Icon visible in CSD when no Email server is used

    HI,
         We have implemented a new contact center in the UCCX 7.0(1)SR5 cluster with no Email feature. But when one logins into the CSD, you see this Email Not ready icon appeneded to the current agent status. Note that this is not the case with all the agents and also doesn;t always happen to the same agent. When I ask the agent to completely close out of CAD and log back in, it just magically disppears. I also checked that these icons are marked as not visible in the CDA. This is not affecting anything but the supervisors are confused when they see this status appened to a few agents espl. when we are not using any email fucntionality and our cluster doesn't include any email server. Please see the screen shot below.
    Any thoughts or leads is highly appreciated!
    Thanks,

    Hi
    This mostly looks like a defect which requires more investigation.
    I will request you to open up a TAC case if you haven't done yet
    Thank you
    Anuj

  • Oracle 10.2.0.4 Index on timestamp column not used when SYSTIMESTAMP Used.

    Hi,
    I have a table A with a column B timestamp(6). The tables contains around 300000 rows..
    I have created index 'idx' on the column B.
    When i compare column 'B' with systimestamp, it does not use the index, whereas if i compare 'B' with sysdate it uses the index.
    Eg :
    select count(*) from a where b<=sysdate;
    The above used the index 'idx' and executed in 1 second
    select count(*) from a where b<=systimestamp;
    The above does not use the index and executed in 19 seconds.
    Any Clue?
    Thanks in Advance

    Oracle is using Internal functions when you use SYSTIMESTAMP:
    Work around will be to use TO_TIMESTAMP as shown below.. Or define a function based index..
    You can check performance problem querying against a "TIMESTAMP WITH TIME ZONE" column link also
    SQL> create table a(b timestamp(6));
    Table created.
    SQL> insert into a
      2  select systimestamp+(level/24) from dual connect by level <= 30000;
    30000 rows created.
    SQL> commit;
    Commit complete.
    SQL> create index ndx on a(b);
    Index created.
    SQL> explain plan for
      2  select count(*) from a where b <= sysdate;
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 3858831102
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |     1 |    13 |     1   (0)| 00:00:01 |
    |   1 |  SORT AGGREGATE   |      |     1 |    13 |            |          |
    |*  2 |   INDEX RANGE SCAN| NDX  |     1 |    13 |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("B"<=SYSDATE@!)
    Note
       - dynamic sampling used for this statement
    18 rows selected.
    SQL> explain plan for
      2  select count(*) from a where b <= systimestamp;
    Explained.
    SQL>  select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 3918351354
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |     1 |    13 |    20  (15)| 00:00:01 |
    |   1 |  SORT AGGREGATE    |      |     1 |    13 |            |          |
    |*  2 |   TABLE ACCESS FULL| A    |     1 |    13 |    20  (15)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - filter(SYS_EXTRACT_UTC(INTERNAL_FUNCTION("B"))<=SYS_EXTRACT_UTC(S
                  YSTIMESTAMP(6)))
    Note
       - dynamic sampling used for this statement
    19 rows selected.
    --"Just tried using TO_TIMESTAMP"
    SQL> explain plan for
      2  select count(*) from a where b <= to_timestamp(systimestamp);
    Explained.
    SQL>
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 3858831102
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |     1 |    13 |     2   (0)| 00:00:01 |
    |   1 |  SORT AGGREGATE   |      |     1 |    13 |            |          |
    |*  2 |   INDEX RANGE SCAN| NDX  |     4 |    52 |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("B"<=TO_TIMESTAMP(TO_CHAR(SYSTIMESTAMP(6))))
    14 rows selected.Edited by: jeneesh on Oct 23, 2012 11:18 AM

  • Why Inner join or Outer join is not used for Pool or Cluster tables  ?

    Hi SAP-ABAP Experts .
    With Due Regards .
    May u explain me why Inner join or Outer join is not useful for Pool or Cluster tables  ?
    because peoples advised not use Joins for Pool and Cluster tables , What harm will take place , If we do this ?
    Best Regards to all : Rajneesh

    Both Pooled and Cluster Tables are stored as tables within the database. Only the structures of the two table types which represent a single logical view of the data are defined within the ABAP/4 Data Dictionary. The data is actually stored in bulk storage in a different structure. These tables are commonly loaded into memory (i.e., 'buffered') due to the fact they are typically used for storing internal control information and other types of data with little or no external (business) relevance.
    Pooled and cluster tables are usually used only by SAP and not used by customers, probably because of the proprietary format of these tables within the database and because of technical restrictions placed upon their use within ABAP/4 programs. On a pooled or cluster table:
    Secondary indexes cannot be created.
    You cannot use the ABAP/4 constructs select distinct or group by.
    You cannot use native SQL.
    You cannot specify field names after the order by clause. order by primary key is the only permitted variation.
    I hope it helps.
    Best Regards,
    Vibha
    Please mark all the helpful answers

  • Query with SQL-SP gives error, if not used for few days

    Hi All,
    I have observed that if we do not use some of queries (which usage SQL SPs) for few days, then it stops working.
    But when we go in SQL and execute the SP, the query in SAP starts working, without making any change either in query or the SQL-SP.
    Can anybody throw light on this ? I guess it has some connection with SQL-SP behaviour.
    Thanking you in advance ,
    Samir Gandhi
    Edited by: Rui Pereira on May 1, 2009 1:28 PM

    Hi Gordon,
    Please note the function of the SP is to bring selected data from tables, for example to bring Purchase details (I have copy pasted the SP at bottom of this message).
    These are not SP_notif...
    These SPs are called from the SBO query.
    Once we execute the SP in SQL, then it starts working with SBO also.
    set ANSI_NULLS ON
    set QUOTED_IDENTIFIER ON
    GO
    ALTER Procedure [dbo].[pGetPurchaseRegister]
         @StartDate datetime,
         @EndDate  datetime
    as
    if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tmpPurchaseReg1]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
         drop table tmpPurchaseReg1
    if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tmpPurchaseReg2]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
         drop table tmpPurchaseReg2
    SELECT T1.LineNum,T0.DocNum AS 'Document Number', T0.DocDate AS 'Posting Date', T0.CardCode AS 'Vendor Code',
           T0.CardName AS 'Vendor Name', T0.NumAtCard as 'Vendor Ref. No', T0.VatSum AS 'Total Tax', T0.DocTotal AS 'Document Total' ,
           T1.AcctCode AS 'Account Code',T1.LineTotal AS 'Basic Amount', T1.ItemCode AS 'Item No.', T1.Dscription AS 'Item/Service Description',
           T2.SuppCatNum, T1.INMPrice AS 'Item Cost', T1.Quantity AS 'Quantity',T3.ItmsGrpNam AS'ItemGroup'
    into tmpPurchaseReg1
    FROM  [dbo].[OPCH] T0
          INNER  JOIN [dbo].[PCH1] T1  ON  T1.DocEntry = T0.DocEntry
          INNER  JOIN [dbo].[OITM] T2  ON  T1.ItemCode = T2.ItemCode
          INNER  JOIN [dbo].[OITB] T3  ON  T2.ItmsGrpCod = T3.ItmsGrpCod
          --WHERE T0.DocDate >= CONVERT(DATETIME, [%0], 112)   AND  T0.DocDate <= CONVERT(DATETIME, [%1], 112)  
         WHERE T0.DocDate >=@StartDate  AND  T0.DocDate <=@EndDate
    ORDER BY T0.DocNum
    select  * into tmpPurchaseReg2 from tmpPurchaseReg1
    declare @Total int
    declare @TmpCardCode varchar(200)
    declare @DocNum int
    declare  PurchseRegister_Cursor cursor LOCAL for
         select  [Document Number] from tmpPurchaseReg1 group by [Document Number] having count([Document Number]) > 1 order by [Document Number]
    open PurchseRegister_Cursor
                            fetch next from PurchseRegister_Cursor into @DocNum
                            while @@fetch_status = 0
                            begin
                                        begin
                                drop table tmpPurchaseRegTemp
                                 select top 1 * into tmpPurchaseRegTemp from tmpPurchaseReg2 where [Document Number] = @DocNum 
                             select @TmpCardCode =[LineNum]  from tmpPurchaseRegTemp     
                             update tmpPurchaseReg2 set [Vendor Name] = '',[Total Tax] = 0,[Document Total] = 0
                                                   where  [Document Number] = @DocNum  and [LineNum] <> @TmpCardCode
                                        end
                                       fetch next from PurchseRegister_Cursor into @DocNum   
                            end
    close PurchseRegister_Cursor
    deallocate PurchseRegister_Cursor
    BR
    Samir Gandhi

  • Is it possible to load multiple .xlsx files into a SQL Server Table using SSIS and a Foreach Loop Container when each Excel spreadsheet is comprised of two different worksheets

    So we have an Invoice .xlsx File from a 3rd party vendor. It contains two worksheets..."Enrolled" and "Engaged". The data and data columns in each worksheet is different. Is it possible to loop through multiple .xlsx files using SSIS
    and a Foreach Loop Container for each spreadsheet, and then another Foreach Loop Container to control each worksheet, and pump the Excel data into a SQL Server Table first for "Enrolled" and then for "Engaged"? How can I control the Foreach
    Loop Container in SSIS to process ONLY the "Enrolled" worksheet first? And then the "Engaged" worksheet next?
    I know I have multiples out here and I apologize for that...but right now it seems as though I take three steps forward and then two back.
    Any help would be GREATLY appreciated!
    Thanks in advance!

    If the structure of the Excel sheets does not change from file to file then you can by having one ForEach Loop processing always the "Enrolled" sheet and another always the "Engaged" this is doable because the Excel OLEDB connector allows
    to pick individual sheets, it is problematic therefore when sheet names themselves change.
    MSDN has an example: https://msdn.microsoft.com/en-ca/library/ms345182.aspx
    Arthur
    MyBlog
    Twitter

Maybe you are looking for

  • How to add services for object in ECC6.0

    Hi everybody,                     Can anybody tell me how to add "Services for Object" icon in ECC 6.0 because this icon is there in 4.6C but not coming in ECC 6.0. Thanks in Advance

  • Cannot connect to Cisco WiFi...?  Anyone else?

    I cannot for the life of my connect to my office Cisco 1252 Lightweight AP. I have tested with virtually every setting, including a basic broadcasted SSID of "test" with no security. I always get a "cannot connect to the wireless network" error messa

  • I can't open final cut pro

    I can't open final cut pro. I tried many times but always same message. During reading audio filter "GSP-1101" then stop and error message shows. GSP-1101 is digitech guitar multi effect for.  I erase that app but still same. It says Process:        

  • Can I create material reservations on setting of particular user status?

    I know that Reservation creation can be kept on hold by choosing Never/Create on release etc at operation level. My requirement is , At release of work order - reservation should not be created and on setting of certain user status reservation should

  • Firefox cannot load homepage on local linux desktop

    Firefox cannot establish a connection to 127.0.0.1:8080/apex. Msg - Website 127.0.0.1:8080 does not support encryption for the page you are recovering. Using Oracle-xe with Mandriva and Redhat. Firefox accesses the internet directly.