SQL operation

xiaoxiao2021-03-06  100

1. Find the field name of the table

Select Name from syscolumns where id in (select id from sysoads where name = 'table name)

2. Operate the ID column automatic number

Declare @ID intSet @ID = 100000Update table 1 set @ID = @id 1, id = Right (@ ID, 5)

3. Remove the repeat line A in the table: Create a temporary table A, save the non-repetitive record, then delete all records in A, then insert A into A

Select Distinct * Into a from adlete from ainsert assist * from a

4. Delete spaces in the record:

Update table name

Set name = rtrim (Ltrim (Name))

转载请注明原文地址:https://www.9cbs.com/read-124401.html

New Post(0)