Using SQLCMD variables in SQL Server Unit Test Project

Is it possible to use SQLCMD variables in my SQL Server Unit Test Project? In my test initialize script I'd like to set a database name variable, something like this:
:SETVAR MyDatabase "mydatabase"
SELECT * FROM [$(MyDatabase)].[mytable]
but I get syntax errors when I run the test. Any suggestions how I can get this to work.
Result Message: Initialization method
myTest.TestInitialize threw exception. System.Data.SqlClient.SqlException: System.Data.SqlClient.SqlException:
Incorrect syntax near ':'..

Hi Kevin,
What is the error?
This should work only thing i could see is no scheme specified.
SQL Server uses dbo as default schema.
In your case:
:SETVAR MyDatabase "mydatabase"
SELECT * FROM [$(MyDatabase)].dbo.[mytable]
Also check your instance collation if its Case sensitive then specify database and table name as exact case.
Example:
:SETVAR MyDatabase "[mydatabase]"
:setvar schemavar "[dbo]"
:setvar tablevar "[mytable]"
SELECT * FROM $(MyDatabase).$(schemavar).$(tablevar)

Similar Messages

  • SQL Server Unit Tests

    Hi SQL Server Experts,
    About SQL Server Unit Tests (vide
    http://msdn.microsoft.com/en-us/library/jj851203(v=vs.103).aspx), please help with inputs on pros and cons of SQL Server Unit Tests. Any ideal recommendation?
    Thanks

    Blog on the topic: "Database unit testing is used for feature testing of your individual modules (stored procedures, triggers or user defined functions) that is to say your module performs as expected.  Apart from that, it is also used to ensure that
    subsequent changes to the module does not break any functionality.
    At first glace, it looks like this would add overhead to create vs. doing adhoc testing, but Visual Studio lets you automatically generate T-SQL code stubs to test the database object which you can customize as per your need.
    Visual Studio provides Database Unit Test Designer which you can write/define T-SQL scripts (also insert SQL assertion in this code) that calls your module and then evaluates the execution result against the different test conditions which indicates your
    modules execution success or failure."
    LINK:
    SQL Server Unit Testing with Visual Studio 2010
    >Please pardon my ignorance as I am coming back to SQL Server after a brief gap.
    You may have to brush up with T-SQL prior to using a sophisticated tool like this:
    http://www.sqlusa.com/bestpractices/
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • SSDT: Creation of localDB instances from project file - Sql Server Unit testing purposes

    I have a SqlServer Database Project in my solution (VS2013 Professional) which has a corresponding test project with some stored procedure unit tests. Currently I am using a LocalDB and as far as I understand a local database instance is created in C:\Users\[User]\AppData\Local\Microsoft\Microsoft
    SQL Server Local DB\Instances\Projects and the specific .mdf file referenced in the SQL Server Object Explorer is in C:\Users\[User]\AppData\Local\Microsoft\VisualStudio\SSDT\[ProjectName]. The unit tests run fine on my local machine which I have developed
    the project on.
    My issue is we have a box which is configured to check out the project file from our version control, build the project using ms build commands and then run the unit tests using VSTest.Console. Usually with C# Test projects we reference the test project
    dll and the unit tests run fine. I have referenced the dll for the test project with the stored procedure unit tests in. 
    With the Stored Procedure unit tests however we get this exception: 
    Initialization method [project].[spTest].TestInitialize threw exception. System.Data.SqlClient.SqlException: System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 50 - Local Database Runtime error occurred. The specified LocalDB instance does not exist.
    After some digging I have realised that the localdb instance seems to be created when the project itself is created in VS not when it is built. Specifically when the localdb is first used and if you look into the appData folder of the test machine there
    is no corresponding mdf file for the project.  
    The question is is there a way to set up a localDB instance on the new machine if all you have the project file? The only purpose of the project on the test machine is to run the unit tests, no other development purposes. VS2013 Professional is installed
    on the test machine but a solution only using config file changes or MSBuild/VSTest commands would be preferable.
    I realise you could change the connection string to an actual test database and run the unit tests of that but we quite like the localdb approach for the testing. I also realise that you could potentially transfer the mdf file (haven't tested this solution)
    as well, though I would prefer if there is a solution to my initial question. 
    http://technet.microsoft.com/en-us/library/hh234692.aspx
    http://msdn.microsoft.com/en-us/library/hh309441(v=vs.110).aspx
    I have been reading up on LocalDB and I assume a automatic LocalDB is created when you create a sql server database project (ie on localdb first use). I have tried adding the database creation to the test project config file but do not really know where
    to go from there. The second link does not really specify when the named localdb will be created if you add the config items and I am not even sure if that is an actual solution.  Here's my test project config file for reference
    <configSections>
    <section name="system.data.localdb" type="System.Data.LocalDBConfigurationSection,System.Data,Version=4.0.0.0,Culture=neutral,PublicKeyToken=[PublicKeyToken]"/>
    <section name="SqlUnitTesting_VS2013" type="Microsoft.Data.Tools.Schema.Sql.UnitTesting.Configuration.SqlUnitTestingSection, Microsoft.Data.Tools.Schema.Sql.UnitTesting, Version=12.0.0.0, Culture=neutral, PublicKeyToken=[PublicKeyToken]" />
    </configSections>
    <system.data.localdb>
    <localdbinstances>
    <add name="SimpleUnitTestingDB" version="11.0" />
    </localdbinstances>
    </system.data.localdb>
    <SqlUnitTesting_VS2013>
    <DatabaseDeployment DatabaseProjectFileName="..\..\..\SimpleUnitTestDB\SimpleUnitTestDB.sqlproj"
    Configuration="Release" />
    <DataGeneration ClearDatabase="true" />
    <ExecutionContext Provider="System.Data.SqlClient" ConnectionString="Data Source=(localdb)\Projects;Initial Catalog=SimpleUnitTestDB;Integrated Security=True;Pooling=False;Connect Timeout=30"
    CommandTimeout="30" />
    <PrivilegedContext Provider="System.Data.SqlClient" ConnectionString="Data Source=(localdb)\Projects;Initial Catalog=SimpleUnitTestDB;Integrated Security=True;Pooling=False;Connect Timeout=30"
    CommandTimeout="30" />
    </SqlUnitTesting_VS2013>
    Thanks in advance for any response. Sorry if there is any misunderstanding, while I have been using VS to develop from the start, this is the first time I have used a Sql Server Database Project. 
    Regards,
    Christopher. 

    Yes, you can create a LocalDB instance manually. You use the SqlLocalDb utility, see here:
    http://technet.microsoft.com/en-us/library/hh212961.aspx
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Error using bind variables with SQL server with SQL92 mode

    I am using 2 bind variable in my VO (JDBC positional) . The mode is SQL 92 for ADF BC. I do not use the bind variable directly but in a view criteria. I see following error in the logs.
    The logs show the query executed and error.  I tried both ways - making bind variable required and not required. I have set -Djbo.SQLBuilder=SQLServer property. My other page works which has an updatable VO.
    JDEV version is - JDEVADF_11.1.1.7.0_GENERIC_130226.1400.6493
    <ViewObjectImpl> <getQueryHitCount> [4567] Estimated Row Count for ViewObject: [oracle.epm.fm.bc4j.queries.admin.UserOnSystemROVO]AdministrationAM.UserOnSystemROVO1, Query Statement:
    <ViewObjectImpl> <getQueryHitCount> [4568] "SELECT count(1) FROM (SELECT * FROM (SELECT
        TABLE1.SUSERNAME USERNAME,
        TABLE2.SMODULENAME MODULENAME,
        TABLE2.LACTIVITYCODE ACTIVITYCODE,
        TABLE2.DSTARTTIME STARTTIME,
        TABLE2.SSERVERNAME SERVERNAME,
        TABLE2.SAPPNAME APPNAME,
        TABLE2.LSESSIONID SESSIONID,
        TABLE2.LSESSIONSTATUS SESSIONSTATUS,
        TABLE2.LUSERID USERID,
        TABLE2.DSTILLALIVETS STILLALIVETS,
        TABLE2.LTASKID TASKID,
        TABLE2.SACTIVITYDESC ACTIVITYDESC,
        TABLE1.LUSERID USERID1,
        TABLE1.SUSERDESC USERDESC
    FROM
        TABLE2 TABLE2,
        TABLE1 TABLE1
    WHERE
        TABLE2.LUSERID = TABLE1.LUSERID) QRSLT  WHERE ( ( ( ( UPPER(SERVERNAME) = UPPER(?)  )  OR  ( ? IS NULL ) ) AND ( ( UPPER(APPNAME) = UPPER(?)  )  OR  ( ? IS NULL ) ) ) )) ESTCOUNT"
    <ViewObjectImpl> <getQueryHitCount> [4569] Bind params for ViewObject.getQueryHitCount: UserOnSystemROVO1
    <ViewRowSetImpl> <doSetWhereClauseParam> [4570] UserOnSystemROVO1 ViewRowSetImpl.doSetWhereClause(0, null, null)
    <ViewRowSetImpl> <doSetWhereClauseParam> [4571] UserOnSystemROVO1 ViewRowSetImpl.doSetWhereClause(1, null, null)
    <ViewRowSetImpl> <doSetWhereClauseParam> [4572] UserOnSystemROVO1 ViewRowSetImpl.doSetWhereClause(4, null, null)
    <ViewRowSetImpl> <doSetWhereClauseParam> [4573] UserOnSystemROVO1 ViewRowSetImpl.doSetWhereClause(5, null, null)
    <ViewRowSetImpl> <doSetWhereClauseParam> [4574] UserOnSystemROVO1 ViewRowSetImpl.doSetWhereClause(2, null, null)
    <ViewRowSetImpl> <doSetWhereClauseParam> [4575] UserOnSystemROVO1 ViewRowSetImpl.doSetWhereClause(3, null, null)
    <ADFLogger> <addContextData> Estimated row count
    <BaseSQLBuilderImpl> <bindParamValue> [4576] Binding null of type 12 for 1
    <BaseSQLBuilderImpl> <bindParamValue> [4577] Binding null of type 12 for 2
    <BaseSQLBuilderImpl> <bindParamValue> [4578] Binding null of type 12 for 3
    <BaseSQLBuilderImpl> <bindParamValue> [4579] Binding null of type 12 for 4
    <BaseSQLBuilderImpl> <bindParamValue> [4580] Binding null of type 12 for 5
    <ViewObjectImpl> <getQueryHitCount> [4581] ViewObjectImpl.getQueryHitCount failed...
    <ViewObjectImpl> <getQueryHitCount> [4582] java.sql.SQLException: [FMWGEN][SQLServer JDBC Driver]Invalid parameter binding(s).
      at weblogic.jdbc.sqlserverbase.dda4.b(Unknown Source)
      at weblogic.jdbc.sqlserverbase.dda4.a(Unknown Source)
      at weblogic.jdbc.sqlserverbase.dda3.b(Unknown Source)
      at weblogic.jdbc.sqlserverbase.dda3.a(Unknown Source)
      at weblogic.jdbc.sqlserverbase.ddb8.a(Unknown Source)
      at weblogic.jdbc.sqlserverbase.ddb9.a(Unknown Source)
      at weblogic.jdbc.sqlserverbase.ddb9.setNull(Unknown Source)
      at weblogic.jdbc.wrapper.PreparedStatement.setNull(PreparedStatement.java:622)
      at oracle.jbo.server.BaseSQLBuilderImpl.bindParamValue(BaseSQLBuilderImpl.java:2215)
      at oracle.jbo.server.BaseSQLBuilderImpl.bindParametersForStmt(BaseSQLBuilderImpl.java:3687)
      at oracle.jbo.server.ViewObjectImpl.bindParametersForCollection(ViewObjectImpl.java:22684)
      at oracle.jbo.server.ViewObjectImpl.getQueryHitCount(ViewObjectImpl.java:4944)
      at oracle.jbo.server.ViewObjectImpl.getQueryHitCount(ViewObjectImpl.java:4857)
      at oracle.jbo.server.QueryCollection.getEstimatedRowCount(QueryCollection.java:4204)
      at oracle.jbo.server.ViewRowSetImpl.getEstimatedRowCount(ViewRowSetImpl.java:2677)
      at oracle.jbo.server.ViewObjectImpl.getEstimatedRowCount(ViewObjectImpl.java:10632)

    After making all the bind variables not required, the error is no longer coming.

  • SSDT vs 2013 and Clr function, call a Clr method name dynamically using SQLCMD variables

    Hello,
    My question is this, hopefully this makes sense:
    How could I got about doing this, inside a SQL function, I would like to re-name the Clr method call based on a SQLCMD variable? 
    I have a Clr project to encrypt/decrypt data, there are different method names depending on the deployment types.
    For the definition of a function called dbo.EncryptThis, I would like to use a SQLCMD variable to change the name depending on SQLCMD variables. This works fine in SQL Server Mgmt studio, but VS 2013 fails to recognize the SQLCMD variable and the build fails
    with: "Error
    1
    SQL71521: A method with a matching signature was not found in the loaded assembly.".
    THis code works fine in SQL Server Mgmt Studio, but fails to build in the SSDT project.
    In the SSDT project I have the SQLCMD variable defined and think I have SQLCMD mode enabled, by doing this:
    Right click file > Execution Settings > SQLCMD mode
    CREATE FUNCTION [dbo].[EncryptData]
    (@str NVARCHAR (MAX))
    RETURNS NVARCHAR (MAX)
    AS
    EXTERNAL NAME [CryptoClrAssembly].[LibName].[EncryptData$(MethodName)]
    Is this even possible in SSDT? or would I have to do this in a post-deploy script?

    Hi Kevin,
    Thanks for the info.
    Bummer, so the only other solution I have is to create a post-deploy script to change the function based on a SQLCMD variable or other logic?
    What would be really cool, would be if during the build process the SQLCMD variables would get replaced with the default value to the SQLCMD variable, thus would allow to build the project. Also, during deployment, if someone entered an incorrect method
    from the assembly it would just fail.

  • (new?) performance problem using jDriver after a Sql Server 6.5 to 2000 conversion

    Hi,
    This is similar - yet different - to a few of the old postings about performance
    problems with using jdbc drivers against Sql Server 7 & 2000.
    Here's the situation:
    I am running a standalone java application on a Solaris box using BEA's jdbc driver
    to connect to a Sql Server database on another network. The application retrieves
    data from the database through joins on several tables for approximately 40,000
    unique ids. It then processes all of this data and produces a file. We tuned
    the app so that the execution time for a single run through the application was
    24 minutes running against Sql Server 6.5 with BEA's jdbc driver. After performing
    a DBMS conversion to upgrade it to Sql Server 2000 I switched the jDriver to the
    Sql Server 2000 version. I ran the app and got an alarming execution time of
    5hrs 32 min. After some research, I found the problem with unicode and nvarchar/varchar
    and set the "useVarChars" property to "true" on the driver. The execution time
    for a single run through the application is now 56 minutes.
    56 minutes compared to 5 1/2 hrs is an amazing improvement. However, it is still
    over twice the execution time that I was seeing against the 6.5 database. Theoretically,
    I should be able to switch out my jdbc driver and the DBMS conversion should be
    invisible to my application. That would also mean that I should be seeing the
    same execution times with both versions of the DBMS. Has anybody else seen a
    simlar situation? Are there any other settings or fixes that I can put into place
    to get my performance back down to what I was seeing with 6.5? I would rather
    not have to go through and perform another round of performance tuning after having
    already done this when the app was originally built.
    thanks,
    mike

    Mike wrote:
    Joe,
    This was actually my next step. I replaced the BEA driver with
    the MS driver and let it run through with out making any
    configuration changes, just to see what happened. I got an
    execution time of about 7 1/2 hrs (which was shocking). So,
    (comparing apples to apples) while leaving the default unicode
    property on, BEA ran faster than MS, 5 1/2 hrs to 7 1/2 hrs.
    I then set the 'SendStringParametersAsUnicode' to 'false' on the
    MS driver and ran another test. This time the application
    executed in just over 24 minutes. The actual runtime was 24 min
    16 sec, which is still ever so slightly above the actual runtime
    against SS 6.5 which was 23 min 35 sec, but is twice as fast as the
    56 minutes that BEA's driver was giving me.
    I think that this is very interesting. I checked to make sure that
    there were no outside factors that may have been influencing the
    runtimes in either case, and there were none. Just to make sure,
    I ran each driver again and got the same results. It sounds like
    there are no known issues regarding this?
    We have people looking into things on the DBMS side and I'm still
    looking into things on my end, but so far none of us have found
    anything. We'd like to continue using BEA's driver for the
    support and the fact that we use Weblogic Server for all of our
    online applications, but this new data might mean that I have to
    switch drivers for this particular application.Thanks. No, there is no known issue, and if you put a packet sniffer
    between the client and DBMS, you will probably not see any appreciable
    difference in the content of the SQL sent be either driver. My suspicion is
    that it involves the historical backward compatibility built in to the DBMS.
    It must still handle several iterations of older applications, speaking obsolete
    versions of the DBMS protocol, and expecting different DBMS behavior!
    Our driver presents itself as a SQL7-level application, and may well be treated
    differently than a newer one. This may include different query processing.
    Because our driver is deprecated, it is unlikely that it will be changed in
    future. We will certainly support you using the MS driver, and if you look
    in the MS JDBC newsgroup, you'll see more answers from BEA folks than
    from MS people!
    Joe
    >
    >
    Mike
    The next test you should do, to isolate the issue, is to try another
    JDBC driver.
    MS provides a type-4 driver now, for free. If it is significantly faster,
    it would be
    interesting. However, it would still not isolate the problem, because
    we still would
    need to know what query plan is created by the DBMS, and why.
    Joe Weinstein at BEA
    PS: I can only tell you that our driver has not changed in it's semantic
    function.
    It essentially send SQL to the DBMS. It doesn't alter it.

  • Using DB Link for SQL Server

    Hi All,
    When I query the SQL server table from Oracle using DB Link, it works fine for any table:
    select * from testtable@DBLINK test -- This statement works fine because I am giving * i.e. all columns
    But when I try to query specific columns like
    Select test.status from testtable@DBLINK test
    then it gives me error ORA-00904: "test.Status invalid Identifier", I can see this particular column when I query the testtable for all of the columns.
    I don't know what to do.
    Thanks

    You need to use quoted names. SQL Server data dictionary stores names in same case they were entered while Oracle in upper case. So when you issue
    Select test.status from testtable@DBLINK test Oracle parser will look for column STATUS while on SQL Server side it could be stored, for examle, as Status or status. Check column names on SQL Server side and use quoted names. Assuming column name is Status:
    Select test."Status" from testtable@DBLINK test SY.

  • Sqlcmd: Error: Microsoft SQL Server Native Client 10.0

    Hi All .need help ..
    When I am running this from cmd on my sql 2008 database server:
    sqlcmd -U sa -S mymachinen_name\MSSQLSERVER   ,   MSSQLSERVER is my instance name ,
    I get prompt for password and after that I get this:
    Password: HResult 0x57, Level 16, State 1
    SQL Server Network Interfaces: Connection string is not valid [87].
    Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : A network-related or in
    stance-specific error has occurred while establishing a connection to SQL Server
    . Server is not found or not accessible. Check if instance name is correct and i
    f SQL Server is configured to allow remote connections. For more information see
     SQL Server Books Online..
    Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : Login timeout expired.
    I have my sqserver browser service started and also I can login through managemnet studio with windows authentication.
    Also found this :
    http://support.microsoft.com/kb/905618  , but this is for MS Server 2005/2000.
    Can you guys please help me.
    Regards

    Hello,
    Try the following commands from your computer and
    from the local server:
    SQLCMD -E -S mymachinen_name\MSSQLSERVER
    SQLCMD -E -S mymachinen_name
    Use SQL Server Management Studio and connect
    to the SQL server with the SA account
    and password. If this does not work,
    your SA account is disabled or the SQL
    server is configured for Windows authentication.
    If MSSQLSERVER is the default instance
    of your SQL Server, do not use it in your
    command line SQLCMD
    Check on your SQL server
    remote connections are enabled
    If you are using TCP / IP, add an inbound
    TCP exception in the firewall of your SQL
    server on port used by your SQL Server instance
    + an inbound UDP 1434
    exception for the SQL Server Browser service
    Regards
    Charlie Dancoisne - Independent Consultant & Trainer (Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable. This helps the community, keeps the forums tidy, and recognises useful contributions. Thanks!)

  • This driver is locked for use with embedded applications - SQL Server

    Hello guys,
    Background:
    I developed an application using JSC2 with MS SQL Server 2000 as the database and Sun Application Server PE 8 as App Server. During development, I am able to deploy and test it. But as soon as I've installed Sun Application Server PE 8 on our Production Server, exported my app there and tried to execute it, I get the error
    "This driver is locked for use with embedded applications".
    I just wanna ask, though I've seen other threads saying that the only solution is to buy the EE or SE of Sun App Server, isn't there really any work-around with this?
    Thanks very much for your help.

    OK, that is the same setup we have (Creator built application running with MS SQL Server).
    I wrote a tutorial talking about integrating Creator with Spring. In it you will find out how to use SQL Server with a Creator built app running on the Platform Edition. That tutorial can be found here: http://swforum.sun.com/jive/thread.jspa?threadID=52657&tstart=15
    In short, look to jTds.
    Hope this helps.

  • Is 'SQLCMD.EXE' the SQL Server 2008 executable to be added to a Firewall 'Inbound Rule' to allow remote access?

    I would like to add a new Firewall 'Inbound Rule' to allow remote access by
    SQL Server 2008.    
    SQL Server Management Studio shows two TCP/IP instances, both of which are Enabled. 
    One uses port 1433 and the other uses ‘TCP Dynamic Ports’.
      In  SQL Server, the server has ‘Allow remote connections to this server’ checked.
    My Firewall allows port 1433 for the one TCP/IP instance. 
    Since the other instance is dynamic, I would like to add a new
    Firewall 'Inbound Rule' to allow the SQL Server executable to run.
    I’ve read that the SQL Server executable is commonly named SQLSERVR.EXE, but there is no such file on my laptop. 
    I’m assuming the executable that needs to be added to the Firewall 'Inbound Rule'
    is SQLCMD.EXE (in the path C:\Program Files\Microsoft SQL Server\100\Tools\Binn). 
    Can anyone please confirm this?  (I'm running Windows 7).  Thanks.

    Hi Bontrager,
    Firstly, please run
    Discovery Report to the detect the existing SQL Server 2008 instance. If SQL Server 2008 is installed properly on your machine, the sqlservr.exe should exists in C:\Program Files\Microsoft SQL Server\MSSQL10.<instance_name>\MSSQL\Binn.
    Secondly, if SQL Server 2008 is configured to use dynamic port, it is difficult to configure the firewall to enable access to the correct port number because the port selected might change every time that the Database Engine is started.
    Therefore, if a firewall is used, please reconfigure the SQL Server 2008 to use the static TCP port by using SQL Server 2008 Configuration Manager. 
    For more information, please review this
    article. After that, you can add the port number in firewall inbound rule.
    Thirdly, if you want to connect to  SQL Server 2008 from outside the firewall by instance name, SQL Server Browser should be turned on and you'll have to allow the SQL Server Browser through the firewall, which is UDP port 1434.
    Reference:
    https://msdn.microsoft.com/en-us/library/cc646023.aspx
    http://stackoverflow.com/questions/10539900/opening-ports-sql-server-instances
    Thanks,
    Lydia Zhang
    Lydia Zhang
    TechNet Community Support

  • Can we use different Databases (Oracle & SQL Server) in one report?

    Post Author: venki5star
    CA Forum: .NET
    Hi there.
    Can we use different databases (Oracle & SQL Server) in a same report?
    If possible how?
    Another question,
    Can we change the Provider Name at runtime of the given report. If so the above question is useless...
    Thanks in Advance.

    I tried this using Oracle Provider for OLEDB (the one that supplied by Oracle Client) and Crystal Reports 9. you can drag the column into designer but the image does not appear in preview.
    I guess it's because CR does not recognized it as image, and there are no information that the blob data is an image at all.

  • Error when using Oracle Migration WorkBench (Sql Server 2k to Oracle 8i)

    I'm trying to migrate a Sql Server 2k database to an Oracle 8i schema using OMWB. After using BCP to collect metadata information on the source database, I tried to capture the source data model and got a "Capture aborted" message on the progress screen (even though then it appears a dialog window reporting "0 errors and 0 warnings", funny!). Down there is the error log OMWB generated. After reading some posts, I changed some columns of the OMWB dictionary that holds the source database name, but still got the same error. If someone can enlighten me on this toppic, I'd greatly appreciated it.
    Here's the error log of OMWB:
    ** Oracle Migration Workbench
    ** Production
    ** ( Build 20050629 )
    ** OMWB_HOME: D:\Datos\Download\Oracle\Oracle Migration Workbench\omwb
    ** user language: es
    ** user region: null
    ** user timezone:
    ** file encoding: Cp1252
    ** java version: 1.4.2_04
    ** java vendor: Sun Microsystems Inc.
    ** o.s. arch: x86
    ** o.s. name: Windows 2000
    ** o.s. version: 5.0
    ** Classpath:
    ..\lib\boot.jar
    ** Started : Fri Feb 23 17:18:48 GMT-03:00 2007
    ** Workbench Repository : Oracle8i Enterprise Edition Release 8.1.6.0.0 - Production
    With the Partitioning option
    JServer Release 8.1.6.0.0 - Production
    Repository Connection URL: jdbc:oracle:thin:@ServerCms:1521:sigcewbc
    ** The following plugins are installed:
    ** Microsoft Access 2.0/95/97/2000/2002/2003 Plugin, Production Release 10.1.0.4.0
    ** Microsoft SQLServer 2000 Plugin, Production Release 10.1.0.4.0
    ** Microsoft SQLServer 6.5 Plugin, Production Release 10.1.0.4.0
    ** Microsoft SQLServer 7.0 Plugin, Production Release 10.1.0.4.0
    ** Active Plugin : SQLServer2K
    EXCEPTION :SQLServer2KDisconnSourceModelLoad.loadSourceModel(): oracle.mtg.migration.MigrationStopException: java.lang.IndexOutOfBoundsException: Index: 15, Size: 15
    ** Shutdown : Fri Feb 23 18:00:50 GMT-03:00 2007

    Duplicate thread
    Error when using Oracle Migration WorkBench (Sql Server 2k to Oracle 8i)

  • Using Bind variables in SQL PLUS Report

    using Bind variables in SQL PLUS Report. This report gets the arguments from the application concurrent program. Now my need is to convert the start_date and end_date to bind Variables to improve the performance. I have commented the original code in 'prompt List of Unapproved Adjustments' and used my Bind Variable but it is giving an error
    error: Bind Variable "ENDING_DATE" not declared
    Report Date and Time:
    26-OCT-2010 15:44:13
    List of Unapproved Adjustments
    Bind Variable 'ENDING_DATE" not declared
    Please see below the code for the sql plus report:
    define p_org_id           = '&1'
    define p_fy_begin_date = '&2'
    define p_start_date = '&3'
    define p_end_date = '&4'
    define p_conversion = '&5'
    declare
    variable begin_date date;
    exec :begin_date := p_start_date;
    variable ending_date date;
    exec :ending_date := p_end_date;
    /* Begin
    :begin_date := to_date('&p_start_date','YYYY/MM/DD HH24:MI:SS');
    :ending_date := to_date('&p_end_date','YYYY/MM/DD HH24:MI:SS');
    End; */
    set newpage none
    set termout off
    set pagesize 55
    set linesize 180
    set heading on
    set feedback off
    set wrap off
    set space 1
    set heading on
    begin
    dbms_application_info.set_client_info('&p_org_id');
    end;
    prompt
    prompt Report Date and Time:
    prompt ----------------------
    select to_char(sysdate,'DD-MON-YYYY HH24:MI:SS')
    from dual ;
    prompt
    prompt List of Unapproved Adjustments
    prompt -------------------------------
    select b.trx_number,
    a.adjustment_number,
    f.user_name created_by
    from apps.ar_adjustments a,
    apps.ra_customer_trx b,
    apps.fnd_user f
    where a.customer_trx_id = b.customer_trx_id
    and a.status <> 'A'
    and a.created_by = f.user_id
    and a.creation_date between :begin_date
    and :ending_date
    -- and a.creation_Date between to_date('&p_start_date','YYYY/MM/DD HH24:MI:SS')
    -- and to_date('&p_end_date','YYYY/MM/DD HH24:MI:SS')
    order by
    b.trx_number ;

    Hi
    Please go to customization part of the report and verify..You have set a default value out there ..And also verify your lov and look at the values ..If it is again giving you the problem ..pl delete the report and develop it again from the scratch it will be solved...
    vishnu
    null

  • How To Use Reporting Services On SQL Server 2000 ?

    Hi all .
    Today , I has a issue .
    Normal , if the customer use SQl Server 2005 , it is no proplem , so if use SQL Server 2000 ,  Now , I want to use Reporting services on SQL Server 2000 , but , I am searching  on Internet , so I know , if I want to use SQL 2000 reporting server , I must have license of SQL server 2000 .
    is Every body  idea for this issue  ? .
    Please help me .
    Thanks alot .

    Ok ,anyway thanks alot ,.

  • How to use OEM to moniter sql server 2000

    Hi,
    I need to learn How to use OEM to moniter sql server 2000.
    Can anyone help me and give me some website or documents
    to read?
    So I can learn to do this job.
    Thanks.

    See Note 115302.1 in Metalink.oracle.com
    in how to use OEM Diagnostic pack addon for SQL Server
    Or search for
    oem "user events"
    to build your own monitor script.

Maybe you are looking for