che codice devo aggiungere per salvare questi comandi in una store
procedure (esempio p_inserimento) da richiamare??
grazie
DECLARE @AuthorLName varchar(40)
DECLARE @AuthorCity varchar(410)
DECLARE #AuthorsCursor CURSOR FOR
SELECT au_lname, city
FROM pubs.dbo.authors where contract in (select id from
tabella_esterna_prova)
ORDER BY
au_lname
OPEN #AuthorsCursor
FETCH NEXT FROM #AuthorsCursor
INTO @AuthorLName, @AuthorCity
WHILE @@FETCH_STATUS = 0
BEGIN
insert into tabella_inserimento_prova (nome, citta) values
(@AuthorLName,@AuthorCity)
PRINT @AuthorLName
PRINT @AuthorCity
PRINT '-------------------'
FETCH NEXT FROM #AuthorsCursor
INTO @AuthorLName, @AuthorCity
END
CLOSE #AuthorsCursor
DEALLOCATE #AuthorsCursor