Setting substitution variable to connection string (not ODBC name)

Hi,
I havce a question regarding the use of a sub variable in SQL data loads as the data source. I find this works great when the variable is set to an existing ODBC. What I would really like to do is skip the ODBC creation step and have the substitution variable be the actual connection string, such as "Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase; Uid=myUsername;Pwd=myPassword;"
Can anyone confirm or deny whether this functionality exists? As usual, the documentation is vague on the subject and doesn't exclude the possibility, but doesn't include it, either.
Thanks!

My first thought is that no, you can't do that. Even if you could, I'm not sure if you'd want to do that. The easiest way to find out is simply to try. But more than likely I think you should just have "hard-coded" values for the source/target server. If you are trying to stay with the same load rule for dev/test/prod servers, you might just be better off coming up with a naming scheme that let's you keep them all separate.
Cheers,
Jason Jones
[http://www.jasonwjones.com]

Similar Messages

  • Set SSIS variable = database connection manager name

    Is it possible to set a SSIS string to only the name of a database connection manager or even the connection string it uses ? I don't see an option for that in Evaluate as expression property of ssis variable.
    This is what I mean - 
    SSIS Connection manager name = SQL_DBASE
    SSIS String str_managerName = SSIS Connection manager name: Can you do this dynamically in SSIS ?

    I'm guessing what they really want to do is evaluate some indicator (some input from a user or an infrastructure setting) and then dynamically connect to any one of 10 (arbitrary example) database servers based on what they get as input.  They
    don't care about the connection manager per se.  What seems reasonable is the that the Connection Manager might take a server variable but if they wanted to do things like that they would have bought Datastage.
    You might try attacking this problem at the Control Level and then connect to the database you want based on a variable you set.   I'm seeing that a Sequence Container can branch on the contents of a variable. 
    Or if the dba is your friend you might get the dba to add all your servers as linked servers to a central connection machine and then you might be able to do this by putting the ssis variable in a "Sql Command from a Variable" variable. 
    It might look something like this:
    Server is designated in ssis var @[User::Machine]
    then executing from a variable
    "select top 100 * from " + @[User::Machine] + ".mydb.dbo.mytable"
    Be careful as hades about levels of indirection and what quotes you want at what level.  Evaluate Expression in ssis helps with this.  The syntax I show works only with an ms sql connection server to a remote ms sql server.  This is what a
    dynamic connection to a linked server connection to Oracle would look like:
    "select * from
    openquery("+ @[User::Machine] + ",'select * from oradb.oratable where rownum < 100')"
    When ever a thousand of your best friends are helping you connect to your database (using tools like linked servers as opposed to direct connections) it's probably best to use with only small specific updates or queries, large queries or large
    updates would probably take a long time and or might not finish.  But try it before you give up.   We are actually doing fairly large Oracle queries (5-10 million rows) through ms sql linked server.

  • Unix Environment variable for connect string in SQL*Plus

    I am using some environment variables to connect to a sql*plus session in unix.
    they are exported as part of a file which contains the following and gets executed through the .profile.
    export db_username=xxx
    export db_password=xxx
    export db_name=xxx
    i have created a file abc.sql which contains the following
    connect $db_username/$db_password@$db_name
    Now, I have a shell script which uses this file inside it to connect to a sql*plus session and execute some queries.
    The contents of the shell script :
    API_CONNECT_SQL=abc.sql
    sqlplus /nolog << THEEND
    WHENEVER SQLERROR EXIT SQL.SQLCODE ROLLBACK
    WHENEVER OSERROR EXIT FAILURE ROLLBACK
    set timing on
    @${API_CONNECT_SQL}
    ---- do something
    EXIT
    THEEND
    Now, the sql*plus session is able to get db_username and db_password, but not the db_name. It says "TNS service name not found".
    If I hardcode some database name in place of db_name, it connects properly.
    Please let me know the problem and solution as well.
    Any help appreciated.
    thanks,
    Vijay

    for me this one works
    # =========================================
    # begin of script
    # =========================================
    export db_username=alpha
    export db_password=bravo
    export db_name=charly
    echo "connect $db_username/$db_password@$db_name" > xxx.sql
    API_CONNECT_SQL=/cfs/dummy1/0/appl/dummy2/rev_04/zzz/tst/xxx.sql
    cat ${API_CONNECT_SQL}
    sqlplus /nolog << THEEND
    spool xxx
    WHENEVER SQLERROR EXIT SQL.SQLCODE ROLLBACK
    WHENEVER OSERROR EXIT FAILURE ROLLBACK
    set echo on
    host cat ${API_CONNECT_SQL}
    @${API_CONNECT_SQL}
    select * from dual;
    spool off
    EXIT
    THEEND
    # =========================================
    # end of script
    # =========================================

  • Definiing variables in connection string

    Hi,
    I have a web application which connects to database (using DataSource thru JNDI lookup) through Microsoft SQL Server JDBC Driver. The application server is JBoss. Now in the connection string i also want to put a variable "hostname" with its value being the login id of the current user of the web application. How can I do that? I then would acces the connection string to get the current login id from the "hostname" variable. I know there are other ways to save the login id (like in HttpSession) but in my case I have to make it a part of the connection string.
    Thanks

    This one was my fault. The connection string was not the issue. It was the SQL command I was sending. The terminating semicolon had to be removed.

  • How to set ApplicationIntent=ReadOnly in Connection String for SharePoint 2013

    SharePoint 2013 and SQL Server 2012 allows us some additional options to create HA and DR sites through AlwaysOn Availablibity Groups and Listeners.  Problem that I'm having is that I have a DR site that is at a different location.  Microsoft
    recommends not to stretch the farm across different locations, so I've created a separate farm for DR.  I have my content database in an Availability Group so that is Asynchronously commits data changes across the 2 locations.  My DR site
    connects to the content database through a Listener. 
    Since the DR site is connecting to the content database through the Listener, it is connecting the primary replica.  In order to connect to the Read Only secondary replica, I need to add "ApplicationIntent=ReadOnly"
    to the connection string.  How do you do that?

    It supports a secondary being Readable, that is all it is telling you. It does not support, nor implement, Read-Intent. This is expected behavior. You can look at the Conn Strings via PowerShell, of course:
    $db = get-spdatabase | where {$_.TypeName -like "*Config*"}
    $db.DatabaseConnectionString
    Data Source=SPSQL;Initial Catalog=Config;Integrated Security=True;Enlist=False;
    Pooling=True;Min Pool Size=0;Max Pool Size=100;Connect Timeout=15
    Trevor Seward
    Follow or contact me at...
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • Connection string not in the command line argument.

    Hi,
    I found myself constantly looking for the debug connection string and to enter it in the "Command line arguments".  I decided to create my Add-On base class from which all my add-ons inherit from.
    In the constructor of the base Add-On class I determine the connection string based on whether the code is in debug more or not.
    Example:
    string connectionString  = string.Empty;
    #if DEBUG
        _connectionString = "0030002C0030002C00530041005000420044005F00440061007400650076002C0050004C006F006D0056004900490056";
    #else
        // Get the log info
        if (Environment.GetCommandLineArgs().Length > 1 )
            _connectionString = Environment.GetCommandLineArgs().GetValue(1).ToString();
    #endif
    I hope this help.
    Edited by: B1Computing on Apr 5, 2011 8:20 PM

    Hi,
    I found myself constantly looking for the debug connection string and to enter it in the "Command line arguments".  I decided to create my Add-On base class from which all my add-ons inherit from.
    In the constructor of the base Add-On class I determine the connection string based on whether the code is in debug more or not.
    Example:
    string connectionString  = string.Empty;
    #if DEBUG
        _connectionString = "0030002C0030002C00530041005000420044005F00440061007400650076002C0050004C006F006D0056004900490056";
    #else
        // Get the log info
        if (Environment.GetCommandLineArgs().Length > 1 )
            _connectionString = Environment.GetCommandLineArgs().GetValue(1).ToString();
    #endif
    I hope this help.
    Edited by: B1Computing on Apr 5, 2011 8:20 PM

  • Using variable in connection string returns 0 for variable.

    hi all- I am pulling data from a visual forxpro database and the connection string is as follows: 
    Data Source=\\ServerName\FolderName\AR;User ID=Domain\svcAct;Provider=VFPOLEDB.1;Persist Security Info=True;
    I created a variable called CurrentARPath and stored the path
    \\ServerName\FolderName\AR
    I then tried using this variable in the Expression property of the connection string as follows:
    "Data Source="+(DT_WSTR, 20)@[User::CurrentARPath] + ";User ID=Domain\\svcAct;Provider=VFPOLEDB.1;Persist Security Info=True;"
    However, the above expression is evaluating the variable to 0 as shown below; this is causing the connection in connection manager to go down(offline) and the OLED data source is complaining.
    Data Source=0;User ID=Domain\svcAct;Provider=VFPOLEDB.1;Persist Security Info=True;
    any idea what i am doing wrong here? thanks in advance!

    What datatype is CurrentARPath? Are there any
    configurations on the connection string or variable?
    Which
    package protection level are you using?
    CurrentARPath data type - Char
    there are no configurations on the connection string. one thing that i should mention is that i have created a variable  called ArPath of type object and using it in the for each loop container. this variable gets populated using an execute SQL statement.
    i am then mapping the vale from ArPath to CurrentARPath in the loop container.
    Package protection level is default(encrypt sensitive)
    thanks for the help.

  • Connection String not in

    Hello:
       I have a strange problem. I have an addon that using single sign on to connect to UI and DI together. I uses the connstring = System.Convert.ToString(Environment.GetCommandLineArgs().GetValue(1)); to get the connection string from UI. I can do it from Release mode(and it's not the debugging connection string, it's the real application connection string. But can't do it with the .exe inside the release fold. keeping getting the out or array index exception, which means that line didn't grab the connection string from UI (my SBO is on)Is this normal? Here's the details
       I am using SBO 2005A(6.80.317) SP: 01 PL: 04. UI-API I am using is version: 6.8.0.0. DI-API I am using is 2005.0.0.0.
       I am keep on thinking that it might be the wrong UI that I am using, but the fact that it connect to it in the release mode means it should be ok! So what's my problem? Thank You!
    Here's my entire code:
    private void setapplication()
                   // connect to SBO GUI application
                string connstring = string.Empty;
                   SAPbouiCOM.SboGuiApi sboapi = new SAPbouiCOM.SboGuiApiClass();
                try
                    connstring = System.Convert.ToString(Environment.GetCommandLineArgs().GetValue(1));
                    MessageBox.Show(connstring);
                catch
                    MessageBox.Show("No connection String");
                    System.Environment.Exit(0);
                   try
                        sboapi.Connect(connstring);
                   catch(Exception ex)
                        MessageBox.Show(ex.Message);
                        System.Environment.Exit(0);
                   global.oapplicaiton = sboapi.GetApplication(-1);
    Message was edited by: Bo Peng

    Hi Bo,
    If you just start the exe by itself, you have to supply the connectionstring yourself.
    If the exe is started as an addon by SBO the connection string is supplied by SBO.
    regard
    Ad

  • Set  Substitution Variables automaticaly with system time?

    does anyone know of a utility or a method to automatically update substitution variables with the system time?[email protected]

    Hi, another solution with maxl under NT, using environment variables:create a file test.msh:spool on to c:\test.out;login $1 $2 on $3; alter database $4 set variable $5 $6;echo "variable altered";spool off;exit;and launch via the command prompt:essmsh test.msh admin password localhost Demo.Basic datetime '%TIME%'for the date for instance:essmsh test.msh admin password localhost Demo.Basic datetime '\""%DATE%\""'Eric BelmonPartake Consulting.

  • Set substitution variable

    Can anyone tell me how to set a substitution variable on a data load, if possible?
    Or any other way to automatically update a substitution variable

    you can do it through a maxl script.
    the maxl script should flow as below...
    load data using import maxl command
    based on the return code you can set the value of subst variable using the following script.
    if it is a variable on db:
    alter application <appname>.<dbbname> set variable <subst variable name> <variable value>;
    if it is a server level subst variable
    alter system set variable <subst variable name> <variable value>;
    - Krish

  • How to set a variable to a string with special characters?

    I want to set a variable to
    <cfset inputstring = "<img src="../../../server/win/form/stamp/string_1" />"/>
    but i keep getting error:
    Invalid CFML construct found on line 184 at column 32.
    ColdFusion was looking at the following text:
    I have try it different ways , what i'm i doing wrong?

    You have to either escape the inner quotes or mix single and double quotes.  Try:
    <cfset inputstring = "<img src=""../../../server/win/form/stamp/string_1"" />"/>
    or
    <cfset inputstring = '<img src="../../../server/win/form/stamp/string_1" />'/>
    Oh, and the trailing forward slashes aren't necessary in the <cfset> tag.
    -Carl V.

  • Set substitution variable from Sql table

    Hi guys,
    I am new to sql/unix so I hope you can guide me in the right direction.
    whats the easiest way to update an essbase subvar from a sql table?
    would I have to write a sqlplus statement to output the variable to file,
    read the file in a maxl command and set the variable and call these commands using .sh script and esscmd?
    is there a more efficient way to set the variable? e.g only use sqlplus and esscmd?
    thanks in advance,

    Try something like this
    echo off
    sqlplus -s username/passwordusername/password@server/SID:@server/SID:port @test.sql > variable.txt
    for /f "usebackq delims=" %%a in (variable.txt) do set CurrentMonth=%%a
    echo %CurrentMonth%
    See whether you are getting the correct month.
    Regards
    Celvin
    http://www.orahyplabs.com

  • Oracle connection string not working

    Dear all,
    For staging of DQC on oracle does not appear to work. SP2 admin guide offers four different ways to input server name incl:
    1. server name/service name
    2. FQDN/port number/sid
    3. ip address/port number/sid
    4 TNS entry
    I've tried the first three syntax but were unsuccessful. Please suggest what syntax to use. We are on oracle 10g, NW CE7.2 with DQC SP2.
    Best regards.
    Mohammad

    Thanks Stephen,
    It didn't connect... the message appears:
    Connection Failed:Bad packet type. Bad packet type.
    CDS log has following info:
    ERROR com.nakisa.Logger  - com.nakisa.framework.data.commandProcessor.impl.SqlServerCommandProcessor : getDataTables : Could not create a database connection. Data Element Name:
    When I check the db connection with the nksadm user... it successfully logs on to oracle and shows db is in running state. Also all oracle services are up without any issue.
    Our build is SP2 - 0702015700 on NW CE7.2 (no SP) and oracle 10g.
    Any ideas, and thanks for the support.
    Best regards

  • Dynamic connection string not working in SSIS package 2008R2

    I am using SSIS package for Import data from excel sheet to SQL DB. In the configuration file I'm using following variables.
    Name scope DataType Value
    DBName package String DB_Master
    Password package String xx
    UserName package String sa
    ServerName package String xxx.xxx.x.xx
    SqlConnectionString package String DataSource=xxx.xxx.x.xxx;UserID=sa;Provider=SQLNCLI10.1;Integrated Security=SSPI;Auto Translate=False;Initial Catalog=DB_Master;Password=xx
    Right click OLEDB ConnectionManager then click properties window below values assign
    ConnectionString - Initial Catalog=DB_Master;DataSource=xxx.xxx.x.xxx;UserID=sa;Provider=SQLNCLI10.1;Integrated Security=SSPI;Auto Translate=False;
    DelayValidation - True
    Expressions -ConnectionString - @[User::SqlConnectionString]
    In SqlConnectionString variable properties window below values assign
    EvaluateAsExpression -True
    Expression -"DataSource=" + @[User::ServerName] + ";UserID=" + @[User::UserName] + ";Provider=SQLNCLI10.1;Integrated Security=SSPI;Auto Translate=False;Initial Catalog=" + @[User::DBName] + ";Password=" + @[User::Password]
    After deploy the package file I change the DBName in SqlConnectionString DB_Master to Master but package execute the files in DB_Master.
    and also if i give invalid ServerName like 198.152.1 but package executed successfully.
    Please tell me where i made mistake. what's goes wrong...?
    I just use variable like below link
    https://anothersqlgeek.wordpress.com/2013/03/28/ssis-dynamic-connections-part-1/comment-page-1/#comment-48

    First see whether you've some other configurations also set inside the package for the same properties? ie direct configuration for connection manager properties.
    Secondly see if its executed from a job and you're overriding the values through the job properties.
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Using calc script function when setting substitution variable value

    I would like to be able to execute the below, but this wont work since it is a combination of MaxL and calc script syntax:
    alter database 'App'.'DB' set variable 'Var1' @PARENT("Day 1");
    The following does not work either for the same reason:
    set A = @PARENT("Day 1");
    echo $A;
    alter database 'App'.'DB' set variable 'Var1' $A;
    Is there a correct way to do the above, and is it even possible? Or will the variable literally have to contain the value "@PARENT("Day 1")" to be later parsed in a calc script?

    Hi James. I was hoping that 'query database' with the 'member info' option was going to include the parent in the result set, but it's just a bunch of storage / consolidation properties so no luck there.
    The only idea i could come up with (and this is getting pretty clunky) would be to use MaxL to execute a report script (or MDX query, but the output would be different and probably harder to parse):
    //ESS_LOCALE English_UnitedStates.Latin1@Binary
    {SUPHEADING}
    {TABDELIMIT}
    <ROW("YourDimension")
    <PARENT &YourSubVar
    !This spits out a tab delimited file containing just one line - the name of the parent of the member named in &YourSubVar, and one data value, tab delimited. You could then parse the output in cmd (I'm assuming you're on Windows) using FOR /F to grab the first value and then pass it back in to a subsequent MaxL command to update the value of the second subvar (as referenced in your fix).

Maybe you are looking for

  • Small Office Recommendation

    Hi Experts, May I ask for your recmmendation, on what type of equipment should I use in a Small Office probably around 50-100 users. Feature sets that I would want are: VPN - 5 VPN Peers for L2L connectivity and 50 SSL VPN connections, Firewall, Acti

  • Any ideas for making work an 2004 photo printer in Mavericks.

    The generic postscript driver does not have the 4x6'' paper the printer support. (It is a Sony DPP-FP30... and Sony does not have Mac drivers)

  • Random audio corruption after running processes

    I have an audio voiceover session I have run hiss reducer on. Everything is fine for a few minutes as I add silence where I need it and bounce out individual files. Then, all of a sudden, everything will become corrupted and full of loud static. I ha

  • Does anyone have a step-by-step on how to install fireFox 3.5.5

    Greetings to All!, I have a very limited knowledge working with Solaris. I need to install Firefox 3.5.5 so that I can use a GUI based FTP client. I have downloaded the program but I don't know how to install it and I hate to break my system. Please

  • Setting multiple album images for a group.

    I want to put multiple images for CDs that I have (Front, back, inside of booklet, etc). Can I do this for an entire CD or do I need to do each song separately?