﻿IF EXISTS(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'charity' AND COLUMN_NAME='name' AND COLUMN_DEFAULT IS NULL)
BEGIN
	ALTER TABLE [CharityData].[charity] ADD DEFAULT '' FOR [name]
END

IF EXISTS(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'charity' AND COLUMN_NAME='nhs' AND COLUMN_DEFAULT IS NULL)
BEGIN
	ALTER TABLE [CharityData].[charity] ADD DEFAULT '' FOR [nhs]
END
﻿IF EXISTS(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'charity' AND COLUMN_NAME='name' AND COLUMN_DEFAULT IS NULL)
BEGIN
	UPDATE charity
	   SET Name = ''
	 WHERE Name IS NULL;
END

IF EXISTS(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'charity' AND COLUMN_NAME='nhs' AND COLUMN_DEFAULT IS NULL)
BEGIN
	UPDATE charity
	   SET nhs = ''
	 WHERE nhs IS NULL;
END


Update switchign to not-nulls for name and nhs on charity
Update switchign to not-nulls for name and nhs on charity
