Using SQL Server Script to create Oracle DB Schema

Hi,
I have a SQL Server script which does a few things such as creating databases (after dropping), creating tables etc. Now I want to replicate the SQL Server databases and their tables etc in an Oracle9i DB. How would a SQL Server script compare to an Oracle script? i.e. what differences are there? and how would I have to alter the script to have it work on Oracle?
As an example, my SQL Server script would look something like this:
DROP DATABASE test1;
DROP DATABASE test2;
CREATE DATABASE test1;
CREATE DATABASE test2;
GO;
USE test1;
CREATE TABLE Table1 (
TableOneID INT IDENTITY PRIMARY KEY NOT NULL,
Name VARCHAR(255) NOT NULL,
PRIMARY KEY(TableOneID));
CREATE TABLE Table2 (
TableTwoID INT IDENTITY NOT NULL,
TableOneID INT NOT NULL,
PRIMARY KEY(TableTwoID, TableOneID),
FOREIGN KEY(TableOneID) REFERENCES Table1(TableOneID));
USE test2;
CREATE TABLE ....
etc...
thanks!

Also I think
CREATE TABLE table1
( tableoneid INT PRIMARY KEY NOT NULL
, name VARCHAR(255) NOT NULL
, PRIMARY KEY(tableoneid) );should probably be
CREATE TABLE table1
( tableoneid INT CONSTRAINT table1_pk PRIMARY KEY
, name VARCHAR(255) NOT NULL );otherwise you specify the primary key twice (and PRIMARY KEY implies NOT NULL so the NOT NULL is redundant).
Then TABLE2 might need to be something like:
CREATE TABLE table2
( tabletwoid INT NOT NULL
, tableoneid NOT NULL CONSTRAINT table2_table1_fk REFERENCES table1
, CONSTRAINT table2_pk PRIMARY KEY(tabletwoid, tableoneid) );although the table-level constraint syntax could be used for the foreign keys if it meant less editing of your scripts. The "CONSTRAINT constraintname" clause of constraints is optional but recommended, as otherwise they will get system-generated names like "SYS_C005157". (Note that if you specify the FK inline as part of the column definition you do not need to include a datatype.)
If the IDENTITY clause causes a sequential value to be assigned as a default, there is no direct equivalent to that in Oracle. The nearest thing would be a row-level BEFORE INSERT trigger.

Similar Messages

  • How can i run Following SQL Server Script in to Oracle 10g

    I m new in Oracle...
    Create Procedure Insert_profilebasicdetail
    @isubprofileid as int,
    @Copyisubprofileid as int,
    @itranno as int,
    As
    Begin
    Declare @IncKeyId as int
    Declare @tempkeyId as int
    set @IncKeyId=(select isNull(Max(ikeyId),0)as MaxKeyId from profilebasicdetail)
    Declare TempInsert cursor for select ikeyId--,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,iyear
    from profilebasicdetail where isubprofileid=@Copyisubprofileid and itranno=@itranno
    open TempInsert
    fetch from TempInsert into @tempkeyId
    while @@fetch_Status=0
    Begin
    set @IncKeyId = @IncKeyId + 1
    Insert into profilebasicdetail
    (ikeyid,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,itranno,iyear,isubprofileid)
    values(select @IncKeyId,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,'1',
    iyear,@isubprofileid from profilebasicdetail where ikeyId=@tempkeyId)
    fetch next from TempInsert into @tempkeyId
    End
    End
    Regards,
    Ajay

    YOu want to migrate your MS sql server procedure to Oracle procedure
    Before running procedure please set the values of tempkeyId_v variable
    Try this
    Create or replace Procedure Insert_profilebasicdetail( isubprofileid_v  number, Copyisubprofileid_v number, itranno_v number )
    As
         IncKeyId_v  profilebasicdetail.ikeyid%type;
         tempkeyId_v profilebasicdetail.ikeyid%type;
    begin
          select nvl((select Max(ikeyId) as MaxKeyId from profilebasicdetail),0) into IncKeyId_v
          from dual ;
         for i in (select ikeyId--,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,iyear
                from profilebasicdetail
                where isubprofileid=Copyisubprofileid_v and itranno=itranno_v)
         loop
              IncKeyId_v = IncKeyId_v + 1;
              Insert into profilebasicdetail
                   (ikeyid,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,itranno,iyear,isubprofileid)
                   values(select IncKeyId_v,i.iprofileid,i.iquestionid,i.vquestionans,i.cstatusindi,i.dmodifyon,i.imodifyby,'1',
                        i.iyear,isubprofileid_v from profilebasicdetail where ikeyId=tempkeyId_v);
         end loop
    End;
    / Regards
    Singh
    Create or replace Procedure Insert_profilebasicdetail( isubprofileid_v  number, Copyisubprofileid_v number, itranno_v number )
    As
         IncKeyId_v  profilebasicdetail.ikeyid%type;
         tempkeyId_v profilebasicdetail.ikeyid%type;
    begin
          select nvl((select Max(ikeyId) as MaxKeyId from profilebasicdetail),0) into IncKeyId_v
          from dual ;
         for i in (select ikeyId--,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,iyear
                from profilebasicdetail
                where isubprofileid=Copyisubprofileid_v and itranno=itranno_v)
         loop
              IncKeyId_v = IncKeyId_v + 1;
              Insert into profilebasicdetail
                   (ikeyid,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,itranno,iyear,isubprofileid)
                   values(select IncKeyId_v,i.iprofileid,i.iquestionid,i.vquestionans,i.cstatusindi,i.dmodifyon,i.imodifyby,'1',
                        i.iyear,isubprofileid_v from profilebasicdetail where ikeyId=tempkeyId_v);
         end loop
    End;
    / Regards
    Singh

  • Help me conver following SQL server script in to Oracle Script

    could any one help me to conver following script in to oracle script
    Create Procedure Insert_profilebasicdetail
    @isubprofileid as int,
    @Copyisubprofileid as int,
    @itranno as int,
    As
    Begin
         Declare @IncKeyId as int
         Declare @tempkeyId as int
         set @IncKeyId=(select isNull(Max(ikeyId),0)as MaxKeyId from profilebasicdetail)
         Declare TempInsert cursor for select ikeyId--,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,iyear
                   from profilebasicdetail where isubprofileid=@Copyisubprofileid and itranno=@itranno
         open TempInsert
         fetch from TempInsert into @tempkeyId
         while @@fetch_Status=0
         Begin
              set @IncKeyId = @IncKeyId + 1
              Insert into profilebasicdetail
              (ikeyid,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,itranno,iyear,isubprofileid)
              values(select @IncKeyId,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,'1',
                             iyear,@isubprofileid from profilebasicdetail where ikeyId=@tempkeyId)
         fetch next from TempInsert into @tempkeyId
         End
    End
    Regards,
    Ajay

    Thanks Pavan Kumar
    i m new in oracle i don't know anything.
    i run following script on TOAD 9.5 n it gives me error
    could u suggest me how can i run this script means directly on oracle 10g or on TOAD
    if u r at india then could u give me ur mobile number so i can explain my query u clearly.
    Create or Replace Procedure Insert_profilebasicdetail
    p_isubprofileid IN NUMBER,
    p_Copyisubprofileid IN NUMBER,
    p_itranno IN NUMBER,
    As
    v_IncKeyID NUMBER;
    v_tempkeyId NUMBER;
    CURSOR TempInsert IS
    SELECT ikeyid, iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,iyear
    FROM profilebasicdetail
    WHERE isubprofileid=p_Copyisubprofileid and itranno=p_itranno
    Begin
    SELECT MAX(NVL(iKeyID,0))
    INTO v_IncKeyID
    FROM profilebasicdetail;
    FOR r in TempInsert LOOP
    v_IncKeyID = v_InceyID + 1;
    Insert into profilebasicdetail
    (ikeyid,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,itranno,iyear,isubprofileid)
    values(select v_IncKeyId,r.iprofileid,r.iquestionid,r,vquestionans,
    r.cstatusindi,r.dmodifyon,r.imodifyby,'1',
    r.iyear,p_Copyisubprofileid
    from profilebasicdetail
    where ikeyId=r.ikeyId);
    END LOOP;
    EXCEPTION
    WHEN others THEN
    raise;
    End;
    Regards,
    Ajay

  • Sql Server Reporting  services with ORACLE

    We are thinking of using Sql Server Reporting servicesvwith an ORACLE DB.
    I will like to know the pros and cons.
    Any advice would be appreciated..
    Thanks alot.

    Hello,
    You'll find many doc, examples, demos ... on OTN :
    http://www.oracle.com/technology/products/reports/index.html
    http://www.oracle.com/technology/documentation/reports.html
    http://www.oracle.com/technology/products/reports/htdocs/search.html?cat=ALP&col=ALC&submit=Search
    For the Ref Cursors :
    Oracle® Reports Building Reports
    10g Release 2 (10.1.2)
    B13895-01
    40 Building a Paper Report with REF CURSORs
    Regards

  • C# application to execute both oracle and sql server script files.

    Hi All,
    I am suppose to develop an application using c# which can execute oracle script files as well as sql server script files based on some user's choice. 
    Both the script files(oracle/sql server) contains scripts to create tables, create views and create functions.
    What is the best way to do this and which existing c# functions should is use.
    Thanks in advance.

    I am suppose to develop an application using c# which can execute oracle script files as well as sql server script files based on some user's choice. 
    You can use SQL Plus for Oracle. You can have a C# program that issues commands  for  scripts for table, views, triggers  creation and the whole 10 yards to SQL Plus,
    http://docs.oracle.com/cd/B19306_01/server.102/b14357/qstart.htm
    https://www.google.com/#q=sql+plus
    I started writing a program to use SQL Plus to run the scripts, but cI ame to the conclusion that it was a waste of my time.
    A tool called OSM, an Oracle, tool gives a list of script files that need to be run do to a change in a script file based on file timestamp. You can copy the list doing a copy/past operation and drop it into SQL Plus's Command line, and SQL Plus runs the
    scripts.
    For MS SQL Server, you have this, which you can run from a C# program too.
    http://www.webfactory-world.de/wfknowledgebase/wfknowledgebase_wf3.3/Content/AdditionalWindowsSettings/Tutorials/UpdatingSQLDBFromCommandLine.htm
    I would consider using the above from a C# program a waste of time too.
    I look at it this way. If the user doesn't have database admin experience and know how to use DB admin tools, then they have no business doing anything with a database - period.
    BTW, the Invoke statement in VB or C# will run SQL Plus or SQL Server command line tool.

  • Conn problem SQl Server 64 Bit to Oracle 32 bit using SSIS packages

    Hi,
    I am facing the problem with connection SQL(64 bit) to Oracle(32 bit).
    Please give me the solution/guide in right direction.
    Environment is
    S1-----> DBServer : 64 bit Windows Server 2003 Enterprise Edition, 64 Bit SQl Server EE, 64 Bit Oracle 10g Client
    S2----->.AppServer :32 bit Windows Server 2003 Enterprise Edition, IIS, 32 Bit Oracle 10g Client & Server DB
    I have doubt like....
    1.Can i install 32 bit oracle also at (S1) 64 bit SQL Server(SSIS)
    or only 64 bit oracle?
    2.Running command line for SSIS packages at S1
    i am unable to connect S1---->S2 using SSIS packages?
    How can i solve this problem? pl give steps for going right direction.
    Thanks
    JOHN
    [email protected]

    Fabio D'Alfonso wrote:
    Hi,
    I was setting up VMware vCenter 4.1 (probably the only well known and largely used product with this lethal mix) and needed to setup an ODBC access to Oracle on the 32 bit side of Windows to setup the Update Manager server component, which is still a 32 bit application)
    The problem with Oracle configuration is that in no way I found a 32 bit ODBC registered driver after the setup (of the 32 bit client and the 64 database server). I tried some third party driver for oracle (e.g. easysoft).They registered in the 32 bit ODBC manager but they never got a successful connection.
    Also if this vCenter requirement is questionable (more questionable considering that the setup of this 32 component is not allowed on a 32 separate OS, not because it is separate but because is a 32 bit OS) I would get it working.
    Could suggest a way to get this working?
    Thanks
    Fabio D'AlfonsoWhen you install the Oracle client software on Windows (which is necessary to support ODBC, as the Oracle ODBC driver sits on top of the native client software) the ODBC driver is NOT installed by default. You have to go back and do a "custom" install and select the "Windows components".

  • Calling SQL Server Script File in Hypersonic DB

    HI All,
    I am using Hypersonic Database with java swing.
    To update the database, i am getting SQL Server script file through a webservice.
    The problem is i dont have any idea, how i can update Hypersonic Database with the SQL Server script file.
    Please Help.
    Thanks
    Nitin

    Also I think
    CREATE TABLE table1
    ( tableoneid INT PRIMARY KEY NOT NULL
    , name VARCHAR(255) NOT NULL
    , PRIMARY KEY(tableoneid) );should probably be
    CREATE TABLE table1
    ( tableoneid INT CONSTRAINT table1_pk PRIMARY KEY
    , name VARCHAR(255) NOT NULL );otherwise you specify the primary key twice (and PRIMARY KEY implies NOT NULL so the NOT NULL is redundant).
    Then TABLE2 might need to be something like:
    CREATE TABLE table2
    ( tabletwoid INT NOT NULL
    , tableoneid NOT NULL CONSTRAINT table2_table1_fk REFERENCES table1
    , CONSTRAINT table2_pk PRIMARY KEY(tabletwoid, tableoneid) );although the table-level constraint syntax could be used for the foreign keys if it meant less editing of your scripts. The "CONSTRAINT constraintname" clause of constraints is optional but recommended, as otherwise they will get system-generated names like "SYS_C005157". (Note that if you specify the FK inline as part of the column definition you do not need to include a datatype.)
    If the IDENTITY clause causes a sequential value to be assigned as a default, there is no direct equivalent to that in Oracle. The nearest thing would be a row-level BEFORE INSERT trigger.

  • Migration SQL Server 6.5 to Oracle 8.0.5

    I am migrating from SQL Server 6.5 to Oracle 8.0.5 using
    migration Workbench Ver. 1.2.2. The stored procedures are not
    migrated properly where temporary tables are used to store the
    intermediate results of a query on SQL Server 6.5 side. I want
    to look at the coding to create a temporary table with sessionid
    as part of table to make it unique for the session and the user
    on the oracle side using DBMS_SQL package. Any body can give me
    the coding ?
    null

    Surendra kumar (guest) wrote:
    : Oracle Migration Workbench Team wrote:
    : : Surendra,
    : : It seems like the workbench is trying to use 8i temporary
    : tables,
    : : which is the default, this option can be switched off.
    : : Note that there is an option on the Procedures, Triggers and
    : : Views to generate 8i temporary tables, switch this off if
    you
    : : want to work with 8.0 and have an additional sessionid
    column.
    : : This option can be set on all procedures (click on the
    : procedures
    : : category on the SQLServer model pane), or on a per procedure
    : : basis (click on the procedure in the left hand SQLServer
    model
    : : pane).
    : : Hope this solves your problem,
    : : Turloch
    : : Oracle Migration Workbench Team
    : : Surendra Kumar (guest) wrote:
    : : : I am migrating from SQL Server 6.5 to Oracle 8.0.5
    using
    : : : migration Workbench Ver. 1.2.2. The stored procedures are
    : not
    : : : migrated properly where temporary tables are used to store
    : the
    : : : intermediate results of a query on SQL Server 6.5 side. I
    : want
    : : : to look at the coding to create a temporary table with
    : : sessionid
    : : : as part of table to make it unique for the session and the
    : user
    : : : on the oracle side using DBMS_SQL package. Any body can
    give
    : me
    : : : the coding ?
    : : Oracle Technology Network
    : : http://technet.oracle.com
    I have used the correct option and the Migration Workbench is
    not creating the DDL statements correctly for the creation of
    table. Whatever may be the problem I want use DBMS_SQL for
    creation of unique table names with session id as part of the
    table name. I need a sample script to use session id as part of
    table name and to vary the name of the table dynamically in
    DBMS_SQL. It is not accepting the variable name for table name
    in create table statement.
    null

  • Sql Server Management Assistant (SSMA) Oracle okay for large database migrations?

    All:
    We don't have much experience with the SSMA (Oracle) tool and need some advice from those of you familiar with it.  We must migrate an Oracle 11.2.0.3.0 database to SQL Server 2014.  The Oracle database consists of approximately 25,000 tables and 30,000
    views and related indices.  The database is approximately 2.3 TB in size.
    Is this do-able using the latest version of SSMA-Oracle?  If so, how much horsepower would you throw at this to get it done?
    Any other gotchas and advice appreciated.
    Kindest Regards,
    Bill
    Bill Davidson

    Hi
    Bill,
    SSMA supports migrating large database of Oracle. To migrate Oracle database to SQL Server 2014, you could use the latest version:
    Microsoft SQL Server Migration Assistant v6.0 for Oracle. Before the migration, you should pay attention to the points below.
    1.The account that is used to connect to the Oracle database must have at least CONNECT permissions. This enables SSMA to obtain metadata from schemas owned by the connecting user. To obtain metadata for objects in other schemas and then convert objects
    in those schemas, the account must have the following permissions: CREATE ANY PROCEDURE, EXECUTE ANY PROCEDURE, SELECT ANY TABLE, SELECT ANY SEQUENCE, CREATE ANY TYPE, CREATE ANY TRIGGER, SELECT ANY DICTIONARY.
    2.Metadata about the Oracle database is not automatically refreshed. The metadata in Oracle Metadata Explorer is a snapshot of the metadata when you first connected, or the last time that you manually refreshed metadata. You can manually update metadata
    for all schemas, a single schema, or individual database objects. For more information about the process, please refer to the similar article: 
    https://msdn.microsoft.com/en-us/library/hh313203(v=sql.110).
    3.The account that is used to connect to SQL Server requires different permissions depending on the actions that the account performs as the following:
     • To convert Oracle objects to Transact-SQL syntax, to update metadata from SQL Server, or to save converted syntax to scripts, the account must have permission to log on to the instance of SQL Server.
     • To load database objects into SQL Server, the account must be a member of the sysadmin server role. This is required to install CLR assemblies.
     • To migrate data to SQL Server, the account must be a member of the sysadmin server role. This is required to run the SQL Server Agent data migration packages.
     • To run the code that is generated by SSMA, the account must have Execute permissions for all user-defined functions in the ssma_oracle schema of the target database. These functions provide equivalent functionality of Oracle system functions, and
    are used by converted objects.
     • If the account that is used to connect to SQL Server is to perform all migration tasks, the account must be a member of the sysadmin server role.
    For more information about the process, please refer to the  similar article: 
    https://msdn.microsoft.com/en-us/library/hh313158(v=sql.110)
    4.Metadata about SQL Server databases is not automatically updated. The metadata in SQL Server Metadata Explorer is a snapshot of the metadata when you first connected to SQL Server, or the last time that you manually updated metadata. You can manually update
    metadata for all databases, or for any single database or database object.
    5.If the engine being used is Server Side Data Migration Engine, then, before you can migrate data, you must install the SSMA for Oracle Extension Pack and the Oracle providers on the computer that is running SSMA. The SQL Server Agent service must also
    be running. For more information about how to install the extension pack, see Installing Server Components (OracleToSQL). And when SQL Express edition is used as the target database, only client side data migration is allowed and server side data migration
    is not supported. For more information about the process, please refer to the  similar article: 
    https://msdn.microsoft.com/en-us/library/hh313202(v=sql.110)
    For how to migrate Oracle Databases to SQL Server, please refer to the  similar article: 
    https://msdn.microsoft.com/en-us/library/hh313159(v=sql.110).aspx
    Regards,
    Michelle Li

  • Running multiple SSIS packages using SQL Server Agent question.

    I have a multitude of SSIS packages I want to run using SQL Server Agent.  What would the best practice be for running these jobs using SQL Server Agent?  One job per package or running all pakages from one job?  If you have an answer can
    you explain the technical reasoning behind your answer?  Thanks in advance.
    Stan Benner

    Hi, maybe a bit more analysis will give a better answer
    Do all the packages have to run in sequence? (if yes, single job better)
    Can the list of packages to be executed be grouped by dependency (ex package 1,2 and 5 must run in sequence and can be executed by one job, while package 3,4 are not dependent on package 1,2 and 5 can be run by a separate job).
    Can any jobs be run in parallel?
    How often will the package execution sequence change?
    How will you deploy your packages and job? (the more jobs to create the more install script needed and upgrade scenarios become messy).
    My personal preference:
    I create ONE ssis package which is executed by ONE sql agent job. lets call this 'PackageExecutionWrapper.dtsx'
    PackageExectionWrapper then contains multiple 'Execute Package' tasks for the packages you want to execute.
    In the package you can apply any package execution rules - which packages have to run after the other, which packages can run concurrently, which packages should only run if previous succeeded.
    If you need to change the sequence, simple, just update the PackageExecutionWrapper package.

  • Migrating SQL Server 7.0 to Oracle 8i in Different Operating Systems

    I am migrating SQL Server 7.0 Databases on NT to Oracle 8i on Sun 2.6. Is there is any other way other then Migration Workbench.
    If Mig Workbench is OK. What are the steps to do Migration.
    null

    Hi,
    You can perform this action with the Oracle Migration Workbench. Just install the Workbench on the same machine as your SQL Server database.
    You can then configure the workbench to point to the oracle database on your Sun machine.
    You can use the Oracle database on your Sun machine for both your destination database (the database to which you migrate your SQL Server schema and data) and workbench repository.
    In order to do this you will need to configure a tnsnames.ora entry. The tool that will do this configuration for you should be started up at the end of the workbench installation. It is a fairly straightfoward process.
    You then need to create a user in your oracle database that will store the workbench repository.
    Once you have comleted these steps you will be able to migrate SQL Server on NT to Oracle on Sun.
    It is exactly the same process as migrating to Oracle on NT except you are pointing the Workbench to Oracle on a Sun box.
    Regards
    John

  • Migration from sql-server 7.0 to oracle 8i

    Hai,
    I have one huge database in sql-server 7.0.
    That database has chienese,arabic and korean data. And i have created one database in oracle 8.1.6 with character set UTF8.
    By using migration work bench i couldn't transfer sql-server data into oracle 8.1.6 database which has character set utf8.
    But i have managed to transfer sql-server 7.0 to oracle 8.1.6 database which has us7ascii character set.
    Please give me the steps to transfer from sql-server 7.0 to oracle 8.1.6 database which has the character set utf8.
    I need it very very urgetnt.
    Best Regards,
    Sudhir.

    I understand that it would not be in the best interests of Oracle, monetarily that is (at least in the visible/tangible sense), to develop such a migration tool, but since the competition hasn't, why shouldn't you? I'm sure Prabha's not the first to inquire of such a thing, and I'm sure I'd have asked a similar question if I wasn't responding to you in this way. We all know Oracle is the better db - That's why we're here talking about it - but not everyone we do business with understands that, so establishing a two way street is the best way, short of requiring it of our clients, to turn them on to Oracle. I don't really think developing such a thing would hurt your business (unless MS can keep you from doing it). If your product is that much better (which we agree is true), you shouldn't be afraid of the competition. As for being afraid of proprietary constraints, I can't blame you, because I don't know how much it constrains you.
    -Val
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by The Oracle Migration Workbench Team:
    Hi Prabha,
    My first reaction to your question would be "why would anyone want to migrate FROM Oracle and TO SQLServer ?". Oracle is easily the better database !
    ...but no, I don't really think it would be in Oracle's best interests to produce a migration tool that moved users to a propritory Microsoft product/platform..<HR></BLOCKQUOTE>
    null

  • Import multiple files using sql server management studio

    Using sql server management studio I want to do 2 things.
    - Import all txt files from a directory as tables into my DB.
    - Add an additional field to each new table which contains the table name.
    Can anyone help me?

    There are couple of ways to do it:
    File naming conventions : YourFileName_SystemId.txt
    You can create one extra column in table or may be name a table with system id. Then after loading the data you can update that column with the system id.
       components required:
     ForEachLoopContainer - To get file and store file name in a variable
     Expression Task (if SSIS 2012 or above) or variable expression or script task to seperate file name from systemId
     Data Flow Task - to load data
     Execute SQL Task - to update last column or specific table based on precedence constraints  
    Note: You can also add extra column in data flow via
    derived column transformation.
    Ex.:
    Load file via foreach loop
    Split string via seprator
    2: Loading different system file in different folder
    you can have predefined folder structure ex: SystemId1, SyetemId2 etc and can download respective txt file in their system folder. Then you can easily identity which file belong to which system and then load it to the respective table.
    3: Use first row of text file to hold the system value
    Use first row to have the system id and then skip row while fetching data. 
    Note: Then you have to read first row through script task to get the system id.
    hope this will help

  • SAP Crystal Report using SQL Server Authentication and Windows Authenticati

    I'm a SAP Crystal Report, version for Visual Studio 2010 Beginner
    my ingredients are
    1.windows 7 ultimate service pack1
    2.sql server 2008 standard edition
    3.visual studio 2010 pro
    4.SAP Crystal Report, version for visual studio.net
    I was created a report named customersByCity.rpt using OLE DB (ADO) -> Microsoft OLE DB Provider for SQL Server -> I'm supply Server, User ID, Password and Database. I assume me using SQL Server Authentication for my report
    Then, my ASP.NET files as following
    //ASP.NET
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="viewCustomersByCity.aspx.cs" Inherits="viewCustomersByCity" %>
    <%@ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
        Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div><asp:Label ID="lblMsg" runat="server" BackColor="Yellow" ForeColor="Black"></asp:Label>
     <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true"></CR:CrystalReportViewer>
        </div>
        </form>
    </body>
    </html>
    //code-behind
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Collections;
    using CrystalDecisions.CrystalReports.Engine;
    using CrystalDecisions.Shared;
    public partial class viewCustomersByCity : System.Web.UI.Page
        private const string PARAMETER_FIELD_NAME = "city";   
        private ReportDocument customersByCityReport;
        private void ConfigureCrystalReports()
            ConnectionInfo connectionInfo = new ConnectionInfo();
            connectionInfo.ServerName = @"WKM1925-PCWKM1925";
            connectionInfo.DatabaseName = "Northwind";
            connectionInfo.UserID = "sa";
            connectionInfo.Password = "sysadmin25";
            SetDBLogonForReport(connectionInfo);
        private void SetDBLogonForReport(ConnectionInfo connectionInfo)
            TableLogOnInfos tableLogOnInfos = CrystalReportViewer1.LogOnInfo;
            foreach (TableLogOnInfo tableLogOnInfo in tableLogOnInfos)
                tableLogOnInfo.ConnectionInfo = connectionInfo;
        private void SetCurrentValuesForParameterField(ReportDocument reportDocument, ArrayList arrayList)
            ParameterValues currentParameterValues = new ParameterValues();
            foreach (object submittedValue in arrayList)
                ParameterDiscreteValue parameterDiscreteValue = new ParameterDiscreteValue();
                parameterDiscreteValue.Value = submittedValue.ToString();
                currentParameterValues.Add(parameterDiscreteValue);
            ParameterFieldDefinitions parameterFieldDefinitions = reportDocument.DataDefinition.ParameterFields;
            ParameterFieldDefinition parameterFieldDefinition = parameterFieldDefinitions[PARAMETER_FIELD_NAME];
            parameterFieldDefinition.ApplyCurrentValues(currentParameterValues);
        protected void Page_Load(object sender, EventArgs e)
            customersByCityReport = new ReportDocument();
            string reportPath = Server.MapPath("customersByCity.rpt");
            customersByCityReport.Load(reportPath);
            ConfigureCrystalReports();
            ArrayList arrayList = new ArrayList();
            arrayList.Add("paris");
            arrayList.Add("Madrid");
            arrayList.Add("Marseille");
            arrayList.Add("Buenos Aires");
            arrayList.Add("Sao Paulo");
            ParameterFields parameterFields = CrystalReportViewer1.ParameterFieldInfo;
            SetCurrentValuesForParameterField(customersByCityReport, arrayList);
            CrystalReportViewer1.ReportSource = customersByCityReport;
    1st scenario
    When in a runtime, it's keep appear a dialog box. This dialog box ask me to suppy Server, User ID, Password and Database. Once all information is supplied, my report display the data as expected
    2nd scenario
    I change my report using OLE DB (ADO) -> Microsoft OLE DB Provider for SQL Server -> checked on Integrated Security. I just choose Server, and Database. I assume me using Windows Authentication
    When in a runtime, there's no dialog box as above. My report display the data as expected. really cool
    Look's like, when report using SQL Server Authentication there's some problem. but, when report using Windows Authentication, it's fine.
    I'm looking for comment. Please help me

    Hello,
    MS SQL Server 2008 requires you to install the MS Client Tools for 2008.
    Once install then update all of your reports to use the SQL Native 10 as the OLE DB driver.
    The try again, if it still fails search, lots of sample log on code in this forum.
    Don

  • Date type is not captured in Visual composer 7.0 using SQL server as DB

    Date type is not captured in Visual composer 7.0 when using SQL server as DB, and field type is "SmallDateTime" in DB.

    Create new Text tab in fields of Table & select Type as Date in VC or use DSRT date function

Maybe you are looking for

  • Printing/Scanning Problem with HP All-In-One

    As you will see, I am a bit confused as to how my Mac is talking to my HP all in one. I am having printing and scanning problems. When I try to print, nothing happens. I go to print status and the print job is there but the printer is not printing. I

  • Mail messages sometimes displaying twice

    Lately, Mail sometimes displays new messages that have just arrived twice. There don't seem to be 2 actual copies of the message in the inbox, just the same messages displayed twice. It's kind of an odd behavior, really. If a message is clicked on an

  • Block manual stock removal  for a storage type

    Hi, Is there any configurational setting where in we can block manual stock removal (i.e creation of TO with mvt type 999) for a particular storage type. Thanks Prakash

  • Excise duty on KG basis

    Dear experts         At my client place, ED is calculated on KG basis. So is it possible to capture using some conditions types, Please guide me in this issue Regards, Sameer

  • Mac Mini to YUV (Component) projector

    How can I hook up my Mac Mini via YUV cable to a YUV projector ? Bought a DVI to YUV adapter, but it doesn't work. No picture at all. Mac Mini   Mac OS X (10.4.8)   iMac