通过数据库文件建立数据的方法(mssql2000)
USE master;
GO
CREATE DATABASE [CSharpDB] ON PRIMARY
(FILENAME = 'C:\CShap\dbfile\CSharpDB_Data.MDF')
LOG ON (FILENAME = 'C:\CShap\dbfile\CSharpDB_Log.LDF')
FOR ATTACH;
GO
USE master;
GO
CREATE DATABASE [CSharpDB] ON PRIMARY
(FILENAME = 'C:\CShap\dbfile\CSharpDB_Data.MDF')
LOG ON (FILENAME = 'C:\CShap\dbfile\CSharpDB_Log.LDF')
FOR ATTACH;
GO