I got a Syntax Error around that double , is there something wrong ? Is that safe to switch to float , but works ?
create proc S_average
(
@dept_id char(10),
@dept_name char(10) OUTPUT,
@dept_avg double OUTPUT
)
AS
select @dept_name = name , @dept_avg = payroll
from dbo.employees
where id = @dept_id;
Thanks !
There is no
doubledatatype in SQL Server. You should be usingfloatin place of that (orrealin earlier versions, but you don’t have a SQL Server version posted).floatdoesn’t have quite the same precision asdoublein C# (again, I’m assuming a .NET language as it isn’t posted) if you are looking to pass values to the application. Butfloatis the closest to C#’sdoubleand almost definitely going to be perfect for your requirement.