|
--test environment
create table tbnote_check_order
(
f_djlxbm varchar (3) Not Null, --document type encoding
f_xh int Not Null,-
f_bmbm varchar (15) Not Null,-department code
f_must int Not Null, --must (0 no 1 yes)
Constraint tbnote_check_order_key Primary Key (f_djlxbm, f_xh)
)
insert into tbnote_check_order
select 'abc', 1, '001', 1 union all
select 'abc', 2, '002', 0 union all
select 'abc', 3, '004', 1
declare @c int
exec p_SpIsOver 'abc', '| linebegin | haha2007-1-1 | bmbegin | 001 | bmend | hehe123 | ygbmbegin | 001 | ygbmend | sdjklsd | lineend |', @ c out
select @c
--result
0
declare @c int
exec p_SpIsOver 'abc', '| linebegin | haha2007-1-1 | bmbegin | 001 | bmend | hehe123 | ygbmbegin | 001 | ygbmend | sdjklsd | lineend |
| linebegin | haha2007-2-1 | bmbegin | 004 | bmend | hehe123 | ygbmbegin | 001 | ygbmend | sdjkfddfdfssfdlsd | lineend |
', @ c out
select @c
--result
1
declare @c int
exec p_SpIsOver 'abc', '| linebegin | haha2007-1-1 | bmbegin | 001 | bmend | hehe123 | ygbmbegin | 001 | ygbmend | sdjklsd | lineend |
| linebegin | haha2007-2-1 | bmbegin | 002 | bmend | hehe123 | ygbmbegin | 001 | ygbmend | sdjkfddfdfssfdlsd | lineend |
', @ c out
select @c
--result
0
declare @c int
exec p_SpIsOver 'abc', '| linebegin | haha2007-1-1 | bmbegin | 001 | bmend | hehe123 | ygbmbegin | 001 | ygbmend | sdjklsd | lineend |
| linebegin | haha2007-2-1 | bmbegin | 002 | bmend | hehe123 | ygbmbegin | 001 | ygbmend | sdjkfddfdfssfdlsd | lineend |
| linebegin | haha2007-2-1 | bmbegin | 004 | bmend | hehe123 | ygbmbegin | 001 | ygbmend | sdjkfddfdfssfdlsd | lineend |
', @ c out
select @c
--result
1 |
|