dbTalk Databases Forums  

Set default in sql server

microsoft.public.sqlserver.clients microsoft.public.sqlserver.clients


Discuss Set default in sql server in the microsoft.public.sqlserver.clients forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Deep
 
Posts: n/a

Default Set default in sql server - 06-17-2009 , 05:51 AM






Dear Sir/Madam

Can you tell me how to set default column in sql server using query
and how to change it.

I am using this query.

ALTER TABLE category
ALTER COLUMN position SET DEFAULT 'OLD'

but it is giving error
Incorrect syntax near the keyword 'SET'.

please help me
Thanks in advance

Reply With Quote
  #2  
Old   
Andrew J. Kelly
 
Posts: n/a

Default Re: Set default in sql server - 06-17-2009 , 08:39 AM






ALTER TABLE [category] ADD CONSTRAINT [DF_category_position] DEFAULT 'OLD'
FOR [position]



--
Andrew J. Kelly SQL MVP
Solid Quality Mentors


"Deep" <vinodkus (AT) gmail (DOT) com> wrote

Quote:
Dear Sir/Madam

Can you tell me how to set default column in sql server using query
and how to change it.

I am using this query.

ALTER TABLE category
ALTER COLUMN position SET DEFAULT 'OLD'

but it is giving error
Incorrect syntax near the keyword 'SET'.

please help me
Thanks in advance

Reply With Quote
Reply




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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.