11.4. use SQL statements to change the User Password
Sysadmin role is required to modify other users.
EXEC sp_password NULL, 'newpassword', 'user'
If the account is SA, execute EXEC sp_password NULL, 'newpassword', sa
11.5. How can I determine which fields in a table cannot be blank?
Select COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS where IS_NULLABLE = 'no' and TABLE_NAME = tablename
11.6. How can I find a table with the same fields in the database?
A. query the names of known Columns
SELECT B. name as TableName, a. name as columnname
From syscolumns a inner join sysobjects B
ON a. id = B. id
AND B. type = 'U'
AND a. name = 'your field name'
B. query all the names of unknown columns in different tables.
Select o. name As tablename, s1.name As columnname
From syscolumns s1, sysobjects o
Where s1.id = o. id
And o. type = 'U'
And Exists (
Select 1 From syscolumns s2
Where s1.name = s2.name
And s1.id <> s2.id
)
11.7. query row xxx data
Assume that id is the primary key:
Select *
From (select top xxx * from yourtable) aa
Where not exists (select 1 from (select top XXX-1 * from yourtable) bb where aa. id = bb. id)
You can also use a cursor.
Fetch absolute [number] from [cursor_name]