通过sql语句附加数据库与启用sa账户

sqlserver附加数据语句:
EXEC sp_attach_db @dbname = N'AdventureWorks',
@filename1 = N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Data\AdventureWorks_Data.mdf',
@filename2 = N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Data\AdventureWorks_

启用sa账户
ALTER LOGIN sa ENABLE

你可能感兴趣的:(sql语句)