Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 delete and insert in one procedure

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-06-07 : 09:04:46
Lars writes "hi,

i want to import a file into a sql server, but first i want it to be empty, so i call a delete procedure. however when i do that in VB, the table gets empty (which is great!) but then my vb app crashes before i want to insert the file with the insert procedure. is it possible to first empty the table and then insert the data in just one procedure?

here goes my insert procedure:

if exists (select * from sysobjects where id = object_id('dbo.vmtemp_isrt') and sysstat & 0xf = 4)
drop procedure dbo.vmtemp_isrt
GO

create procedure vmtemp_isrt
@naam varchar (34),
@place varchar (24),
@dateofbirth varchar (7),
@license varchar (6),
@address varchar (29),
@postal varchar (6)

as
begin

insert into vmtemp
(naam,
plaats,
geboortedatum,
kenteken,
adres,
postcode)
values (@naam ,
@place ,
@dateofbirth ,
@license,
@address,
@postal)
end
GO

Hope you can help me with this one, thanx in advance

Lars"
   

- Advertisement -