
25/09/2007, 06:39
|
 | Colaborador | | Fecha de Ingreso: diciembre-2004
Mensajes: 1.802
Antigüedad: 20 años, 2 meses Puntos: 38 | |
Re: Select dinamica
Código:
Declare @NuevoValorX as int
Set @strSQL = N'select @nuevoValor = Max(UltimoValor) from ' + @T
EXEC sp_executesql @strSQL, N'@nuevoValor int OUTPUT', @nuevoValor = @NuevoValorX OUTPUT
Set @NuevoValorX = isnull(@NuevoValorX,0) + 1
Exec ('Update Valores set NuevoMaximo = ' + @NuevoValorX + ' where NombreTabla = ''' + @T + '''')
__________________ La sencillez y naturalidad son el supremo y último fin de la cultura...
--
MCTS : SQL Server 2008, .NET Framework 3.5, ASP.NET Applications.
Última edición por Andres95; 25/09/2007 a las 06:40
Razón: Isnull
|