Solved

What does (0) in a SQL server table represent

Posted on 2014-10-12
6
78 Views
Last Modified: 2014-10-13
I see for the default value in a table (0)... Whats the difference between a default of 0 and (0) ?
0
Comment
Question by:upobDaPlaya
  • 3
  • 2
6 Comments
 
LVL 10

Expert Comment

by:HuaMinChen
ID: 40376222
I think it is having no difference from 0.
0
 
LVL 10

Assisted Solution

by:HuaMinChen
HuaMinChen earned 250 total points
ID: 40376223
It means both are the same.
0
 

Author Comment

by:upobDaPlaya
ID: 40376235
what do you mean by having no difference from 0 ?  thx
0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
LVL 10

Expert Comment

by:HuaMinChen
ID: 40376238
I think you need to bracket 0 in the statement.
0
 
LVL 48

Accepted Solution

by:
PortletPaul earned 250 total points
ID: 40376473
Absolutely no difference, except the syntax being used

This result:
| ID |      DETAILS | A | B | C | D | E | F | G | H |
|----|--------------|---|---|---|---|---|---|---|---|
|  1 | (one) or one | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |

Open in new window

Produce by this DDL:
CREATE TABLE Table1
	(
       id int identity primary key  , details varchar(30)
       
     , [a] float default (0)           , [b] float default 0
     , [c] int default (0)             , [d] int default 0 
     , [e] decimal(12,3)  default (0)  , [f] decimal(12,3) default 0
     , [g] money default (0)           , [h] money default 0
    )
;
	
INSERT INTO Table1
	([details])
VALUES
	('(one) or one')
;

Open in new window

select
*
from table1

Open in new window

http://sqlfiddle.com/#!3/9f048/2
0
 

Author Closing Comment

by:upobDaPlaya
ID: 40379186
Thanks all.  Thanks Porter for the query, that did a great job of demonstrating the issue and answer. Great job !
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now