Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    [sql server] salvare una store procedure

    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

  2. #2
    trovato: CREATE PROCEDURE p_inserimento as

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.