Solved

alter a table

Posted on 2002-04-16
1
163 Views
Last Modified: 2010-05-02
I have a table with    col1 int identity
                       col2  nvarchar(500)

How can I programmatically alter the table from int identity to int, and also from int to int identity.
I do not want to use enterprise manager.
Thanks for your response.
0
Comment
Question by:nesifa
1 Comment
 
LVL 2

Accepted Solution

by:
skhorshid earned 20 total points
ID: 6945383
pass the following SQL
--to create a table
create table ##test (id int identity)

--to remove identity from a column
alter table ##test alter column id int

i dont think you can make a column identity after the table is created
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now