Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.
ALTER PROCEDURE [dbo].[L_SelectLastVal_FrmCol] ( @tableName varchar(100) = null, @ColumnName1 varchar(100) = null ) AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; declare @SQL varchar(500) = null -- NONCLUSTERED INDEX [NIX__UNQ__UID_] SET @SQL = 'SELECT TOP 1 ' SET @SQL = @SQL + '[' + @ColumnName1 + ']' + ' FROM [dbo].[' + @tableName + '] ORDER BY ' + '[' + @ColumnName1 + ']' +'DESC' SET @SQL = @SQL EXEC(@SQL) END
ALTER PROCEDURE [dbo].[MEDICAL_FindMaxSPRSpPayReq] AS BEGIN SELECT MAX(SPR#)+1 FROM SIAL_PAT_REQT END
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.