日期:2014-05-18 浏览次数:20558 次
USE [JOauth] GO /****** Object: StoredProcedure [dbo].[Query_SapplicationInfoList] Script Date: 04/26/2012 12:32:28 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[Query_SapplicationInfoList]( @startpage INT, --起始行 @endpage INT, --结束行 @uid CHAR(36) --用户ID ) AS DECLARE @strsql VARCHAR(4000) BEGIN SET @strsql = ' SELECT TOP (' + CAST(@endpage AS VARCHAR) + ' - ' + CAST(@startpage AS VARCHAR) + ' + 1)[SAID], [SASid], [SASName], [SACDate], [SAPic], [SACD], [SASType], [SASWebsite], [SALoginwebsite], [SAAudit], [SAvisible], [SAifdelete], [SAServerSecrect], [SAifSysAudit], ui.UserName, ti.Tname FROM SapplicationInfo si, TypeInfo ti, UserInfo ui WHERE si.SASType = ti.TID AND si.SASid = ui.[UID] AND si.SAifdelete = 1 ' IF @uid <> '' BEGIN SET @strsql += ' AND SI.SAifSysAudit = 0 AND si.SAvisible = 1 AND ui.UID=''' + CAST(@uid AS CHAR) + ''' ' END SET @strsql += ' AND si.SAID NOT IN (SELECT TOP(' + CAST(@startpage AS INT) + ' -1) si.[SAID] FROM SapplicationInfo si, TypeInfo ti, UserInfo ui WHERE si.SASType = ti.TID AND ui.UID = si.SASid AND si.SAifdelete = 1 ' IF @uid <> '' BEGIN SET @strsql += ' AND SI.SAifSysAudit = 0 AND si.SAvisible = 1 AND ui.[UID]=''' + CAST(@uid AS CHAR) + ''' ' END SET @strsql += ' ORDER BY SACDate DESC) ORDER BY SACDate DESC ' END PRINT @strsql
--消息 245,级别 16,状态 1,过程 Query_SapplicationInfoList,第 29 行 --在将 varchar 值 ' SELECT TOP (2 - 1 + 1)[SAID], [SASid], [SASName], [SACDate], -- [SAPic], [SACD], [SASType], [SASWebsite], [SALoginwebsite], [SAAudit], -- [SAvisible], [SAifdelete], [SAServerSecrect], [SAifSysAudit], ui.UserName, -- ti.Tname -- FROM SapplicationInfo si, TypeInfo ti, UserInfo ui -- WHERE si.SASType = ti.TID -- AND si.SASid = ui.[UID] -- AND si.SAifdelete = 1 AND SI.SAifSysAudit = 0 AND si.SAvisible = 1 AND ui.UID='ea7ec247-59d2--- 4aa4-ac72-11c601' ' 转换成数据类型 int 时失败。