有關用程序創建數據庫??(5分)

  • 主题发起人 主题发起人 jesse.zhou
  • 开始时间 开始时间
J

jesse.zhou

Unregistered / Unconfirmed
GUEST, unregistred user!
文本文件如下A.TXT:
IF EXISTS(SELECT * FROM SYSOBJECTS WHERE NAME='AA' AND XTYPE='P')
DROP PROCEDURE AA
GO
IF EXISTS(SELECT * FROM SYSOBJECTS WHERE NAME='A1' AND XTYPE='U')
DROP TABLE A1
GO
CREATE TABLE A1(
AAA INT) ON [PRIMARY]

CREATE PROCEDURE AA
AS
SELECT * FROM A2
GO
程序:
STRPATH:=EXTRACTFILEPATH(PARAMSTR(0))+'/TXT/A.TXT';
ADOQUERY1.Close;
ADOQUERY1.SQL.Clear;
ADOQUERY1.SQL.LoadFromFile(STRPATH);
TRY
ADOQUERY1.ExecSQL;
SHOWMESSAGE('創建成功');
EXCEPT
ON E:EXCEPTION DO
BEGIN
SHOWMESSAGE(E.Message);
RAISE;
END;
END;
1.如像不能用GO
2.如果去掉GO則提示"CREATE PROCEDURE" MUST BE THE FIRST STATEMENT IN A QUERY BATCH"

 
1.Create Procedure (program or manual)
2. Call Procedure.
 
怎麼沒有人幫我?
 

Similar threads

D
回复
0
查看
843
DelphiTeacher的专栏
D
I
回复
0
查看
3K
import
I
后退
顶部