Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating a default value via tsql

Status
Not open for further replies.

eja2000

Programmer
Nov 30, 2003
209
NG
i am trying to create a default value for the column activevac using the following tsql;

ALTER TABLE vacancies
alter column activevac nvarchar DEFAULT -1
----------------------------------------
but i keep on getting the following error;

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'DEFAULT'.


Can anyone help please?
thanks.i cannot do it through enterprise manager,only through query analyzer so i need a tsql solution.
 
If this field is going to store numeric data and you will want to do any calculations or sorting onthe numbers, it probaly should have a data type that is numeric and not text oriented.

Questions about posting. See faq183-874
 
i have an inteer field that i want to alter to be an identity field.
how can i do this?
thanks
 
i have an integer field that i want to alter to be an identity field.
how can i do this?
thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top