CREATE PROCEDURE ProcedureName1
@columnsname varchar(50),
@columnsvalue varchar(50)
AS
BEGIN
with cet as
(
Select ID,
names,
Null As address,
work,
note
From Tabl1
Where @columnsname Like @columnsvalue
Union All
Select t2.ID,
t2.name,
t2.address,
Null,
Null As tt
From Tabl2 As t2
Left Join Tabl1 As t1
On t2.ID = t1.ID
Where @columnsname Like @columnsvalue
)
Select *
From cet
Order By id,
note Desc,
cet.address
END GO
答案 0 :(得分:0)
你必须使用动态sql这样的东西。将let myView = Bundle.main.loadNibNamed("MyViewWithLabels", owner: nil, options: nil)![0] as! MyViewWithLabels
的价值列入var brush = new SolidColorBrush(Color.FromRgb(r,g,b));
或@columnsname
的白名单也是一个好主意。
使用sys.columns
继续保留information_schema.columns
作为参数,而不是将其连接到您将要执行的SQL。
sp_executesql
参考: