Create an object

  • Guys how do i create an object?

    It is called dbo.tm_dbs_get_directory.

    thanks

  • Assuming it is T-SQL procedure

    CREATE { PROC | PROCEDURE } [schema_name.] procedure_name [ ; number ]

    [ { @parameter [ type_schema_name. ] data_type }

    [ VARYING ] [ = default ] [ OUT | OUTPUT ] [READONLY]

    ] [ ,...n ]

    [ WITH <procedure_option> [ ,...n ] ]

    [ FOR REPLICATION ]

    AS { <sql_statement> [;][ ...n ] | <method_specifier> }

    [;]

    <procedure_option> ::=

    [ ENCRYPTION ]

    [ RECOMPILE ]

    [ EXECUTE AS Clause ]

    <sql_statement> ::=

    { [ BEGIN ] statements [ END ] }

    Check BOL Books On Line for similiar samples for views, functions, etc.

    Now another way of creating an additional object from what that already exists in a database use SSMS, lets say it is another table that you want to create. Open the data base, scroll down to tables,

    right click on the table, and in the pop open window that opens select

    "Script as" then modify the definition, change the table name, if you want column names, data types, etc., etc. In a similiar fashion you will see how to create stored procedures, user functions, views, etc.

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

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

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