Silly me I thought this would be a simple thing to do.

I want to set defaults for some fields using a stored procedure.
My testing SP looks like:
------------SP Code------------------------
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE SPTemp
        
AS
BEGIN

ALTER TABLE [dbo].[Contact_tbl]
ALTER COLUMN FirstName DEFAULT 'dddddd'



END
GO
----------------------------------------------
I have tried veriations with and without [] around field name, with and
without SET

These are the errors I am getting:


Msg 156, Level 15, State 1, Procedure SPTemp, Line 8
Incorrect syntax near the keyword 'DEFAULT'.

Using SET:
ALTER TABLE [dbo].[Contact_tbl]
ALTER COLUMN [FirstName] SET DEFAULT 'dddddd'

Msg 156, Level 15, State 1, Procedure SPTemp, Line 8
Incorrect syntax near the keyword 'SET'.

Example from http://technet.microsoft.com/en-us/library/ms174123.aspx
ALTER TABLE MyCustomers ALTER COLUMN CompanyName SET DEFAULT 'A. Datum
Corporation'


Thanks for any help
Rodney

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: http://www.houseoffusion.com/groups/SQL/message.cfm/messageid:2932
Subscription: http://www.houseoffusion.com/groups/SQL/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.6

Reply via email to