Deleting Columns and Parameters

Deleting Columns and Parameters

A few types of objects appear in Schema View, even though you cannot delete them from Schema View. The examples are columns in a table and parameters of a stored procedure or function. Both these types of objects appear in Schema View so that you can better understand the table, procedure, or function without having to open its definition. However, each column and parameter is defined within the file that defines the entire table, procedure, or function. To delete these items, you must modify the definition for the table, procedure, or function.

To delete a column from a table


  1. If Schema View does not appear, open the View menu, point to Other Windows, and click Schema View.

  2. In Schema View, click the table that contains the column that you want to delete.

    - or -

    In Solution Explorer, click the file containing the table that contains the column that you want to delete.

  3. On the View menu, click Open.

    The file that contains the table definition opens in the Transact-SQL (T-SQL) editor.

  4. Modify the table definition to remove the column that you want to delete.

  5. On the File menu, click Save TableName.Table.sql.

    The changes are saved, and the table definition is updated in Schema View. The column that you deleted no longer appears.

To delete a parameter from a stored procedure or function


  1. If Schema View does not appear, open the View menu, point to Other Windows, and click Schema View.

  2. In Schema View, click the stored procedure or function that contains the parameter that you want to delete.

  3. On the View menu, click Open.

    The file that contains the procedure or function definition opens in the Transact-SQL (T-SQL) editor.

  4. Modify the procedure or function definition to remove the parameter that you want to delete.

  5. On the File menu, click SaveProcedureName.proc.sql or SaveFunctionName.function.sql.

    The changes are saved, and the procedure or function definition is updated in Schema View. The parameter that you deleted no longer appears.

Comments

Popular posts from this blog

Google to FTS Syntax Cheat Sheet

@@rowcount

Sql Index