- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
ALTER PROCEDURE [dbo].[spSearch]
@Name nvarchar(256)
AS
BEGIN
SET NOCOUNT ON
DECLARE @qry VARCHAR(MAX)
DECLARE @Where VARCHAR(1000)
SET @Where = '1=1'
IF ISNULL(@Name,'') <> ''
BEGIN
SET @Where = @Where + ' and a.Name = ''' + @Name + ''''
END
SET @Where = @Where + ' and a.Active = 1'
SET @qry ='
select a.* from t_Table1 a
WHERE ' + @Where +
' order by a.Name'
EXECUTE (@qry)
END
Stalker 18.08.2010 14:55 # 0
zheka 18.08.2010 16:22 # 0
a11chemist 25.08.2010 10:15 # 0
ejhi 12.05.2011 11:36 # 0
qweqwe 25.08.2021 10:12 # 0