当我在存储过程中写一列时显示错误.. [英] when i write a column in store procedure it shows error..
本文介绍了当我在存储过程中写一列时显示错误..的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我的查询
here is my query
ALTER PROCEDURE [dbo].[selectDataByDDLValue](@ddlValue varchar(50))
AS
IF @ddlValue = 1
BEGIN
select distinct Fname,Lname from Client_registration_tbl
END
ELSE
BEGIN
IF @ddlValue = 2
BEGIN
select a.Fname,a.Lname, b.Product_name,b.Product_quan,b.Delivery_date from Client_registration_tbl a , Product_order b where a.Uname= b.Uname
END
ELSE
BEGIN
select a.Fname,a.Lname, b.Product_name,b.Product_quan,b.Delivery_date,b.Extend_date from Client_registration_tbl a , Product_order b where a.Uname= b.Uname
END
END
我想写一个列名来代替1和2.....我该怎么办
i want to write a column name in place of 1 and 2.....how can i do
推荐答案
ALTER PROCEDURE [dbo].[selectDataByDDLValue](@ddlValue varchar(50))
AS
IF @ddlValue = 'Uname'
BEGIN
select distinct Fname,Lname from Client_registration_tbl
END
ELSE
BEGIN
IF @ddlValue = 'Delivery_Date'
BEGIN
select a.Fname,a.Lname, b.Product_name,b.Product_quan,b.Delivery_date from Client_registration_tbl a , Product_order b where a.Uname= b.Uname
END
ELSE
BEGIN
select a.Fname,a.Lname, b.Product_name,b.Product_quan,b.Delivery_date,b.Extend_date from Client_registration_tbl a , Product_order b where a.Uname= b.Uname
END
END
祝您编码愉快!
:)
Happy Coding!
:)
这篇关于当我在存储过程中写一列时显示错误..的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文