Other Programming Languages

NAVIGATION
CATEGORIES
LINKS
Home » Other Languages »» Other Programming Languages
  • Setting SQL Permission using DOS command

    3 answers - 191 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg

    hi all,
    i would like to know the DOS command for the command in setting the permission in a SQL Server/DB. hope someone can help me in this. thks a million in advance.
    longwar

  • No.1 | | 170 bytes | |

    You would run query analyzer from the command prompt passing the sql text as a parameter. This can also be done as a bat file or shelled in most other languages. [/color]
  • No.2 | | 2251 bytes | |

    There is a command line version of QUERY ANALYZER that can run at a DOS prompt. With it you can execute QUERIES against a server/database.

    From BOL:

    osql Utility
    The osql utility allows you to enter Transact-SQL statements, system procedures, and script files. This utility uses ODBC to communicate with the server.

    Syntax
    osql
    [-?] |
    [-L] |
    [
    {
    {-U login_id [-P password]}
    | E
    }
    [-S server_name[\instance_name]] [-H wksta_name] [-d db_name]
    [-l time_out] [-t time_out] [-h headers]
    [-s col_separator] [-w column_width] [-a packet_size]
    [-e] [-I] [-D data_source_name]
    [-c cmd_end] [-q "query"] [-Q "query"]
    [-n] [-m error_level] [-r {0 | 1}]
    [-i input_file] [-o output_file] [-p]
    [-b] [-u] [-R] [-O]
    ]

    Operating-System Commands
    Operating-system commands can also be executed by starting a line with two exclamation points (!!) followed by the command. The command recall facilities of Windows NT can be used to recall and modify osql statements. The existing query buffer can be cleared by typing RESET.

    When running stored procedures, osql prints a blank line between each set of results in a batch. In addition, the "0 rows affected" message does not appear when it does not apply to the statement executed.

    Using osql Interactively
    To use osql interactively, type the osql command (and any of the options) at a command prompt.

    You can read in a file containing a query (such as Stores.qry) for execution by osql by typing a command similar to this:

    osql /U alma /P /i stores.qry

    The file must include a command terminator(s).

    You can read in a file containing a query (such as Titles.qry) and direct the results to another file by typing a command similar to this:

    osql /U alma /P /i titles.qry /o titles.res

    When using osql interactively, you can read an operating-system file into the command buffer with :r file_name. Do not include a command terminator in the file; enter the terminator interactively after you have finished editing.
  • No.3 | | 144 bytes | |

    Yes, thats what I was refering to but I didnt state teh query analyzer filename as I couldnt remember the difference between the isqlw and osql?

Re: Setting SQL Permission using DOS command


max 4000 letters.
Your nickname that display:
In order to stop the spam: 6 + 6 =
SPONSORED
QUESTION

SPONSORED
VISUAL BASIC TECHNOLOGIES