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 2008 Forums
 Transact-SQL (2008)
 default constraint value issue

Author  Topic 

movvasqlteam
Starting Member

1 Post

Posted - 2012-03-22 : 01:41:16
Hi All,

I have 2 servers one is centralized and the other one is the normal server from which the data is synced. Please find the query that is used to create the table below.

create table Budget(
LocationID int not null,
Year int not null,
Period tinyint not null,
GLAcct varchar(20) not null,
BudgetDesc varchar(50),
GLGroup smallint not null constraint DF_Budget_GLGroup default (0),
Amount money,
GrossAmount money constraint DF_Budget_GrossAmount default (0),
DiscAmount money constraint DF_Budget_DiscAmount default (0),
ULC varchar(20),
DLC datetime constraint DF_Budget_DLC default (getdate()),

constraint PK_Budget primary key(LocationID,Year,Period,GLAcct)
);
go

Once the above query is run the default value is showing up as ((0)) instead of (0) in the normal server but on the centralized server it is showing up as (0) and due to the difference the data is not getting synced to centralized server. is there any change in the settings of the table or DB that i have to do ? what might be the issue for the value to show up in such a way ? please help in this regard asap..

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2012-03-22 : 06:52:15
what do you mean by "showing up as" ?

Sounds like a presentation layer issue (crystal reports maybe?)









How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2012-03-22 : 14:35:14
The difference in the display of the default value is not significant; the value is still zero. Since you are syncing from the remote site to the centralized server, can I assume that you are supplying this value anyway? If so, the default value doesn't come into play. Can you elaborate on what is going wrong when you attempt to sync the data? (Error occurs? Data is wrong? Everything is set to zero?)

=================================================
It is not so much our friends' help that helps us as the confident knowledge that they will help us. -Epicurus, philosopher (c. 341-270 BCE)
Go to Top of Page
   

- Advertisement -