⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 索引.sql

📁 简单的sql语句 数据与汇总。 高手多多指点。
💻 SQL
字号:
use northwind
go

select * from employees 
go

create nonclustered index cl_lastname
on employees(lastname)
go

drop index employees.cl_lastname
go

select * from customers 
go

sp_help customers
go

create unique nonclustered index u_companyname
on customers(companyname)
go

select customerid,count(customerid) as '# of duplicates'
from customers
group by customerid
having count(customerid)>1
order by customerid
go

create unique nonclustered index u_ordid_proid
on [order details](orderid,productid)
go

exec sp_help [order details]
go

exec sp_helpindex [order details]
go

exec sp_configure
go

create index orderid_ind
on orders(orderid)
with pad_index,fillfactor=70
go

dbcc showcontig(customers,pk_customers)
go


exec sp_help customers 
go

dbcc dbreindex('customers',pk_customers,80)

dbcc dbreindex('customers','',80)
go
/*
上例使用填充因子值80 重建 customers 表上的所有索引。
*/

dbcc indexdefrag(northwind,customers,pk_customers)
go

create unique nonclustered index  u_ordid_proid
on [order details](orderid,productid)
with drop_existing,fillfactor=65
go

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -