MySQL (CAPI) VC instance and Code Download (1) (5 ). 11.4. use SQL statements to change users' passwords. sysadminroleEXECsp_passwordNULL and newpassword are required. if the account is SA, EXECsp_passwordNULL and newpas, use SQL statements to change users' passwords.
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]
Http://www.bkjia.com/PHPjc/630996.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/630996.htmlTechArticle11.4. if you use an SQL statement to change the password of another User, sysadmin role EXEC sp_password NULL, 'newpassword', and 'user' is required. if the account is SA, execute EXEC sp_password NULL, 'newpas...