SQL Server and Database Sequence

I am trying to use the Database Adapter to insert rows into a SQL Server table and have followed the directions in the other post on this topic. Those directions are specific to inserting into an Oracle Database.
If I don't insert the
<sequence-number-field></sequence-number-field>
<sequence-number-name></sequence-number-name>
fields I get an error that you can't insert into an Identity column.
When I add both of the fields in the toplink_mappings.xml file (which having the sequence-number-name for a SQL Server database which doesn't have a separate sequence object) I get this error:
[SQLServer]Invalid object name 'SEQUENCE'. Internal Exception: java.sql.SQLException: [oias][SQLServer JDBC Driver][SQLServer]Invalid object name 'SEQUENCE'. Error Code: 208
Stating that Sequence is not a valid object which makes sense.
So when I remove the sequence-number-name element I get an error when I deploy the process stating that "if you have one of the sequence elements you have to have both".
I must be doing something wrong. Any help is greatly appreciated.

Hi
In a SQL Server database, you can just use an "identity" column. An identity column is automatically populated and incremented. You don't need to put any mapping in the ODI interface. Just keep it blank.
You cannot use the ODI Sequence, because ODI Sequence will be called only 1 time for all you rows (during the "insert rows" step of the IKM), and you'll have the same number for all your rows. Not exactly what you expect for a surrogate key. Actually, it will only work if you're doing a "row by row" loading.
Otherwise, here's a workaround :
- create an ODI variable that get the max ID of your dimension table (select max(row_id) from table_dim_X)
- in your interface mapping, populate the target column with "VARIABLE + ROWNUM"
ROWNUM gives you the number of the row, in oracle database.
In SQL Server, you can use the function ROW_NUMBER()

Similar Messages

  • How to migrate SharePoint 2013 Content and Configuration DataBases to a new SQL Server and DataBases in it?

    Hi,
    We need to migrate Our current 1 clustered SQL Server, Many Configurations DataBases and Many Content DataBases to a brand new clustered SQL server and brand new databases in it.
    How can I do this?
    Can someone list the steps involved?
    Thanks.  

    Hi,
    According to your description, you want to move Content databases  and Configuration databases to a new SQL Server,  refer to this article:
    https://technet.microsoft.com/en-us/library/cc512725.aspx?f=255&MSPPError=-2147217396
    Besides, here is a similar post, you can use as a reference:
    https://social.technet.microsoft.com/Forums/office/en-US/2cd46f7a-d583-41b2-82c2-ddc6d7c43fb8/how-to-move-sharepoint-databases-to-new-sql-server?forum=sharepointadminprevious
    Best Regards,
    Lisa Chen
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Getting List of SQL server and on selection of server get List of Databases using SMO

    Hi,
    I need to have functionality where I need to populate List of available SQL servers from local network, and when i select SQL server from list, get the list of Databases from that Server.
    For this i referenced SQL SMO Dll's and placed two drop down, one lists Server names, and one lists Database names.
    Dlls refered are:
    Microsoft.SqlServer.ConnectionInfo.dll
    Microsoft.SqlServer.Management.Sdk.Sfc.dll
    Microsoft.SqlServer.Smo.dll
    Microsoft.SqlServer.SqlClrProvider.dll
    Microsoft.SqlServer.SqlEnum.dll
    Above DLL's i have copied from SQL server SQL server 2008 installed location
    C:\Program Files\Microsoft SQL Server\110\SDK\Assemblies
    DLL version : 11.0.3000.0
    Code i have used is:
    private void MainForm_Load(object sender,
    EventArgs e)
       DataTable dataTable = SmoApplication.EnumAvailableSqlServers(false);
       cmbServers.ValueMember = "Name";
       cmbServers.DataSource = dataTable;
    //Now, load Databases on selection of Server combo box.
    private void cmbServers_SelectedIndexChanged(object sender,
    EventArgs e)
       cmbDatabases.Items.Clear();
       if (cmbServers.SelectedIndex != -1)
          string serverName = cmbServers.SelectedValue.ToString();
          Server server = new Server(serverName);
          try
             foreach (Database database in server.Databases)
                cmbDatabases.Items.Add(database.Name);
          catch (Exception ex)
             string exception = ex.Message;
    It works where SQL server is installed, but in systems where no SQL server is installed, it is not working, it is not returning list of SQL server and so database list.
    Query is> can you please help me in this regard, what i am missing here, do i need to install any client component to use this?, or anything else what i need to do to make this functionality work.
    Thanks,
    Hemal

    Thanks Michael for replying.
    I have gone through the reply, and the link on how to get the SMO library installed.
    "To install the Client Tooks SDK without installing SQL Server, install Shared Management Objects from the SQL Server feature pack.
    If you want to ensure that SQL Server Management Objects is installed on a computer that will run your application, you can use the Shared Management Objects .msi in the SQL Server feature pack."
    I have few questions on "Shared Management Objects .msi" 
    Where do i get "Shared Management Objects .msi".
    only installing this msi will install SMO?.
    Can i ship this msi with my application installer?
    do i need to install x86 on x86 system and x64 version of msi in x64 system, or x86 can work fine with both, my application
    is x86 only.
    Thanks,
    Hemal

  • Database independant ETL in ODI for SQL Server and Oracle

    Hi,
    We have a requirement to create ETL which can be run for both SQL Server and Oracle.
    We have some tables to be filled from operational database to data warehouse using business requirement.Our goal is to create code which should be database independant.
    We will provide all DB details at the start of execution and it will code for as per provided details.
    The same can be achieved by Talend.
    I wanted to know if same can be achieved in ODI.
    Any pointers regarding this would be helpful.
    Thanks,
    Mahesh

    A quick trick: Provide one more value at the start of execution. It is something like a flag. For example db_flag. It can be either 'O' or 'S'.
    Open both  oracle and sql server KM. Copy one of the KM code to other KM and put an if condition to check the flag.
    if (#DB_FLAG.equalsTo("O")){
    Oracle code goes here...........
    }else{
    SQL Server code goes here...........
    Its a pure KM customization.
    Bhabani
    http://dwteam.in

  • SQL ENTERPRISE: The edition of Reporting Services that you are using requires that you use local SQL Server relational databases for report data sources and the report server database

    The error below makes absolutely no sense! I'm using Enterprise Core...yet I'm being told I can't use remote data sources:
    w3wp!library!8!03/05/2015-19:08:48:: i INFO: Catalog SQL Server Edition = EnterpriseCore
    w3wp!library!8!03/05/2015-19:08:48:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.OperationNotSupportedException: , Microsoft.ReportingServices.Diagnostics.Utilities.OperationNotSupportedException: The feature: "The edition of Reporting
    Services that you are using requires that you use local SQL Server relational databases for report data sources and the report server database." is not supported in this edition of Reporting Services.;
    Really? This totally contradicts the documentation found here:
    https://msdn.microsoft.com/en-us/library/ms157285(v=sql.110).aspx
    That article says remote connections are completely supported.
    ARGH! Why does this have to be so difficult to setup?!?

    Hi jeffoliver1000,
    According to your description, you are using Enterprise Core edition and you are prompted that you can’t use remote data sources.
    In your scenario, we neither ignore your point nor be doubt with what you say. But actually we have met the case before that even though the SQL Server engine is Enterprise but the reporting services is still standard. So I would recommend you to find the
    actual edition of reporting services you are using. You can find Reporting Services starting SKU in the Reporting Service logs ( default location: C:\Program Files\Microsoft SQL Server\<instance name>\Reporting Services\LogFiles). For more information,
    please refer to the similar thread below:
    https://social.technet.microsoft.com/Forums/en-US/f98c2f3e-1a30-4993-ab41-acbc5014f92e/data-driven-subscription-button-not-displayed?forum=sqlreportingservices
    By the way, have you installed the other SQL Server edition before?
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • SQL Server 2012 Database Email is not working with AWS SES Services

    Hi Greetings to all,
    I have issue with the SQL Server Database mail Services. I have Configured Amazon Simple Email Services (AWS SES) as db profile in SQL Server and for last 2 years its working perfectly. But, from last two days on wards it is not working properly the Emails
    are queued but not sent to the recipients. the SES Services are working fine in outlook. but, not working in SQL Server. 
    Please help on this. tried changing the ports no result only one or two emails only sent remaining are failing.the info messages is as below
    Message
    The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 10 (2015-04-10T17:12:41). Exception Message: Cannot send mails to mail server. (The operation has timed out.).
    RehaanKhan. M

    Hello,
    Try to use port 465, port 2587 or port 587 instead of using port 25, as explained on the following articles.
    http://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-issues.html
    http://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-connect.html
    The first of above URLs is intended for troubleshooting SMTP issues in general.
    Verify you the mail account has not reached any limit. Limit of emails per day, per second, etc.
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Entity Framework - Code First - Migration - How to access SQL Server and Oracle using the same context?

    Hello,
    I use Entity Framework code first approach.
    My project is working fine with SQL Server. But, I want to access Oracle too. I want to switch SQL Server and Oracle in run time.
    I am able to access Oracle using "Oracle.ManagedDataAccess.EntityFramework.dl" in a new project.
    But, Is this possible to access SQL Server and Oracle in the same project.
    Thanks,
    Murugan

    This should be possible with a Code-First workflow.  In Code-First the database mapping layer is generated at runtime.
    David
    David http://blogs.msdn.com/b/dbrowne/

  • How to restore SQL Server 2008 database to SQL Server Express 2012

    How to restore SQL Server 2008 database to SQL Server Express 2012.
    I BACKED UP a SQL Server 2008 database from work, which runs the enterprise version of 2008, and I tried to RESTORE it to my new 64-Bit home PC which is running the new SQL Server Express 2012 64-Bit (Advanced Edition).
    But if fails. I get the following message text.
    Can anyone help me please. I thought restoring a 2008 database to the later version 2012 would be possible.
    Here is the error message. Thanks.
    TITLE: Microsoft SQL Server Management Studio
    Restore of database failed. (Microsoft.SqlServer.Management.RelationalEngineTasks)
    ADDITIONAL INFORMATION:
    System.Data.SqlClient.SqlError: The database was backed up on a server running version 8.00.2039. That version is incompatible with this server, which is running version 11.00.3128. Either restore the database on a server that supports the backup, or use a
    backup that is compatible with this server. (Microsoft.SqlServer.SmoExtended)

    ADDITIONAL INFORMATION:
    System.Data.SqlClient.SqlError: The database was backed up on a server running version 8.00.2039. That version is incompatible with this server, which is running version 11.00.3128. Either restore the database on a server that supports the
    backup, or use a backup that is compatible with this server. (Microsoft.SqlServer.SmoExtended)
    Are you sure your database is SQL server 2008 from error message it seems your SQL server version is 2000.I guess you have multiple versions of SQL server.
    AFAIK you cannot restore backup of SQL server 2000 to 2012 directly .Restore it first to SQL 2008/2008R2 or 2005 then take backup again of new database created and then you would be able to restore it on 2012.Its kind of intermediate way
    Also make sure your DB size is less than 10 G as max DB size supported by Express edition is 10 G and if your DB size is more than 10 G restore will fail.
    You are also trying to restore enterprise DB backup on express edition so you will loose enterprise features on express edition
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • Different output of same query in SQL Server and Oracle

    I have two tables table1 and table2
    --table1 has two columns c1 int and c2 varchar. there are not constraints added in it. it has data as given below
    c1     c2
    6     d
    5     j
    102     g
    4     g
    103     f
    3     h
    501     j
    1     g
    601     n
    2     m
    --table2 has only one column c1 int. there are not constraints added in it. it has data as given below
    c1
    6
    1
    4
    3
    2
    now when i run below given query in sql server and oracle it gives me different result
    select *
    from table1
         inner join (SELECT ROW_NUMBER() OVER (order by c1 ASC) AS c1 from table2) table2 on table2.c1=table1.c1
    sql server output
    c1     c2     c1
    1     g     1
    2     m     2
    3     h     3
    4     g     4
    5     j     5
    oracle output
    C1 C2 C1
    5 j 5
    4 g 4
    3 h 3
    1 g 1
    2 m 2
    If you notice the first column in both output. It is sorted in sql server and not in oracle.
    Why it is behaving differently in oracle? Is there any way I can solve this in oracle?
    Thanks,
    Jigs

    It is NOT behaving "differently" in Oracle; you just haven't specified an order that you expect your results to be in, so you're going to get output in whatever order the database fancies displaying it (ie. no guarenteed order). This is an artifact of how the database chooses to put together the data, and different databases (or even datasets within the same database) can and most likely will behave differently.
    Even SQL Server won't guarentee to always get your data in an ordered fashion if you exclude the order by clause, even if you think it has always output the data in an ordered fashion.
    Your solution is to add an order by clause, in BOTH databases, to force the order of the output data.

  • SQL Server and Reporting Services

    What is the best practice for replicating the same reports for different clients using different databases in the same SQL Server and Reporting Services?
    For example:
    Create a single database for each client.
    Create a single data source in Reporting services for each client.
    Create a folder in Reporting Service for each client, and replicate all the report and point each report to its correct data source.
    Is there an easier method for this type of solution.

    Hi acedenoBI,
    According to your description, you have reports which has same structure for each user. Now you want to have a folder for each client to keep their reports. And each client should have a single database and single data source. Right?
    In Reporting Service, if we need one data source to connect different database dynamically, we may need to use parameter and create dynamic connection string. However, in this scenario, since we need to have a single folder and data source for each
    client, so we can just make copies of the whole project. Modify the Connection string in each data source, change the Initial Catalog to be the corresponding database for the client. This can be an easy way to meet the requirement.
    If you have any feedback on our support, please click
    here.
    Best Regards,
    Simon Hou

  • Extract the data from SQL Server and Import into Oracle

    Hi,
    I would like to run a daily job that will export the table data from SQL server table (it will be only one or two table) and Import back into Oracle table (it might one or two table tables).
    Could you please guide me that how can i do this using either sql server or oracle?
    We have oracle 9.2 and sql server 2005.
    Normally i do from flat file which is generated by source destination nand i dump into oracle using sql*loader but this time I have to directly extract/export the data from MS Sql server and load into Oracle table, mostly it will reload so i might doing any massaging data during the load.
    If you show me the detail approach, it will be really appreciated.
    I have access to Sql server but i don't how to use sql server to do this or using oracle as a daily job even becuase have to schedule the job for this as it will be a daily job.
    Thanks,
    poratips

    Unless you can find an open source ODBC driver for SQL Server that runs on Solaris (and I wouldn't be overly hopeful there) Heterogeneous Services would require that you license something-- a third party ODBC driver, a new Oracle instance, or an Oracle Transparent Gateway.
    As I stated below, you could certainly use SQL Server's ETL tool, DTS. Oracle's ETL tools would require additional licensing since you're just on 9.2. You could also write a small application (Java or otherwise) that connected to both databases and transferred the data. If you're particularly enterprising, you could load the SQL Server Type 4 JDBC driver into Oracle's JVM and write a Java stored procedure that connected to the SQL Server database via JDBC, but that's a pretty convoluted approach.
    Justin

  • How to Perform Forced Manual Failover of Availability Group (SQL Server) and WSFC (Windows Server Failover Cluster) with scrpiting

    I have a scenario with the three nodes with server 2012 standard, each running an instance of SQL Server 2012 enterprise, participate in a
    single Windows Server Failover Cluster (WSFC) that spans two data centers.
    If the nodes in the primary data center are unavailable due to data center outage. Then how I can able to access node in the WSFC (Windows Server Failover Cluster) in the secondary disaster recovery data center automatically with some script.
    I want to write script that can be able to check primary data center by pinging some IP after every 5 or 10 minutes.
    If that IP is unable to respond then script can be able to Perform Forced Manual Failover of Availability Group (SQL Server) and WSFC (Windows Server Failover Cluster)
    Can you please guide me for script writing for automatic failover in case of primary datacenter outage?

    You are trying to implement manually what should be happening automatically in the cluster. If the primary SQL Server becomes unavailable in the data center, it should fail over to the secondary SQL Server automatically.  Is that not working?
    You also might want to run this configuration by some SQL experts.  I am not a SQL expert, but if you have both hosts in the data center in a cluster, there is no need for replication between those two nodes as they would be accessing
    the database from some form of shared storage.  Then it looks like you are trying to implement Always On to the DR site.  I'm not sure you can mix both types of failover in a single configuration.
    FYI, it would make more sense to establish a file share witness in your DR site instead of placing a third node in the data center for Node Majority quorum.
    . : | : . : | : . tim

  • How to set the CLASSPATH for an  Sql Server 2005 database... help me please

    Hello! Guys I want to access a Sql Server 2005 database from Java.I've downloaded the JDBC 2.0 driver from Microsoft.I've copied the sqljdbc4.jar file to C:\Java\jdk1.6.0_14\db\lib.And I've added this to the classpath C:\Java\jdk1.6.0_14\db\lib\sqljdbc4.jar.The classpath variable is defined as a user variable.Well the point is that I get that nasty exception:Exception in thread "main" java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver.So if you know how to help me,please do so.Thank you :)

    Hi Timo,
    My jdev version is 10.1.3.3.0, this is for R12. By PR i mean to say process request and PFR process form request in the controller.
    In the Process request of the controller, i am finding the checkbox bean and assigning the firepartialaction for it.
    Later in the process form request for the fired event, i am trying to handle the rendered property of the messagetextinput. Is this a right approach?
    my code below
    public void processRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    super.processRequest(oapagecontext, oawebbean);
    OAApplicationModule oaapplicationmodule = oapagecontext.getApplicationModule(oawebbean);
    OAMessageCheckBoxBean oamessagecheckboxbean = (OAMessageCheckBoxBean)oawebbean.findChildRecursive("X_FLAG");
    if(oamessagecheckboxbean != null)
    oapagecontext.writeDiagnostics(this, "Message check box Bean found:", 1);
    FirePartialAction firepartialaction = new FirePartialAction("change");
    oamessagecheckboxbean.setAttributeValue(PRIMARY_CLIENT_ACTION_ATTR, firepartialaction);
    oamessagecheckboxbean.setFireActionForSubmit("change", null, null, true);
    oapagecontext.writeDiagnostics(this, "setting fire event", 1);
    public void processFormRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    super.processFormRequest(oapagecontext, oawebbean);
    oapagecontext.writeDiagnostics(this, "Inside Process Form Request", 1);
    if("change".equals(oapagecontext.getParameter(OAWebBeanConstants.EVENT_PARAM)))
    OAMessageTextInputBean bean = (OAMessageTextInputBean)oawebbean.findChildRecursive("X_NUMBER");
    if(bean!=null){
    bean.setRendered(Boolean.TRUE);}
    Thanks,
    Malar

  • Get an image from a varbinary field in an SQL Server 2005 database

    Hi:
    In a varbinary(MAX) field of an SQL Server 2005 database I
    storage JPG images. I design a webservice that returns the
    following XML structure:
    Public Class IMAGEN
    Public ErrorConsulta As Long
    Public Imagen As Byte()
    End Class
    The response look like this:
    <FLEXOBTENERIMAGENResponse>
    <FLEXOBTENERIMAGENResult>
    <IMAGEN>
    <ErrorConsulta>0</ErrorConsulta>
    <Imagen>/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgH....</Imagen>
    </IMAGEN>
    </FLEXOBTENERIMAGENResult>
    </FLEXOBTENERIMAGENResponse>
    Where the node Imagen are thousands of caracters that
    represents the JPG image.
    How can I show this JPG in an Image control of a Flex Builder
    2 or 3?
    If you need more information please let me know.
    Thanx in advance.

    Assuming that you have text fields storing the Y N then on
    the output you
    have a code block like this
    <%
    If recordset.fields.item("wheelchair").value = "Y" then
    %>
    <img src="images/wheelchair.gif">
    <%End if%>
    However is your field is set to be a Yes/No type then the
    best way is to
    write the test like this
    If recordset.fields.item("wheelchair").value = TRUE then
    Paul Whitham
    Certified Dreamweaver MX2004 Professional
    Adobe Community Expert - Dreamweaver
    Valleybiz Internet Design
    www.valleybiz.net
    "Lancs" <[email protected]> wrote in message
    news:e6srl5$jul$[email protected]..
    > Using ASP/VBscript and Access
    > I'm making a page that dislays a listing of
    organisations (using Repeated
    > Regions) concerned with disabilities. I want to use
    images for symbols
    > that
    > indicate whether, for example, an organisation uses
    textphones, has
    > wheelchair
    > access, and the like. I'm using a form to add new
    records to the database.
    > I
    > want the form to allow users to select the applicable
    symbols using
    > checkboxes.
    > What code will allow the listing page to interpret a Y
    value as an image
    > path
    > and ignore a N value.
    > Thanks
    >

  • SQL Developer, SQL Server and the ampersand

    Hello,
    I am connected to a SQL Server database (2008) and am having difficulty getting a query to run properly in SQL Developer (3.1.07).
    Simplified Example
    select table_field
    from table
    where table_field <> 'This & That';
    Expected results
    table_field
    Other stuff
    Other stuff
    Other stuff
    Actual results
    table_field
    Other stuff
    This & That
    This & That
    I cannot seem to get SQL Developer to recognize the & as a literal ampersand. I've tried escaping it numerous ways, but it always thinks it is a variable.
    The query works exactly as expected in MS SQL Management Studio and Toad. Of course, I can just run it in one of those but I'd like to try to get this to work in SQL Developer. Suggestions?
    Please let me know if I can provide further information. Thanks.

    Hi,
    SQL Developers worksheet is designed for Oracle, but we allow you to run statements against SQL Server and other non Oracle databases.
    This can lead to some quirks, like the one you experienced.
    Oracles SQL*Plus uses ampersand to define substitution variables.
    Oracle SQL Developer has implemented the same concept.
    Unfortunately this does not make sense when running something against a non Oracle database.
    As a workaround, you can run the following SQL*Plus command in SQL Developer, before your SQL Server query.
    SET DEFINE OFF;
    select 'hello & goodbye';
    The following maybe of some help as well.
    http://dermotoneill.blogspot.com/2010/11/workheet-hints.html
    http://dermotoneill.blogspot.com/2010/12/sql-server-and-sybase-browsing.html
    Regards,
    Dermot.
    SQL Developer Team.

Maybe you are looking for

  • Carriage Return ignored in ABAP Created HTML?

    We are in the pre-production box for an upgrade. We have ABAP source code that generates HTML logic. It worked fine in 4.6. The carriage return/line feeds are being ignored. I have already tried all the cl_abap_char_utilities=>NEWLINE                

  • PO created but Status showing as Awaiting for approval in extended classic

    Hi Experts, SRM 5.0 extended classic scenario,SC approved and PO created but status showing in follow on documents node in SC as awiting for approval. Can any help in finding solution.Thanks in advance. Thanks, Babu

  • Seeking a BIOS update for RS482-M

    Hi Guys, I am looking for a new BIOS for my MSI Motherboard - it might be that its currently up-to-date already but, I am always looking for the most up-to-date firmware! Anyway, my POST screen gives me the following information: "RS482-M ver 1.0C 09

  • Workbook - Import & Export authorization

    Hi , I wanted to apply OSS Note "592918 - Error message "Workbook storage fault: " during opening". Start role maintenance transaction (PFCG) 2. Select role 3. Choose "Change" button 4. Select tab "Authorizations" 5. Choose "Change authorization data

  • What is better to use and why?

    Hi, What is better to use and why? We have written follwing statements to check the existence of interested record in table. 1). select count(*) from emp where deptno = 20; 2). select 'X' from dual where exists ( select 'X' from emp where deptno = 20