February 12, 2012 at 9:56 am
Guys how do i create an object?
It is called dbo.tm_dbs_get_directory.
thanks
February 12, 2012 at 10:13 am
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.
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply