executing a file that consists of set of sql commands

greenspun.com : LUSENET : SQL Server Database Administration : One Thread

i'm having a file that consists of set of sql commands for example if exists (select..........) drop procedure create procedure ........... i have to execute this is sql server 2000 from visual basic 6.0

if i execute this using connectionobject.execute(above mention entire string) then im getting the error as CREATE PROCEDURE should be the first statement of the query batch. plz try to find the solution for this problem

-- Anonymous, February 02, 2005



Do it as two EXEC statements (one drop the other create). That will give you two batches.

Hope this helps,


-- Anonymous, February 10, 2005

try to read the books related with sql server 20000

-- Anonymous, February 02, 2005

Moderation questions? read the FAQ