Eventos
31 mar, 23 - 2 abr, 23
Evento de aprendizaje de SQL, Fabric y Power BI más grande. 31 de marzo – 2 de abril. Use el código FABINSIDER para ahorrar $400.
Regístrate hoyEste explorador ya no se admite.
Actualice a Microsoft Edge para aprovechar las características y actualizaciones de seguridad más recientes, y disponer de soporte técnico.
Se aplica a: SQL Server
Azure SQL Database
Azure SQL Managed Instance
Azure Synapse Analytics
Analytics Platform System (PDW)
Punto de conexión de análisis SQL en Microsoft Fabric
Warehouse en Microsoft Fabric
Base de datos SQL de Microsoft Fabric
BREAK sale del bucle WHILE actual. Si el bucle WHILE actual está anidado dentro de otro, BREAK solo sale del bucle actual y se proporciona el control a la siguiente instrucción del bucle exterior.
BREAK suele encontrarse dentro de una instrucción IF.
Imagine una tabla en la que se espera un valor cuando se completa otro proceso antecedente:
WHILE (1=1)
BEGIN
IF EXISTS (SELECT * FROM ##MyTempTable WHERE EventCode = 'Done')
BEGIN
BREAK; -- 'Done' row has finally been inserted and detected, so end this loop.
END
PRINT N'The other process is not yet done.'; -- Re-confirm the non-done status to the console.
WAITFOR DELAY '00:01:30'; -- Sleep for 90 seconds.
END
DECLARE @sleeptimesec int = 1;
DECLARE @startingtime datetime2(2) = getdate();
PRINT N'Sleeping for ' + CAST(@sleeptimesec as varchar(5)) + ' seconds'
WHILE (1=1)
BEGIN
PRINT N'Sleeping.';
PRINT datediff(s, getdate(), @startingtime)
IF datediff(s, getdate(), @startingtime) < -@sleeptimesec
BEGIN
PRINT 'We have finished waiting.';
BREAK;
END
END
Eventos
31 mar, 23 - 2 abr, 23
Evento de aprendizaje de SQL, Fabric y Power BI más grande. 31 de marzo – 2 de abril. Use el código FABINSIDER para ahorrar $400.
Regístrate hoy