This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
1. Connect to MS SQL Server. 2. Rightclick "person" table and choose "View Data...". 3. Press "Insert a record." buuton. 4. Specify all parameters and enter for "lastupdated" field (data type binary) '0000000000000000000000000000000000000000000000000001000000001000' (I took this value from INSERT script for another row). 5. Click "Show SQL". Script is shown and no error is shown. 6. Press OK. Result: Exception message appears and nothing is inserted. Look at message in attach.
Created attachment 68357 [details] Screenshot of a exception message.
Can you send me create script for person table with some sample data. BTW, why lastupdated is binary?
Ahi, I've sent you an email.
Here is what SQL Server Books Online says about it: The SQL Server timestamp data type has nothing to do with times or dates. SQL Server timestamps are binary numbers that indicate the relative sequence in which data modifications took place in a database. The timestamp data type was originally implemented to support the SQL Server recovery algorithms. ... Never use timestamp columns in keys, especially primary keys, because the timestamp value changes every time the row is modified. How did you create the table? anyway we need to handle this somehow.
A Transact-SQL timestamp != an ANSI SQL-92 timestamp. If its a SQL style timestamp you are after use a datetime data type. A T-SQL timestamp are just auto generated binary numbers guarenteed to be unique in the context of a database and are typically used for versioning, not storing dates. The SQL Server timestamp type is a JDBC BINARY type with the fixed length of 8 bytes. Given this, I think I can mark the as auto_generated if its binary and the size is 8.
This DB was created much time ago and actually I don't remember how it was created. I think script for MySQL or Java DB was used and in it TIMESTAMP was used (which were converted by MS SQL Server to BINARY).
One should use datetime instead of timestamp for SQL Server.
http://hg.netbeans.org/main/rev/e034aa6ae5df Since the SQL SERVER TimeStamp value is generated, I have marking as generated. Displaying the binary data as 0s and 1s has a diff issues, I will look into them separately. The INSERT should work now. As I said earlier, if you would like to store a date, then use SQL SERVER DateTime datatype, not timestamp.
Verified with build 080829.
Integrated into 'main-golden', available in build *200808300201* on http://bits.netbeans.org/dev/nightly/ Changeset: http://hg.netbeans.org/main/rev/e034aa6ae5df User: ahimanikya@netbeans.org Log: #145191 Value from INSERT script isn't valid for "Insert Record" dialog