Home > database >  How to write
How to write

Time:09-22

Table 1 delete students instructions how to write

2 how do I remove students' math 'column in the table,

A student table is as follows:

Student id name Chinese grades in math

CodePudding user response:

 
- 1. Delete the student table
If object_id (' student table) is not null
Students drop table table
Go
-- 2. Delete the student mathematics result column in the table
IF COL_LENGTH (' students' table ', 'math') IS NOT NULL
The ALTER TABLE students TABLE DROP COLUMN
in mathGO

CodePudding user response:

reference 1/f, gypsy song response:
 
- 1. Delete the student table
If object_id (' student table) is not null
Students drop table table
Go
-- 2. Delete the student mathematics result column in the table
IF COL_LENGTH (' students' table ', 'math') IS NOT NULL
The ALTER TABLE students TABLE DROP COLUMN
in mathGO

Thank you

CodePudding user response:

refer to the second floor weixin_46373612 response:
Quote: refer to 1st floor gypsy song response:
 
- 1. Delete the student table
If object_id (' student table) is not null
Students drop table table
Go
-- 2. Delete the student mathematics result column in the table
IF COL_LENGTH (' students' table ', 'math') IS NOT NULL
The ALTER TABLE students TABLE DROP COLUMN
in mathGO

Thank you


You're welcome, it's ok it tieba
  • Related