ISQL script for Creating user, database and tables

  • Dear All,

    I am writing a script for SQL6.5 for auto generating a database and a user for that database and few tables within the database.

    I am struck at changing the user from 'sa' to the newly created user (say 'sharan') so that i can create a database and table under him.

    In Oracle I can use a command in SQL script file for this as "connect sharan/abcd123" but how to do in SQL server?

    Presently, I am changing the ownership from SA to sharan after creating the database and tables.But, still the owner would be DBA not sharan for database and tables.

    Can you please help me? Thanks in advance.

    Thanx n Rds

  • try a

    use sharan

    statement.


    Cursors never.
    DTS - only when needed and never to control.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply