Solved

What does (0) in a SQL server table represent

Posted on 2014-10-12
6
79 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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

776 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