Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Using quotes for numeric values

Author  Topic 

Razzle00
Starting Member

35 Posts

Posted - 2007-03-19 : 09:48:39
Hi,

I realize that you do not need to use quotes when passing values that are numeric in SQL server. However, could it cause problems? Or dosen't it really matter if you have used them. For example:

UPDATE MyTable SET MyDecimalFld = '123.4321'
UPDATE MyTable SET MyIntegerFld = '456'

vs.

UPDATE MyTable SET MyDecimalFld = 123.4321
UPDATE MyTable SET MyIntegerFld = 456

Will the results always be the same in your update. Or could it be potentially dangerous to use the quotes?

Thanks,

Razzle


SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-03-19 : 10:22:42
I don't think so. But SQL Server has to do a conversion, so that is one step more than necessary.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -