想要在SQL Server中看到每个列名及其值的插入数据,我正在使用INSERT / UPDATE
这样的存储过程。
例如,mode ='insert':
Insert into Employee_table(Name, Age, DOB, salary)
values (@Name, @Age, @DOB, @salary)
现在我希望看到:
insert into Employee_table(Name, Age, DOB, salary)
values ('Arun', 23, 12-12-2016, 10000)
答案 0 :(得分:0)
SQL Server直接不提供任何UI来捕获所有DML / DDL操作的实时值。但是,这可以解决,如下所示,
答案 1 :(得分:0)
对我来说很奇怪,但我想你可以试试:
Insert into Employee_table(Name, Age, DOB, salary)
OUTPUT inserted.*
values (@Name, @Age, @DOB, @salary)
答案 2 :(得分:-1)
Try this.
Create Procedure Proc_Insert_Employee_Table
(
@Name varchar(50),
@Age int,
@DOB date,
@salary int
)
as
Begin
set nocount on
Insert into Employee_table(Name, Age, DOB, salary)
values (@Name, @Age, @DOB, @salary)
print 'Insert into Employee_table(Name, Age, DOB, salary)
values ('+@Name+','+cast(@Age as varchar)+','+cast(@DOB as varchar)+','+cast(@salary as varchar)+')'
END