Transact-SQL: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Marius~itwiki (discussione | contributi)
tradotto par.
Marius~itwiki (discussione | contributi)
aggiunta
Riga 20:
</pre>
 
<code>BEGIN</code> e <code>END</code> delimitano un blocco di istruzioni. Se più istruzioni devono essere controllate dalle condizioni illustrate nel precedente esempio, si possono usare BEGIN e END in questo modo:
<!--
 
 
<code>BEGIN</code> and <code>END</code> mark a block of statements. If more than one statement is to be controlled by the conditional in the example above, we can use BEGIN and END like this:
 
<pre>
IF DATEPART(dw, GETDATE()) = 7 OR DATEPART(dw, GETDATE()) = 1
BEGIN
PRINT 'ItÉ isun thegiorno weekendfestivo.'
PRINT 'GetPrenditi someun restpo' di riposo!'
END
ELSE
BEGIN
PRINT 'ItÉ isun agiorno weekdayferiale.'
PRINT 'GetVa toa worklavorare!'
END
</pre>
 
 
<!--
 
 
<code>WAITFOR</code> will wait for a given amount of time, or until a particular time of day. The statement can be used for delays or to block execution until the set time.