473,405 Members | 2,415 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

alter colum

print send me a script which alter a column in a table to the same name but with constraint default value as 1
Aug 21 '07 #1
2 1337
debasisdas
8,127 Expert 4TB
as you have posted a question in the articles section it is being moved to SQL Server Forum.

MODERATOR.
Aug 21 '07 #2
ak1dnar
1,584 Expert 1GB
You Can try Like this.

Expand|Select|Wrap|Line Numbers
  1. ALTER TABLE MyTable
  2. ADD CONSTRAINT DF_MyTable_MyColumn
  3. DEFAULT ('default-Value-To-Set')
  4. FOR MyColumn
Aug 21 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Henrik | last post by:
hi how can i hide a row or colum still containing data in a msflexgrid -- Best regards henrik
1
by: bdjensen | last post by:
Hello! I have an MS SQL-server with an database, that runs replication. In this database there is an table with an column i want to extend; varchar(50)->varchar(60). But I get this error (using...
0
by: xiaozozo | last post by:
also, i would like to do some URL tagging with the retrieved colum value such as: http://localhost/PM/message.aspx?id=123 how do i go about writing the url tagging codes? samples will do :...
3
by: Bill Nguyen | last post by:
I found that rows in datagrid can be sorted by clicking on the column header. However, this doesn't refresh the .currentindex DataGrid1.CurrentCell.RowNumber I need either to disable colum...
2
by: RamaKrishna Narla | last post by:
In MS SQL Server, I have the following tables with some data in it. create table table1 ( column1 varchar(32), column2 int not null, column10 varchar(255), ..... primary key (column1,...
0
by: Jet Mah | last post by:
Hi, Mert I want to update the "read_status" colum when reading data, this is my way as below: //...
5
by: mail | last post by:
Urgent help needed! I moved an application from ASP+ACCESS to ASP+MS SQLSERVER and I have the following problem: If the join on two tables results on duplicate colum names (which appear in...
3
by: Bennie | last post by:
My problem is the following: I need to count the number of diffrent letters that were printed for each account. To do this for one value of a colum is easy in the where clause: SELECT Count(.)...
2
by: goyosito | last post by:
I'm working with DB2 ver. 8.x and I'm trying to change the precision of decimal(10) to decimal(20). My script is: ALTER TABLE xyz ALTER COLUMN campo SET DATA TYPE DECIMAL(20, 0); but I got...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.