Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 03-28-2009, 03:05 PM   #1 (permalink)
 
Junior Techie

Join Date: Nov 2008

Posts: 79

BobLewiston is on a distinguished road

Default PasswordHash NULL problem

When I try to save a new (inserted) record in an SQL database, I get the following System.Runtime.InteropServices.ExternalException message:

Quote:
Cannot insert the value NULL into column 'PasswordHash', table 'AdventureWorks.Person.Contact'; column does not allow nulls.
INSERT fails.
The statement has been terminated.
I have to either find out how to insert an appropriate value into the PasswordHash column OR make SQL Server Management Studio allow NULL in the PasswordHash column.

I discovered I could do the latter in SQL Server Management Studio via:

expand table | expand Columns | right-click PasswordHash column | click Modify | in lower right frame: toggle Allow Nulls from No to Yes

On doing so and then attempting to exit SQL Server Management Studio, I got a dialog box saying:

Quote:
Save changes to the following items?
SQL Server Objects
<Server name>.AdventureWorks - Person.Contact
Clicking Yes elicited the following message:

Quote:
Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that can't be re-created or enabled the option Prevent saving changes that require the table to be re-created.

Contact (Person)
SQL Server Management Studio's onboard Help says I can override the "Prevent saving changes that require the table to be re-created" setting via:

Tools | Options | Designers | Table and Database Designers | Prevent saving changes that require table re-creation

I can try this, but I wonder if it might be dangerous. If for whatever reason the table can't be re-created, could I possibly destroy the original table in the process and then have to reinstall the AdventureWorks database? I don't want to have to do that, since for some unknown reason I had a very difficult time installing it the first time.

And ultimately, I don't want to sacrifice encryption, as I suspect might be the case if I allowed PasswordHash to be NULL.

So here are my two questions:
1. Could it be dangerous to try to re-create the table?
2. How do I get an appropriate value to put in the PasswordHash column?

For what it's worth, I'm working in a 32-bit environment with the following software:

SQL Server 2008 Express with Advanced Services
database: SQL2008 AdventureWorks (schema.table: Person.Contact)
SQL Server 2008 Management Studio Express
Visual C# 2008 Express
BobLewiston is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem installing software in windows xp pro imagesmith Windows Operating Systems and Software 3 02-20-2008 02:46 PM
Serious computer problem. HeeRoMaKi Hardware Troubleshooting 71 07-28-2007 11:42 PM
Wireless Problem! dropper Computer Networking & Internet Access 3 07-08-2007 04:58 PM
Dhcp leasing problem Kloppstock Computer Networking & Internet Access 12 05-13-2007 07:13 PM
cant find the problem... Jhill1 Hardware Troubleshooting 13 05-07-2007 04:51 PM