SQL Coding Naming convention: Variable same name as Columns

by LakeFish84   Last Updated July 11, 2018 22:05 PM

Is there a coding naming convention principal for SQL variables? Can variables be named the same as column names, I heard in different companies, this may cause confusion. However in C# below, its a generally accepted principle, resource below.

create table dbo.Product
( 
    ProductId int primary key null,
    ProductName varchar(25) not null,
    ProductDescription varchar(255) not null
)


create procedure dbo.ProductNameUpdate 
@ProductId int, @ProductName varchar(255)
as

update dbo.Product
set 
ProductName = @ProductName
where ProductId = @ProductId 

https://msdn.microsoft.com/en-us/library/ms229060(v=vs.100).aspx https://www.dotnetperls.com/constructor

public Product(int ProductId, int ProductName)
        {
            this.ProductId= ProductId;
            this.ProductName= ProductName;
        }


Related Questions


Method naming: to vs as vs get

Updated April 25, 2018 02:05 AM


Why do software use Win32 name?

Updated August 29, 2017 12:05 PM

C# - Why are prefixes on fields discouraged?

Updated June 14, 2017 21:05 PM

Writing readable code and not overdoing it with naming

Updated December 05, 2017 13:05 PM