Openrowset - how to specify database name

Hi,
I want to run
DBCC SHOWFILESTATS against a specific database on my server. I can get openrowset to retun the data for master; but, how do I specify a different database?
select * FROM OPENROWSET ('SQLOLEDB','SERVER=(local) ;TRUSTED_CONNECTION=YES;',
'Set FmtOnly OFF;EXEC (''DBCC SHOWFILESTATS'')'
How/where do I put the DB name?

You're right. I forgot the closing paren.
select
FROM
OPENROWSET
('SQLOLEDB','SERVER=(local);database=test1
;TRUSTED_CONNECTION=YES;',
'Set FmtOnly OFF;EXEC (''DBCC SHOWFILESTATS'')'   )

Similar Messages

  • How to specify alias name in system property while making 2way SSL con ?

    Hi All,
    I am tring to run a java client with 2way SSL which uses CAC card as keystore for the client. I have addded the following system property in my client program to make it work and change the java.security file to add pcks11 provider.
    System.setProperty("javax.net.ssl.keyStoreType", "pkcs11");
    System.setProperty("javax.net.debug", "ssl");
    The program works fine and handshake is successfully done . But the problem is when i have more than one trusted certificate in the CAC card, it take a default certificate. I want to specify the certificate that should be used to do the client auth maybe specify the alias name . I didnt find any system property to do so.
    Please let me know how to specify alias name as system property so that the 2way SSL used the specified alias for the client auth or is there any other way to specify the alias name. As in case i acccess the server URL from any browser i get a certificate selection prompt and the connection is established with the selected certificate.
    Thanks in advanced,
    Ruhul

    I didn't find any system property to do so.There isn't one.
    Please let me know how to specify alias name as system propertyYou can't.
    You would have to write a custom KeyManager. See the JSSE Reference Guide.

  • KSLD how to specify kernel name when run ksld command on host

    I am trying to use KSLD v1.0 and I could not reproduce similar result shown on KSLD User Guide. I followed almost everything on KSLD User Guide except I don't know how to specify kernel name when running ksld command. Here is what I have tried.
    #ksld -t debug /ksld-space/slo8/proto/root_sparc/platform/sun4u/kernel/sparcv9/unix 99
    I can only get unix and krtld read in. (ksld_dbx)modules could not show any modules *.o
    When I use this
    #ksld -t debug /ksld-space/slo8/proto/root_sparc/platform/sun4u/kernel/sparcv9/genunix 99
    then I can only read on genunix.
    Example on KSLD User Guide use unix.281, what is unix.281 created or obtained from target.
    I noticed some SUN Tachnical Support Guru are online to answer questions, thank you for your quick reply.

    I am having the same problem, did you get a solution?
    Thanks,
    I am trying to use KSLD v1.0 and I could not reproduce
    similar result shown on KSLD User Guide. I followed
    almost everything on KSLD User Guide except I don't
    know how to specify kernel name when running ksld
    command. Here is what I have tried.
    #ksld -t debug
    /ksld-space/slo8/proto/root_sparc/platform/sun4u/kernel
    sparcv9/unix 99
    I can only get unix and krtld read in.
    (ksld_dbx)modules could not show any modules *.o
    When I use this
    #ksld -t debug
    /ksld-space/slo8/proto/root_sparc/platform/sun4u/kernel
    sparcv9/genunix 99
    then I can only read on genunix.
    Example on KSLD User Guide use unix.281, what is
    unix.281 created or obtained from target.
    I noticed some SUN Tachnical Support Guru are online
    to answer questions, thank you for your quick reply.

  • How to know database name and schema name

    Hi ,
    Once after logging in the database,how is it possible to know the current database and schema which we r using?Is there any system table where we can get the database names and schema names?
    please help me out.itz urgent.
    Regards,
    Sravan

    Probably not.
    If the database name is the name of the current database, it would be essentially redundant. If the database name is the name of some other database, in order to get the names of all the tables in the specified schema, you could create a database link to the remote system (which assumes you have a login and password to the remote database with appropriate privileges, that the database server's tnsnames.ora file has an entry for the remote database, etc) and query the remote data dictionary tables. Even if you could do that, however, you could not dynamically create triggers on the remote database since DDL over a database link.
    In theory, you could also load an appropriate JDBC driver into the database and write a Java stored procedure that would connect to the remote database (again, with an appropriate user name & password, host name, and port number) and issue DDL against that remote database. I have a hard time believing, however, that this would be a particularly beneficial approach. It would be easier just to put the appropriate code into each database that needs triggers generated or to have a separate Java application that generates triggers for a number of different databases.
    Justin

  • How to determine database name I am connected to ?

    I would like as simply and fast as possible to determine the database name, which I am currently connected to. Maybe the property jbo.sql92.JdbcDriverClass would do, but how to get its value ? Thanks for any suggestions.

    Ricky,
    don't understand that, why you don't use the session, when you are in BC4J (AM.getSession()) - which will give you at least the URL you connect too (in case you use a datasource - bad luck, as it is defined within the container ..)
    thx clemens

  • How to get database name

    How do i get the database name in reports. we can get this in form by get_application_property, do we have anything like that in reports
    thanks

    Check the database dictionary tables.
    sys.v_$parameter certainly contains a parameter with the name 'db_name'and the value of the database name.
    see what you get when you run:
    select * from sys.v_$parameter where name='db_name'
    If the user running the report won't have the select priviledge on sys.v_$parameter, then you will have to create a function that returns the value for the db_name parameter (that is in the schema of a user that has that priviledge) and grant execute on it to the user that runs the report and create a synonym for that function.

  • How to remove database name from SQL query

    We have an MS SQL server with several databases that are of the same schema but have different data.  We do this for testing different environments.  We are using Crystal reports for the first time and we are having trouble changing the database location in the designer.  If update the data source location to the same database server, but different database name, the data still comes from the original database used when creating the report.  We look at the SQL query and it contains the database name and does not change when updating the data source.  Therefore the data always comes from the database used when originally creating the report.
    How can I remove the database name from the SQL query so the proper database is used when testing the report?

    Hi C F
    Please ensure you have followed the procedure mentioned below:
    In Crystal Reports, there are two ways to set the location of the data source your report points to, depending on your connection type.
    For ODBC and Native Connections:
    1. On the 'Database' menu, click 'Set Datasource Location'.
    2. In the 'Current Data Source' section, click the data source to be changed. You must click each individual table in the data source one by one. If the data source is a stored procedure you will not see individual tables.
    NOTE     In Crystal Reports 10, XIR1, and XIR2, if you are mapping from a data source such as a stored procedure where the report designer can not determine which fields should be mapped automatically, you will see a 'Mapping' dialog box where you can manually map fields, as in the procedure cited above.
    3. In the 'Replace with' section, click the data source you want the report to use.
    4. Click 'Update'.
    5. Close the 'Set Datasource Location' window.
    The report now points to the new location.
    For Native Connections Only:
    1. On the 'Database' menu, click 'Set Datasource Location'.
    2. In the 'Current Data Source' section, click 'Properties' to expand it and right-click 'Database Name: <path to database>'.
    3. Click 'Edit' and then type the path to the
    new data source location.
    4. Close the 'Set Datasource Location' window.
    The report now points to the new location.
    Regards
    Girish

  • Specifying Database name in dictionary perspective

    Hi Experts,
    Can someone please tell me how can i specify Database in which i want to create tables in dictionary perspective. We dont want to use WAS server database for our application database tables.
    Regards
    Pranav

    Hi,
    In which NW version are you using? I don't think it possible in NW 7.
    You can always create new scheme/table from the DB management tools (SQL Plus, SQL Server Management Studio etc)
    Omri

  • How to display database name in page footer in webi report

    Hi Every one,
    I have migrated deski report from BO 6.5 to BI 4.1. and converted Deski to WEBI in 4.1.
    In Bo 6.5 page footer displaying database name but BI 4.1 it showing database type (like Oracle 10g,9i ..etc..).
    I want database name in page footer.
    Please any one help me to solve this issue.
    Thanks

    Hi Thanks for your reply.
    We have tried this option but its not helpful.
    Below syntax is  in both BO 6.5 and BI 4.1.but in 6.5 it showing database name where as in BI 4.1 it showing database type
    ="Track GPQ Database - " + Upper(Substr(Connection((DataProvider(([product])))) ;Pos(Connection((DataProvider(([Product])))) ;"DATABASE")+9 ;7)).

  • How to specify class name in environment or system property

    Hi,
    Iam learning ejb. I was practicing the stateless session bean. I wrote a sample hello world application. While executing the client am getting the following error.
    {color:#ff0000}Exception in thread "main" javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at hw.HelloClient.main(HelloClient.java:20){color}
    My Client program:
    {color:#3366ff}package hw;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.*;
    import java.util.*;
    public class HelloClient {
    public static void main(String[] args)throws Exception {
    Properties prop = System.getProperties();
    Context ctx= new InitialContext(prop); {color:#800000}// {color}{color:#800000}(Line no :20) here only error is pointing{color}
    Object obj = ctx.lookup("HelloHome");
    HelloHome home = (HelloHome)javax.rmi.PortableRemoteObject.narrow(obj,HelloHome.class);
    Hello hello = home.create();
    System.out.println(hello.hello());
    hello.remove();
    }{color}
    please suggest me a solution.
    note: iam using eclipse ganymede and jboss app server
    Edited by: Arun_ece on Mar 10, 2009 1:13 AM

    Hi,
    You need to create a ejb-jar.xml and jboss.xml files to deploy the application on the servers.
    Also, put these lines of codes after getting System Properties.
    prop.put(Context.PROVIDER_URL, "iiop://localhost:[port_no]");Thanks,
    Srikant

  • How to put database name/server name insted of  SQL

    Hi,
    I need to put a data base name/server name insted of SQL>, means
    if DATABASE NAME is db1, then
    db1>. insert into ----
    Thanks & Regards,
    Venkat

    Hi,
    Thank u. But I am looking with out my set SQL... Query. Automatically data base name comes at there. Becuase i am loading data into diffrent servers before run the script, for my reference, is it into correct server or not.
    When ever i exit it Return to SQL>. I need always at there.

  • How to set database name default for oracle discoverer 10g

    Hi
    Do you have idea of setting the database name default for oracle discoverer 10g

    I mean to say while login to discoverer 10g, it will ask for following options. In this Database should select the database name by default instead of any value
              User Name
              Password
              Database
              End User Layer

  • How to know database name and schema name by providing package name?

    Hi,
    Could someonw will help me to get database name and schema name by providing package name ?
    I have used the query : select * from all_objects where object_name='Package_name'; but it simply returns schema name where as i need DB name and username.
    --Prajakta

    but it simply returns schema name where as i need DB name and username.
    i want to retrive the DB name for package name
    Based on your questions, I wonder if you are used to working in SQL Server? (The server, database, and schema are part of the 4-part  name of an object, independent of any user.)
    In SQL Server, schema and username are two separate physical concepts.  "Schema" is purely logical in Oracle: a user which owns objects is often called a "schema".
    In Oracle, "database" is roughly equivalent to the SQL Server concept  "server" (what you log in to).  It is not part of the naming path to a specific object  (unless there is a database link involved, but there is no indication that's what you have here).  In Oracle you connect to an Instance (or Service) and people often call this the "database", but there is a fine semantic distinction there (separate topic). 
    Once connected in Oracle, you fully-qualify an object by only a 2-part owner and object name (possibly 3-part if a database link is involved user.object@link).
    12c added another wrinkle to all of this, but I'll assume this question was more basic than that, because you likely would have mentioned if this was a 12c question.

  • How to specify realm name when calling weak( ) method on ServletAuthentication class?

    I've created a bunch of custom realms and for a specific user logon (form based "uname" and "pword"), the system knows exactly which custom realm to look up against. However, in using ServletAuthentication class, one can only specify realm name in strong(req, res, realmName), not the weak() method. Any clue?
    -john

    Hi John,
    Did you find the answer to this question? I'm having a similar problem when calling the ServletAuthentication.assertIdentity() method.
    Cheers,
    Vidar

  • How to specify table name using xdoclet

    Hi
    I'm trying to specify a table name using xdoclet 1.2.
    I've tried the @sql.table, but that ain't working (no table mapping name is
    writen to the *.jdo)
    I've tried using the @jdo.class-vendor-extension with key=table and
    value=tablename, but that ain't working either.
    I guess number two approach ain't working because kodo want table name
    extension inside another extension like this:
    <extension vendor-name="kodo" key="jdbc-class-map" value="base">
    <extension vendor-name="kodo" key="table" value="tablename"/>
    </extension>
    But, how do I specify the above using xdoclet?
    Regards
    Jesper

    Ok.
    Is it possible somehow to just tell kodo to use another table name without
    having to create mapping extensions for collections and stuff. Even better
    if one could specify a table name prefix to be used on all tables.
    My problem is that I need use kodo on an existing database having tables
    names that conflict with kodo's auto-generated tables names. The schematool
    will then try alter these tables :-(
    Regards
    Jesper
    "Stephen Kim" <[email protected]> wrote in message
    news:[email protected]...
    When you use metadata mapping extensions, you should not generate
    .mapping files as all that info is stored in the .jdo file. You should
    instead set kodo.jdbc.MappingFactory to metadata.
    Jesper Ladegaard wrote:
    Thanks.
    However, I still can't get it to work.
    I've created a java class named Role with xdoclet like this:
    * @jdo.persistence-capable
    * @jdo.class-vendor-extension
    * vendor-name="kodo" key="jdbc-class-map" value="base"
    * @jdo.class-vendor-extension
    * vendor-name="kodo" key="jdbc-class-map/table" value="BW_ROLE"
    * @jdo.class-vendor-extension
    * vendor-name="kodo" key="jdbc-class-map/pk-column" value="JDOID"
    Xdoclet generates a jdo file like this:
    <jdo>
    <package name="dk.pine.users.services.model">
    <class name="Role"
    identity-type="datastore"
    <!-- end class tag --><extension vendor-name="kodo"
    key="jdbc-class-map"
    value="base">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-class-map/table"
    value="BW_ROLE">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-class-map/pk-column"
    value="JDOID">
    </extension>
    <field name="users"
    default-fetch-group="true"
    <!-- end field tag --><collection
    element-type="dk.pine.users.services.model.User"
    embedded-element="false"
    <!-- end collection tag --></collection>
    <extension vendor-name="kodo"
    key="inverse-owner"
    value="roles">
    </extension>
    </field>
    </class>
    </package>
    </jdo>
    Now I run the mappingtool (with option refresh) and it generates a
    mapping
    file like this:
    <mapping>
    <package name="dk.pine.users.services.model">
    <class name="Role">
    <jdbc-class-map type="base" pk-column="JDOID"
    table="dbo.ROLE0"/>
    <jdbc-version-ind type="version-number"column="JDOVERSION"/>
    <jdbc-class-ind type="in-class-name" column="JDOCLASS"/>
    <field name="description">
    <jdbc-field-map type="value" column="DESCRIPTION"/>
    </field>
    <field name="name">
    <jdbc-field-map type="value" column="NAME0"/>
    </field>
    <field name="systemRole">
    <jdbc-field-map type="value" column="SYSTEMROLE"/>
    </field>
    <field name="users">
    <jdbc-field-map type="many-many"
    element-column.JDOID="JDOID" ref-column.JDOID="ROLES_JDOID"
    table="dbo.USER0_ROLES"/>
    </field>
    </class>
    </package>
    </mapping>
    I expected it to create a BW_ROLE, but it create a ROLE0 table????
    "Stephen Kim" <[email protected]> wrote in message
    news:[email protected]...
    You can use slashes to denote sub extensions.
    See the example near the bottom of this link:
    http://solarmetric.com/Software/Documentation/3.0.3/docs/ref_guide_integrati
    on_xdoclet.html
    Jesper Ladegaard wrote:
    Hi
    I'm trying to specify a table name using xdoclet 1.2.
    I've tried the @sql.table, but that ain't working (no table mapping
    name
    >>
    is
    writen to the *.jdo)
    I've tried using the @jdo.class-vendor-extension with key=table and
    value=tablename, but that ain't working either.
    I guess number two approach ain't working because kodo want table name
    extension inside another extension like this:
    <extension vendor-name="kodo" key="jdbc-class-map" value="base">
    <extension vendor-name="kodo" key="table" value="tablename"/>
    </extension>
    But, how do I specify the above using xdoclet?
    Regards
    Jesper
    Steve Kim
    [email protected]
    SolarMetric Inc.
    http://www.solarmetric.com
    Steve Kim
    [email protected]
    SolarMetric Inc.
    http://www.solarmetric.com

Maybe you are looking for

  • HOW DO I SET MY AUDIO RECORDING PROGRAM

    I AM USING BEHRINGERS UF0202 TO TRANSFER MY CASSETTES TO ITUNES.  IT SAYS TO SET MY AUDIO RECORDING PROGRAM TO RECORD FROM THE USB PORT.  HOW DO I DO THIS?

  • Creating multiple constants

    Does creating and using multiple constants (string or numeric, say instead using of two numeric constants, conating same value, at two stantdifferent locations in the same VI, if I use one constant as common) affects anywaym on performance or memory

  • Page render problem in cc&b(ORMB)

    Hi, Once login the application home page would not render and one exclamation mark appear on left side on IE. When I check the detail of that error is shows : Line: 679 Char: 5 Erroe: myNavigationKeys' is undefined Code: 0 URL: http://localhost:6500/

  • NEED HELP ABOUT MY 1700 Series CISCO ROUTER

    Please someone help me. What can I do to a router giving me output in such a language? gj?) ??<??s??f???>?

  • ShowOneTab  control problem

    hi all i use showonetab control with two showdetailitem each detailitem has an inputtext the problem is when we write something in the inputtext in tab1 and navigate to tab2 and return back to tab1 then we lose data here is my jsp <af:showOneTab bind