- Methods for how to open xp_cmdshell:
exec sp_configure ' show advanced option ', 1
Reconfigure
Go
exec sp_configure ' xp_cmdshell ', 1
Reconfigure
Go
- About Intercepting table field names:
Select Newname=left (Trim (name), 1) from student
- SQL Temp Table Usage:
SELECT * Into #A the FROM student inserts student content into the staging table #a
- SQL Add Table Foreign Key association:
ALTER TABLE borrow ADD constraint fk_student foreign key (STUID) references student (STUID)
- SQL multi-Table query:
Select Stuent.stuname,stuent.stuid,book.title,book. Bid,borrow. T_time from Student,book,borrow where Student.stuid=borrow.stuid,book. Bid=borrow. Bid,borrow. T_time between ' 2007-12-15 ' and ' 2008-1-8 '
- SQL adds the corresponding ordinal number based on the number of table data:
Update Stu
Set Scount =
(Select Temp.value from (select SCode, value = $ * row_number () over [order by SCode] from Stu) as Temp where Temp.scode = Stu.scode)
- SQL to create clustered and nonclustered indexes:
CREATE CLUSTERED INDEX ix_id on person (Id)
Create nonclustered index ix_name on person (Name)--Creating a nonclustered index
Some knowledge points about SQL Server