Skip to Content

How to create a table in sql so that it goes into desired schema?

Hi,

While creating a table in sql editor sap hana studio what is the syntax so that the table is created in desired schema using sql.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jun 01, 2017 at 12:37 AM

    The default schema for your session is the schema that has the same name as your user.

    For example, your user is called "SAPDEV" and it's default schema is also called "SAPDEV".

    As users can own multiple schemas, you can switch with the "SET SCHEMA " command ( https://help.sap.com/viewer/4fe29514fd584807ac9f2a04f6754767/2.0.00/en-us/20fd550375191014b886a338afb4cd5f.html).

    Add comment
    10|10000 characters needed characters exceeded

  • May 31, 2017 at 11:52 PM
    -1

    Hi Rohit,

    You simply have to logon with the database user that OWNS the schema you want.

    Example:

    If your SCHEMA is SAPSR3, you have to logon with SAPSR3 user, then simply create the table.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi lars,

      When i m trying to retrive the tables present in the schema im able to retrieve even the system tables.

      My requirement is I need to retrieve only the tables present in the schema but not the system tables(dafault tables).

      Note: I want a solution such that we should not pass schema name in the SQL Query