Batch Program to update data in SQL Server Environment

Dear Experts,
My current scenario is that SAP ECC must send a mass update to an external Data Base (MS SQL Server) in a scheduled Batch Process. The solution that I have thought is:
Batch Process to go through an ABAP table and to trigger a Web Service that will be provided by this MS SQL Server Database. Depending on the performance, the ABAP program will determine how many registers will be sent making loops of N invokations of the same database Web Service.
What do you thikng about this? Does anyone of you have a better solution in tearms of data accuracy and performance?
Thanks a lot for your help,
toni

Hmm  create a stored procedure for insert/update /delete and etc and provide a parameter, see example
CREATE PROCEDURE spInsertNewProduct
@ProductID INT,
@ProductName VARCHAR(20)
AS
IF NOT EXISTS (SELECT * FROM Products WHERE ProductID=@ProductID )
INSERT INTO Products  VALUES (@ProductID,@ProductName )
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence

Similar Messages

  • Connecting to datasource and retrieve, insert and update data in SQL Server

    hi,
    i am trying to retrieve, insert and update data from SQL Server 2000 and display in JSPDynPage and is for Portal Application. I have already created datasource in visual composer. Is there any sample codes for mi to use it as reference???
    Thanks
    Regards,
    shixuan

    Hi,
    See this link
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6209b52e-0401-0010-6a9f-d40ec3a09424
    Regards,
    Senthil kumar K.

  • Insert and update tables from SQL server to oracle database tables

    Hi,
    I am having problem while update data from sql server to oracle database tables.
    I am doing one way insert +updates that is from SQL Server tables ==> Oracle database tables
    I am using tools Sql server Integration service. I can insert data from sql server to oracle but update can't. Please help me how can I update + insert from sql server to oracle database tables easily.
    Thanks in advance.

    Hi,
    What about using Oracle SQL Developer for migration
    http://www.oracle.com/technetwork/database/migration/sqlserver-095136.html
    HTH

  • How can we update data in LDAP server using PL/SQL.

    Hi,
    How can we update data in LDAP server using PL/SQL program.
    Is there any sample code for refrence.
    Thanks,
    Tarun

    Hi Justin,
    Thanks for your help. You got my correct requirements.
    Tim's example returning all the attributes of current user which is admin user. Please correct me if I am wrong.
    I have the following information:
    the admin user and password,server info , port and ldap_base for admin.
    I have uid and password for regular user, I am trying find the ldap_base for regular user, which may be different from adminuser.
    Please help me.
    Thanks,
    Edited by: james. on Jan 12, 2009 5:39 PM

  • Error while exporting data from sql server to excel

    Hi,
    I am trying to export data from sql server to excel.
    The query that I used is s follows
    INSERT INTO OPENROWSET( 'Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\Folder1\abc.xls','select * from [Sheet1$A1:IV65000]')
    select 
    column1,column2.... from Table1
    I get the following error message while doing so..
    String or binary data would be truncated.
    The statement has been terminated.
    One of the column's holds data more than 225 characters.
    What is the way to correct this, i want the whole data of the colum in the excel sheet.

    I haven't had great luck with the INSERT INTO OPENROWSET method.  Can you try one of the many samples from one of these 3 links?
    http://www.excel-sql-server.com/excel-sql-server-import-export-using-vba.htm#Excel%20Data%20Export%20to%20SQL%20Server%20Test%20Code 
    http://www.mssqltips.com/sqlservertip/1540/insert-update-or-delete-data-in-sql-server-from-excel/
    https://www.simple-talk.com/sql/database-administration/getting-data-between-excel-and-sql-server-using-odbc--/
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • Error while reversing data from SQL Server to ODI

    hi,
    I was reversing data from SQL Server Java 1.6_022 in ODI Java 1.5, I was getting error Version Mismatch and I updated ODI Java version to 1.6_022.
    And now, I am getting the below error while reversing the data from SQL Server database.
    0 : 08001 : java.sql.SQLException: No suitable driver
    Looking for the assistance on the same.
    Thanks,
    Abhay

    If everything is fine the reversing should be fine. I would say check again if the Technology of the Model and the also the dataserver is created under the right Technology in topology too.
    also if this doesn't help , Please tell us the steps you have carried so far . Also can you try selective reverse is it showing the tables.

  • Is sql server using trigger to capture change data in SQL server CDC?

    hi all,
    what is the Architecture of SQL server change data capture(CDC)? is sql server using trigger to capture change data in SQL server CDC? for example Change Data Capture (CDC) in SQL Server 2008 using we can capture change Data records INSERTs, UPDATEs, and
    DELETEs applied to SQL Server tables.so my question is SQL server using triggers to capture change data like INSERT TRIGGER, UPDATE TRIGGER and DELETED TRIGGER using each tables after enabled CDC...?
    Thanks
    Tharindu Dhaneenja 
    Tharindu Dhaneenja http://dhaneenja.blogspot.com

    It is not using triggers. The source is the transaction log.
    Related link:
    Basics of Change Data Capture
    ...The source of change data for change data capture is the SQL Server transaction log. As inserts, updates, and deletes are applied to tracked source tables, entries that describe those
    changes are added to the log. The log serves as input to the change data capture capture process. This reads the log and adds information about changes to the tracked table’s associated change table. Functions are provided to enumerate
    the changes that appear in the change tables over a specified range, returning the information in the form of a filtered result set. The filtered result set is typically used by an application process to update a representation of the source in some external
    environment. ...
    Kalman Toth, SQL Server & Business Intelligence Training; SQL Server 2008 Training

  • Using Discoverer 4i to view data on SQL Server

    Hello,
    We have Discoverer 4i set up to work with Oracle 9i. Now our Discoverer users want to use Discoverer to view data that is in SQL Severer. We don't want to rebuild data in SQL Server into 9i. What can we set up so 4i can view and maybe update data that is in SQL Severer. Thank you.

    I can't tell exactly what the problem is, but why don't you try a different approach.  See a couple of the tutorials from the link below, and try it again.
    https://www.youtube.com/watch?v=sbkQEBrhl5M
    https://www.youtube.com/watch?v=Grb9vWmtZe0
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • Best way to push change data from sql server to windows/web application

    i apologized that i do not know should i ask this question in this forum or not.
    i have win apps which will load all data initially from db and display through grid but from the next time when any data will change in db or any data will be inserted newly in db then only change or newly inserted data need to be pushed from db side to
    my win apps. now only sql dependency class is coming to my mind but there is a problem regarding sql dependency class that it notify client but do not say which data is updated or inserted.
    so i am looking for best guidance and easy way to achieve my task. what will be the best way to push data from sql server to win or web client.
    there is two issue
    1) how to determine data change or data insert. i guess that can be handle by trigger
    2) next tough part is how very easily push those data from sql server end to win apps end.
    so looking for expert guide. thanks

    Hello,
    Yes, you can create DML trigger on INSERT and UPDATE to get the changed data into a temp table. And then query the temp table from application.
    If you are use SQL Server 2008 or later version, you can also try to use
    Change data capture, which
    can track insert, update, and delete activity that is applied to a SQL Server table and store the changed values on the Change Table.
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • Copy the data from Sql Server to edirectory using java

    Hi ,
    I am new to e directory.I don't know how it works.Can some one assist
    me on this ,I have to extract data from SQL Server and update these
    data in edirectory.This is needs to be done using java.
    If any one can provide me the sample code or please suggest how to
    proceed .
    Thanks in advance
    dukewarm
    dukewarm's Profile: http://forums.novell.com/member.php?userid=53430
    View this thread: http://forums.novell.com/showthread.php?t=373051

    dukewarm;1792481 Wrote:
    > Hi ,
    >
    > I am new to e directory.I don't know how it works.Can some one assist
    > me on this ,I have to extract data from SQL Server and update these
    > data in edirectory.This is needs to be done using java.
    >
    > If any one can provide me the sample code or please suggest how to
    > proceed .
    >
    > Thanks in advance
    Read the values from SQL server and use LDAP to update the data in
    eDirectory.
    Thomas
    thsundel
    thsundel's Profile: http://forums.novell.com/member.php?userid=128
    View this thread: http://forums.novell.com/showthread.php?t=373051

  • Show data from sql server to oracle db

    Hi,
    I am using oracle 10g R1 on windows 2003 platform. On one machine database 10gR1 is running and on other machine sql server is running. I want to retrieve some data from sql server to oracle database. Please tell me how I can show data from sql server to oracle db.
    Thanks

    To make heterogeneous connection with oracle:
    1.First make an ODBC connection, make entry in System DSN(to create a data source)
    2.Make an entry in tnsnames.ora
    3.Make an entry in listener.ora under SID_LIST_LISTENER
    4.Make an entry in file named init<HS>.ora file located "oracle_base\oracle_home\db\hs\admin"
    5.Restart the listener
    e.g:
    1. create a odbc system dsn named like 'sqlserver'
    2. sqlserver= (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp) (HOST=xx.xx.xx.xx) (PORT=1521))
    (CONNECT_DATA = (SERVICE_NAME=sqlserver))
    (HS = OK)
    3. (SID_DESC = (SID_NAME = sqlserver) (ORACLE_HOME = oracle_base\oracle_home\db) (PROGRAM = hsodbc) )
    4.Create a file named initsqlserver.ora and make the following entry:
    HS_FDS_CONNECT_INFO = sqlserver
    Alternatively, you can copy the file named inithsodbc.ora and rename it to initsqlserver.ora
    and edit as HS_FDS_CONNECT_INFO = sqlserver
    5. lsnrctl reload listener_name
    regards
    adnan kaysar

  • Cumulative update 15 for SQL Server 2012 SP1 is released

    Cumulative update 15 for SQL Server 2012 SP1 is released
    http://support.microsoft.com/en-us/kb/3038001
    MDS related fix is:
    FIX: Add three stored procedures to clean up history that is created when you use SQL Server 2012 MDS
    http://support.microsoft.com/en-us/kb/3036601
    After using MDS for a while, the transaction/validation/staging history may grow very large. In this CU we provide 3 store procedure to clean them up manually.
    The fix will be ported over to SQL 2012 SP2 and SQL 2014 CUs in the coming 2 months.
    In next SQL Server release, it will be automated by MDS maintenance job.
    --@ModelID is the model ID that you clean up the log for.
    --@CLeanupOlderThanDate is the date before that the logs or records is deleted.
    DECLARE @CleanupOlderThanDate date = '<Date>', @ModelID INT = <ID>
    --Cleanup Transaction History
    EXEC mdm.udpTransactionsCleanup @ModelID, @CleanupOlderThanDate;
    --Cleanup Validation History
    EXEC mdm.udpValidationsCleanup @ModelID, @CleanupOlderThanDate;
    --Cleanup entity-based staging table
    EXEC mdm.udpEntityStagingBatchTableCleanup @ModelID, @CleanupOlderThanDate;

    Hi SelvaOnline,
    I would recommend to install SP2 and the hotfix that came after it.
    If you don't have a reason to install a CU than don't bother with it.
    SP2:
    http://www.microsoft.com/en-us/download/details.aspx?id=43340
    Hotfix for SP2;
    http://support.microsoft.com/kb/2969896/en-us
    Thanks, 
    Teun

  • Exporting data from SQL Server database to Oracle database

    Hello All,
    We need to replicate a table's data of SQL Server database to Oracle database.
    Can this task be accomplished using Import/Export wizard or Linked servers?
    Can help me regarding which Oracle data access components should i download to do this?
    I am using SQL Server 2012.
    And i have Oracle 11g release 2 client installed in my system.
    Thanks in Advance.
    Thanks and Regards, Readers please vote for my posts if the questions i asked are helpful.

    Yes you can definitely transfer data from SQL server to Oracle Have a look at below links
    Export SQL server data to Oracle Using SSIS
    Use OLEDB data provider to transfer data from SQL server to Oracle
    Using Import Export Wizard
    Similar thread
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.
    My TechNet Wiki Articles

  • How to retrieve Min(startDate) and Max(endDate) for different groups of data? (sql server 2000)

    My sample dataset (below) contains 3 groups -- 'a', 'b', 'c'.  I need to retrieve the Min(startDate) and Max(EndDate) for each group so that the output looks something like this (date format not an issue):
    fk   minStart       maxEnd
    a    1/13/1985    12/31/2003
    b    2/14/1986    12/31/2003
    c    4/26/1987    12/31/2002
    What is the Tsql to perform this type of operation?  Note:  the actual data resides in a sql server 2000 DB.  If the Tsql is different between version 2000 and the later versions -- I would be grateful for both versions of the Tsql
    --I noticed that multiple lines of Insert values doesn't work in Sql Server 2000 -- this sample is in Sql Server 2008
    create table #tmp2(rowID int Identity(1,1), fk varchar(1), startDate datetime, endDate datetime)
    insert into #tmp2
    values
    ('a', '1/13/1985', '12/31/1999'),
    ('a', '3/17/1992', '12/31/1997'),
    ('a', '4/21/1987', '12/31/2003'),
    ('b', '2/14/1986', '12/31/2003'),
    ('b', '5/30/1993', '12/31/2001'),
    ('b', '6/15/1994', '12/31/2003'),
    ('b', '7/7/2001', '12/31/2003'),
    ('c', '4/26/1987', '12/31/1991'),
    ('c', '8/14/1992', '12/31/1998'),
    ('c', '9/10/1995', '12/31/2002'),
    ('c', '10/9/1996', '12/31/2000')
    Thanks
    Rich P

    Rich
    It is unclear what you are trying to achieve, you said that it is SQL Server 2000 but provide a sample data with SQL Server 2008 syntax
    Is it possible to use UNION ALL for your queries to make its one 
    select * from
    select * from #tmp2 t1 where exists
    (select * from (select top 1 * from #tmp2 t2 where t2.fk = t1.fk order by t2.startdate) x where x.rowID = t1.rowID)
    UNION ALL
    select * from #tmp2 t1 where exists
    (select * from (select top 1 * from #tmp2 t2 where t2.fk = t1.fk order by t2.Enddate desc) x where x.rowID = t1.rowID)
     as  der order by fk
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How to compare 2 dates in SQL Server 2000 DB using Java?

    How do you compare 2 dates in SQL Server 2000 DB using Java?
    Let's say we have two fields: Date Reported and Target Finish Date.
    Date Reported is 09-10-2004 09:55:55: PM
    Target Finish Date is 09-12-2004 11:59:59: PM
    What i want to happen is i want to convert both dates to days and get the difference of the two.
    can SQL Server 2000 DB do this?

    it doesnt wrk.
    ok here's what i did:
    iv tested a simple code for this case.
    I created a table name tblDate which has 3 columns namely date_ID, date_From (datatype datetime), date_To (datatype datetime).
    I inserted 1 row: date_ID has the value 1, date_From has the value 10/22/2004, and date_To has the value 10/24/2004.
    i run the java code below:
    int days = 0;
              String query = "SELECT date_From, date_To cast(date_From-date_To AS int) AS Diff FROM tblZoo WHERE date_ID = '1'";
              try
                   DBConnect db = new DBConnect();
                   db.openCon();
                   ResultSet rs = db.execute(query);
                   while(rs.next())
                        days = rs.getInt("Diff");
                   db.closeCon();                         
              catch (Exception ex)
                   System.out.println("Error on Execution: " + ex);
              return days;___________
    an error occurred: Error on Execution: java.lang.nullpointerexception

Maybe you are looking for

  • Info Record Text to PR

    Hi All, Can anybody tell me the logical reason why we cannot define the text linkages from PURCHASING INFO RECORD to a PURCHASE REQUISITION in standard SAP? I mean the text cannot be copied from an info record to a purchase requisition. Why?

  • User exit for block changes in PO if movement 101 occured

    Hi, Does anyone knows if there is a user-exit to block changes in the items of a PO, if there was a GR (mov 101) for that item (and considering that didn't was a mov 102 for the same item)? Thanks, Pedro Mariano

  • How to seperate Power Pivot Data Model and Power Pivot Report from Single Workbook.

    HI  Team, Initially, We have created Power Pivot report in workbook, containing Source Data Model as well. Now, we want to convert workbook having model as Shared Data Model, and all report needs to be part of single workbook. I want to implement one

  • The Get Flash Player Link

    Hello, I looked around the forums for an answer and did not find anything that helped me out. At work we use flash, and flex 2 to build swf's to use on our sites. Often we run link checks on our sites to find broken links, or links that are 301ed etc

  • Convert PDFs  to word

    Hi I purchased the Adobe export pdf to word for my iPad and every time I try to convert my documents over it takes me back to the purchase screen. Can you please help me on how to use this feature now that I have paid for it? THank you