Author |
Topic |
Bennov
Starting Member
5 Posts |
Posted - 2008-10-06 : 14:36:12
|
I have a very strange problem. Suddenly the 'default value' option in SQL server doesn't work properly anymore. I have two the same databases, one on a SQL 2005 server and one on a SQL 2000 server. In a table I have some fields with default value (0). As far as I know this always worked fine. Now, when I add a record all these fields get TRUE as default value. I added a new field with exactly the same properties in the middle. This one also doesn't work properly. When I move the field to the last position it seems to work fine. But when I add a record through a standard form it goes wrong again. After trying a lot of thinks I just created a new table with only 2 fields ('Number' (primary key) and 'Ready' (bit, with standard value = (0).I now add the first record: this works fine, the default value of the field 'Ready' changed automatically to FALSE. I now add the second record: here it goes wrong again! The default value for the field 'Ready' for this record changed to TRUE!!I use this kind of values for years now and it always worked fine. The strange thing is that it happens to two different SQL servers of two different companies in two different cities.Can anyone help?Thanks in advance! |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
Bennov
Starting Member
5 Posts |
Posted - 2008-10-06 : 14:46:43
|
Here is the create table:USE [VerhregBV]GO/****** Object: Table [dbo].[Testtable] Script Date: 10/06/2008 20:43:20 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOCREATE TABLE [dbo].[Testtable]( [Number] [nvarchar](50) NOT NULL, [Ready] [bit] NOT NULL CONSTRAINT [DF_Testtable_Ready] DEFAULT ((0)), CONSTRAINT [PK_Testtable] PRIMARY KEY CLUSTERED ( [Number] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY]And here the results of the first 4 records I just typed in through the Access ADP file without entering the 'ready' column:(Waar=True, Onwaar=False)Number Ready34 Waar333 Onwaar444 Waar666 Waar |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
Bennov
Starting Member
5 Posts |
Posted - 2008-10-06 : 14:57:52
|
Wow! Strange, but that works OK. I added a couple of new records now and it goes great. Seems like an Access problem probably..?In Access I open the table on the same way as in SQL Server (right click -> open table). I just navigate to the last record and keep on adding data. In SQL server this also works great!Pffff, I will keep on searching in Access. Thanks for your help so far!! |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
Bennov
Starting Member
5 Posts |
Posted - 2008-10-06 : 15:57:14
|
Thanks for the tip. I posted this in a Access forum also now. Because it goes wrong without use of any code they point to sql server. Because opening the table and entering data in the table goes 'hard' into the database, they say....I think I stop using default values and fill them by code. |
|
|
Bennov
Starting Member
5 Posts |
Posted - 2008-10-08 : 02:12:34
|
Problem happens after install of SP3 for Office 2003. Microsoft already released a hotfix! |
|
|
|