Scripts for MS SQL, sp_attach/sp_detach

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQL Server in Delphi and C++Builder
Post Reply
Goran

Scripts for MS SQL, sp_attach/sp_detach

Post by Goran » Fri 28 Jan 2005 23:09

Hello!
I am searching for all kind of stuff related to execute a script that would do some querys, alter tables etc... and I haven't found anything with dbxpress driver mentioned. Now I am asking if it is possible using any dbxpress component or mybe You are thinking of creating such special component that will allow to execute a script?
Also I have been searching for the way how to execute detach and attach of a database from Delphi 7/2005, especially for archiving the database when user has MSDE instead of MS SQL server. Can You guys help?

Best regards,
Goran

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Re: Scripts for MS SQL, sp_attach/sp_detach

Post by Ikar » Mon 31 Jan 2005 10:30

An ability to execute scripts is put into MS SQL Server syntax. So you can just write a script through ";" and execute it. This method can be used for all scripts except CREATE PROCEDURE - this query always must be the first in the script.

> detach and attach

Try to close a connection, change parameters and re-connect

Post Reply