Changing default SQL database within Teststand

I am designing a "universal" test system for a variety of my company's products.
The test results are supposed to be logged to a MS SQL (2008) database. I've created two databases for two different products. Let's call them OneTestDB and TwoTestDB for now.
No problems so far. Now, I want to use a user, TestLogin, to write the test data to the both of my databases, however, TestLogin can seems only to be able to write to the DB set as default.
I could solve the problem by using different users, but since I want it to be possible for the same user to test different products, I would prefer to avoid this.
After searching the net for an answer I found that that what I'm trying to do is done by the query "EXEC sp_defaultdb 'USER', 'DATABASE'. (Would USE {DATABASE} work as well?)
The database name is given at runtime. (DATABASE = StationGlobals.ProductName + "TestDB")
Here is my question: how , and where, to put that code into Teststand (2010 SP1) so that I can change the database to which I want to save the test results?
I have been trying to use the database tools given in Teststand, but obviously I am not doing it the right way.
Solved!
Go to Solution.

I managed to fix it myself.
The solution was the following SQL statement "EXEC sp_defaultdb 'TestLogin', '" + StationGlobals.ProductName + "TestDB'"
If someone has a better idea how to solve the issue, feel free to enlighten me.

Similar Messages

  • MS Access returns a SQL Database date field as text

    When linking to a table via ODBC to a SQL database, Access returns any field that is formatted as 'Date' as a 'Text' field. A Date/Time field works fine. I cannot change the SQL Database.  Is there a fix for this?

    Hi,
    In regarding of the issue, please provide us more information to assist you better.
    Which version of Access and SQL server do you use?
    Do you use ODBC Driver 11 for SQL server?
    Based on my test (My environment: Access 2013, SQL server 2014, and ODBC Driver 11 for SQL server), I can't reproduce your issue. Regardless  of "Date" and "Date/Time" data type of SQL, both of them can be linked to Access
    that are formatted as Date/Time type.
    I suppose this issue may be caused by the data. For example, if the date like: 2015--2--23, it can't be recognized as date type in Access. Please try to check it.
    If you have any update, please feel free let me know.
    Regards,
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Including SQL database features in Flash application

    Hello!
    Would anybody guide me how can I include SQL database within my Fash application, please!

    You will need to do some reading - search Google for MySQL and Flash and you should find many tutorials. Essentially though it works like so - you use server-side scripting (either PHP or ASPX) that does the actual communication with your database - either retrieving data from, or putting data into.
    In Flash, you can use a URLLoader to query the SS scripts and retrieve/send the data. There are other ways, (AMFPHP) but this is probably the most common and simple and it's really quite easy once you get the hang of it.

  • How to change  default unit on Database 11g

    Hi All
    I'm using Oracle Database 11g Enterprise Edition Release 11.1.0.6.0.
    If I define my column:
    USERID VACHAR2(8) --> Default USERID VACHAR2(8 BYTE)
    How can I change default unit BYTE to CHAR as the following
    USERID VACHAR2(8) --> Default USERID VACHAR(8 CHAR)
    Thanks alot
    Thiensu2810

    I have set Database system with the following SQL:
    alter system set nls_length_semantics=char;
    alter session set nls_length_semantics=char;
    But, It does not match.
    And when I insert data, the following error occured.
    SQL> insert into binhtest values('初期化パ');
    ORA-12899: value too large for column string (actual: 12, maximum: 8)
    I've checked value of NLS_LENGTH_SEMANTICS, it is CHAR
    SQL>SHOW PARAMETER NLS_LENGTH;
    NAME | TYPE | VALUE
    NLS_LENGTH_SEMANTICS | String

  • How to change the profile value in the pl/sql code without making change in the database

    How to change the profile value in the pl/sql code without making change in the database.

    I have program ,where if the profiles 'printer and nunber of copies ' are set at the user level, by default when the report completes the O/p will be sent to the printer mentioned in the set-up. but what user wants is
    if these Profiles are set for the user running this program automatic printing should not be done.

  • Change default language of login in database

    Hi,
    Working on SQL Azure. I'm running queries that are date dependent and so I need to set the default language of the user to be British (to get dd/mm/yyyy format). How can I do this in Azure. Create Login and Alter Login are restricted and when I query sys.sql_logins
    in master database I can see that the users have default language if US English.
    Thanks,
    Tom

    Hello,
    Microsoft Azure SQL Database does not support using DEFAULT_LANGUAGE options with
    ALTER LOGIN statement.
    SQL Azure stores the data of Date/Time in UTC timezone and it does not support changing the timezone. You should convert date format and apply to the end user applications by yourself. Or you can try to store the date/time with  datetimeoffset
    data type which is support in SQL Azure.
    Reference:http://bobthegoblin.wordpress.com/2011/09/13/sql-azure-and-the-datetime-now-issues/
    http://blogs.msdn.com/b/cie/archive/2013/07/29/manage-timezone-for-applications-on-windows-azure.aspx
    Regards,
    Fanny Liu
    If you have any feedback on our support, please click here. 
    Fanny Liu
    TechNet Community Support

  • VS 2013 - SQL Server Projects - Can I Change defaults for SQL Servers to use and the paths to DB-files?

    Hi all,
    when a create a SQL Server Project using "File > New ...", I find the following settings defaulted:
    SQL Server is (local)\Version12.0 and
    DefaultDataPath, DefaultFileprefix and the DefaultFilename(s) for MDFs and LDFs point to the Project directory.
    Initial settings of file size and increments are also not settable but defaulted.
    Because my projects have to verify performance by testing with large volume of data, we have to use a different SQL Server with files stored on that Server. The Project settings have a button to changes DB properties, but these are not part of that
    dialog.
    So I spent some fruitless hours in vain to find a way to change the project's connection to my development SQL Servers.
    How to cope with that?
    Thanks in advance.
    Regards Uwe

    Hi Caillen,
    thanks for Your response. I have to apologize for being a little late with my answer. I'll try to clarify my case more precisely:
    This is surely a topic related to VS2013 handling new "SQL Server Database Projects". When one clicks "OK" the following steps are executed by VS2013 (surely controlled by standard templates or the like):
    VS2013 creates the new project in a selectable directory and uses the projectname as a subdirectory whre the directory elements (*.sqlproj, bin\, obj\) where  later all the *.sql are placed, too. This is normal and expected.
    VS2013 creates a new database with its DB-files
    and attaches it to "(localdb)\ProjectsV12". The name of the database is the name of the project. The path to the DB-files (*.mdf and ldf) and their sizes are also defaulted to small values. The DB-server and the
    path to the DB-files is taken from the registry (!) HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\SSDT\LocalDbDatabaseFilePaths. I don't know when and by what tools these values are set.
    The path to DB-Files is typically also the path to the projects. The (local)-server places all system database files in the User\<user-ID>\Appdata\.. tree. Which is OK for small databases. The templates extracts some data from the DB-file path and
    places it in the deployment SQLs to populate the SQLCMD variables DefaultDataPath, DefaultFileprefix and the DefaultFilename(s) which are generated when pressing "Executed" or "Debug" the project.
    My problem is that we have to test database performance with larger volumes of data (e.g. two million rows and more). These cannot be stored in the User-path but must be handled by some kind of professional DB-Manager on various storage devices. When everything
    is tested, the publishing function of VS2013 will extract the structure and you are done incl. all the performance taming things.
    The dialog from the project properties can change to a different Server, but that server does not know your project database. The server and the DB-Files should be specified by the developer before VS2013 creates the database.
    So  the right forum would be a forum, where people developing SQL Server solutions with VS2013 are reading the questions.
    Thanks again for your patience.
    Regards Uwe

  • SQL Server 2012 installation and to default user database files to a particular path

    Hi, I am working on SQL Server 2012 installation on one of our test boxes and I would like to configure the sql server install binaries and all the system databases but for tempdb to be in my C and tempdb on a different drive and once all this is set up,
    whenever a developer creates a new database without specifying the path for the mdf & ldf files. They should be defaulted to a path like "D:/Data file" & "D:/Log file" for instance instead of being created on the C drive.
    Thanks in advance.........
    Ione

    Hi,
    You can of course set default location of database through management Studio please refer below link. Once you change default location even if you do not specify location it would take default one.
    http://sqlandme.com/2013/03/18/sql-server-changing-default-database-location-for-server/
    I would advise you not to keep files on C drive let it be dedicated system drive also its quite possible that SQL server service account would not have privilege on C drive so after you move tempdb SQL server would not come online as tempdb files cannot
    be created . Tempdb is always recreated after SQL Server starts so you just need to change location once using Alter database command
    See example mentioned in below link for how to do that
    http://msdn.microsoft.com/en-us/library/ms345408%28SQL.90%29.aspx
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.
    My TechNet Wiki Articles

  • How to change Default editor in Linux for PL/SQL Programming

    Deare friends ,
    I am using oracle 8i (8.1.6) on RedHat Linux 7.2 , But i donot know how to change default editor for modify editor on sql prompt say ex:-
    In winodow
    SQL> ED
    it open nope pad to modify sql and pl/sql statement
    while in linux
    SLQ > ED
    it open one editor but it is not easy to work and i want to change that editor so could you tell me how to chane editor i want to use vi editor .
    if any boyd know reply me on :-
    [email protected]
    or on this forum
    Thanking you in advance
    Piyush Patel

    Either manually do a 'define editor=vi' when you log in through sql*plus, or put that in the glogin.sql in $ORACLEHOME/sqlplus/admin or put that in a login.sql in the directory you run sqlplus from.

  • Changing a SQL Report server Database to a new One Using Powershell script

    Hi,
    I have an existing report server (Native Mode) and a pre-configured report server database. I have created a new database and want to assign it new report server database. How can i automate this process using powershell?
    Here is the detail requirement
    If there is a Report Server database seeded on the xxxxx server, follow the below steps:
    ◾Click the Database button on the left. Click on the Change Database button, choose option Choose an existing report server database. Enter the RPT server name (e.g. xxxxxx) in Server Name text box and click Next.
    ◾In the Report Server Database selection, select the ReportServer database. Then click next button to complete the process.
    Any help in this regard will be very much helpfull.
    Sushruta Banerjee

    Hi Sushruta,
    To query export from Report server Database, the scripts below may be helpful for you:
    Export RDL Files from ReportServer Database with PowerShell
    SQL Database Reports with PowerShell
    I hope this helps.

  • Changing default database and application passwords

    Hi,
    We have default passwords for our newly configured Oracle ERP (R12).
    I have a concern regarding the changing of default password. Does changing the default passwords will have any effect on normal working of ERP and database.
    I know that we shouldn't change default APPLSYSPUB password. What about the following default passwords?
    a) Default accounts having default password in database (DBA_USERS):
    CTX SYS
    OLAPSYS
    DBSNMP
    DMSYS
    GL (oracle users .e.g AP, GL, AR)
    APPLSYSPUB
    OUTLN
    PERFSTAT
    SYS
    b) Default accounts present in Oracle Application (FND_USERS) :
    IBE_GUEST
    OP_CUST_CARE_ADMIN
    ASGADM
    MOBILEADM
    APPSMGR
    IBEGUEST
    OP_SYSADMIN
    AUTOINSTALL
    WIZARD
    IEXADMIN
    ASGUEST
    IBE_ADMIN
    ERP version : 12.1.2
    Database Version: 11.2.0.1
    Thanks in advance.
    Regards,
    Gaurav

    Hi Gaurav,
    Yes as stated by Srini, It's highly recommended that you change tyhe default password in order to safeguard your instance by outside threats.
    But please be cautious as you cant change these accounts as "alter user <username> identified by <new password>", but rather use FNDCPASS utility. I advice you to check on the TEST system before implementing on the PROD instance if you dont have prior experience using FNDCPSAS.
    Please also refer notes:
    How to Change Applications Passwords using Applications Schema Password Change Utility (FNDCPASS or AFPASSWD) (Doc ID 437260.1)
    FNDCPASS Troubleshooting Guide For Login and Changing Applications Passwords (Doc ID 1306938.1)
    How to change passwords to include special characters using FNDCPASS (Doc ID 1336479.1)
    FNDCPASS Utility New Feature: Enhance Security With Non-Reversible Hash Password (Doc ID 457166.1)
    Also see forum search:
    Forum Search: FNDCPASS
    Hope this helps!
    Best Regards

  • SQL Database creation failed in resource group Default-SQL-NorthEurope

    Hi
    I am getting the following error, when I try to create a database in Azure(https://portal.azure.com/)
    OperationName: CreateDatabase
    Status: Failed
    EventTimestamp: Wed Dec 03 2014 16:44:53 GMT+0100
    ResourceUri: /subscriptions/[SubscriptionId]/resourcegroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/img0xvixih/databases/[DatabaseName]
    SubscriptionId: XX
    EventSubmissionTimestamp: Wed Dec 03 2014 16:51:00 GMT+0100
    OperationId: 3972a8b9-046e-4a3d-ae78-6bed77ad2362
    SubStatus: N/A
    CorrelationId: 3972a8b9-046e-4a3d-ae78-6bed77ad2362
    Description: Failed to create database [DatabaseName], SqlErrorCode: 40827 by: [email protected]
    Level: Informational
    ResourceGroup: Default-SQL-NorthEurope
    ResourceProvider: Microsoft.Sql
    EventSource: Microsoft.Sql
    Properties: ServerName:img0xvixih
    DatabaseName:[DatabaseName]
    ErrorCode:40827
    ClientIP:157.**.***.250
    Description:Failed to create database [DatabaseName], SqlErrorCode: 40827
    Note :
    I have a: pay as you go plan
    Thanks in advance.

    Hi Girish
    I am getting the same error:
    OperationName: CreateDatabase
    Status: Failed
    EventTimestamp: 2014-12-03T15:44:53.655Z
    ResourceUri: /subscriptions/[SubscriptionId]/resourcegroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/img0xvixih/databases/[DatabaseName]
    SubscriptionId: XX
    EventSubmissionTimestamp: 2014-12-03T15:51:00.486Z
    OperationId: 3972a8b9-046e-4a3d-ae78-6bed77ad2362
    SubStatus: N/A
    CorrelationId: 3972a8b9-046e-4a3d-ae78-6bed77ad2362
    Description: Failed to create database [DatabaseName], SqlErrorCode: 40827 by: [email protected]
    Level: Informational
    ResourceGroup: Default-SQL-NorthEurope
    ResourceProvider: Microsoft.Sql
    EventSource: Microsoft.Sql
    Properties: ServerName:img0xvixih
    DatabaseName:[DatabaseName]
    ErrorCode:40827
    ClientIP: 157.**.***.250
    Description: Failed to create database [DatabaseName], SqlErrorCode: 40827
    hmmm, maby next stop is amazon(aws)!

  • Changes in resource name in Monitor Matrix for SQL Database @ Azure portal

    hi
    Exact 4 months after starting of new SQL database tier, Resource Matrix changed.
    old names :
    CPU percentage
    Log Write percentage
    Physical Data Read percentage
    new names are:
    CPU
    LogIO
    DataIO
    My question is they are equal :
    CPU percentage = CPU   (looks OK)
    Log Write percentage = LogIO  (Log Writes means IN but IO means both (in and out))
    Physical Data Read percentage = DataIO  (Read means OUT but IO means both (in and out))
    If they are different then what is change ?

    Hi,
    We use the
    sys.resource_stats catalog view to monitor the resource usage of your Azure SQL Database and compare current resource utilization to different performance levels . The CPU Percentage, Physical Data Reads percentage, Log Writes Percentage show the average
    utilization percentage relative to the DTU of your database. For more information, see:
    http://msdn.microsoft.com/en-us/library/azure/dn369873.aspx
    And now, we upgrade the monitor metrics name for CPU and IO activity of SQL Azure database. If you add the metrics of Data IO or Log IO individually in Monitor Page, it will show the same name with Physical Data Reads percentage and Log Writes Percentage,
    you can refer to the following screenshot.
    After I adding the Data IO, it will show as Physical Data Reads percentage in Monitor Page.
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • Change the sql 2005 database  C drive to E drive

    hi,
    it is possible to change the sql 2005 database  C drive to E drive
    if ,yes then step:-?
    Regards
    Amit

    Hello Amit,
    >it is possible to change the sql 2005 database C drive to E drive
    >if ,yes then step:-?
    You can also check note [363018|http://service.sap.com/sap/support/notes/363018].
    Regards,
    Eduardo

  • Default collection Database Tables Changed!!!

    Hello,
    First of all I would like to thank Microsoft for an amazing product Team Foundation Server 2013. We recently migrated from TFS 2012 to TFS 2013 and My Team loved it !!! Especially the team collaboration features and "Features".
    My query is regarding Team Foundation Server Default Collection Database. I have a report in SSRS for Test Cases Statistics wherein we use tables viz. - "tbl_Plan" and "tbl_Suite". The mapping between these two tables has been done on
    basis of RootSuiteId of tbl_Plan and ParentSuiteId of tbl_Suite and PlanId of both tables.
    Till Team foundation server 2012 the table tbl_Plan had a column - "Name".
    In Team foundation server 2013, when I compile the procedure written for the Report, I get a compilation error for this column, since this no more exists in tbl_Plan. The column Name exists in tbl_PlanData now. I can't infer how to map the tables tbl_Plan
    and tbl_PlanData to keep my report working.
    Please help!!!
    Thanks in advance.
    Best Regards
    Yogesh kumar Hindoliya

    You should be using the TFS data warehouse (default db name: Tfs_Warehouse), preferably through the associated SSRS server.
    "You will find a fortune, though it will not be the one you seek." -
    Blind Seer, O Brother Where Art Thou
    Please Mark posts as answers or helpful so that others may find the fortune they seek.

Maybe you are looking for

  • Null pointer exception with thread

    ok, When i try to start a thread i get a null pointer exception: Exception in thread "Thread-2" java.lang.NullPointerException         at MainWindow$8.run(MainWindow.java:274)         at java.lang.Thread.run(Thread.java:619)Here is the thread code: t

  • Oracle9iR2/Solaris8 --  DRG-11207: user filter command exited with status 137

    The ctx_ddl.sync_index() procedure hangs when I use it to synchronize the index. It is obvious that the INSO filter is not responding.The LD_LIBRARY_PATH and PATH variables are correctly pointing to $ORACLE_HOME/ctx/lib, $ORACLE_HOME/lib and $ORACLE_

  • Errorhandling with Piers' RFC library

    Hi together, I was playing around with getting some error messages back from the backend, if any. I was able to do <i>rescue RuntimeError</i> to handle errors like wrong user name or pwd or using a wrong function module name. However some errors occu

  • [resolved]Creating a formal outline for a class.

    I'm taking a public speaking class, and I have to turn in my outline for it using the traditional form. For instance: I. intro A.attention getter B. Preview 1.blah 2. blah a. blah b. Blah I couldn't find a way to automate this in open office.  It wou

  • MSAD usersi not login into the Planning

    Hi All, I did the intergration with MSAD. I am getting all the MSAD users in shared services. While running the ProvisionUsers.sh cmd, i am the getting the error as *[Thu Sep 17 90:08:11 GMT+03:00 2009] Starting synchronization.* Error Occured: java.