随笔分类 -  数据库

摘要:查看表是否死锁 select * from master..SysProcesses where db_Name(dbID) = '数据库名' and spId <> @@SpId and dbID <> 0 and blocked >0; 或者 select request_session_id 阅读全文
posted @ 2023-12-27 16:59 李家的张麻子 阅读(182) 评论(0) 推荐(0)
摘要:数据库创建 创建数据表 create table ( 字段1 字段类型 not null , 字段2 字段类型 ) primary key() 删除数据表 drop table 表名 增加字段 alter table xxx add 列名 类型 修改字段类型或长度 alter table 表 alt 阅读全文
posted @ 2023-02-23 20:51 李家的张麻子 阅读(80) 评论(0) 推荐(0)
摘要:准备基础数据 CREATE TABLE [dbo].[person_info]( [name_person] [varchar](32) NULL, [age] [int] NULL, [address] [varchar](128) NULL ) ON [PRIMARY] insert into 阅读全文
posted @ 2022-11-20 15:39 李家的张麻子 阅读(120) 评论(0) 推荐(0)
摘要:准备基本的数据 create table test_table ( id int identity(0,1), name varchar(20), age int, book_name varchar(50), price float ) insert into test_table values 阅读全文
posted @ 2022-02-01 15:41 李家的张麻子 阅读(236) 评论(0) 推荐(0)