Common stored procedures and functions
Common storage process
View specified database information
Stored procedure name: sp_helpdb
instance:
Rename operation
Description: Click this link for details , support renaming (tables, attempts, columns, stored procedures, triggers, default values)
execute sp_rename '原表名','新表名' --更改表名
execute sp_rename '表名.列名','新列名' --更改列名
execute sp_rename '表名.索引名','新索引名' --更改索引
Change the database name
execute sp_rename '原数据库名','新数据库名'
Commonly used aggregate functions
Date function year()
grammar:
year(date)
Parameters:
1.date is a legal date
Return value:
int type, returns the year of the specified date