|
-
Mar 11th, 2004, 09:11 AM
#1
Thread Starter
New Member
Alter Table
Hi,
I'm fairly new to programming with SQL Server database and don't know where to start. Here is my situation. I have a SQL server database and I want to add two new fields to an existing table. Each of the field will have values of either 0 or 1. I want to have a script or procedure to do this? Where would I do this? In the Query Analyzer?
Thanks in advance!
-
Mar 11th, 2004, 09:17 AM
#2
See this example:
VB Code:
BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
ALTER TABLE dbo.T_table ADD
ndRelTandarts bit NULL,
ndSrtRelTandarts bit NULL,
GO
COMMIT
-
Mar 11th, 2004, 11:20 AM
#3
Set statements within a separate transaction???? Interesting!
Just a note: Bit fields cannot be Null.
Query Analyzer can be used to execute your statements.
-
Mar 11th, 2004, 11:27 AM
#4
Frenzied Member
Re: Alter Table
Originally posted by QAnalysis
Hi,
I'm fairly new to programming with SQL Server database and don't know where to start. Here is my situation. I have a SQL server database and I want to add two new fields to an existing table. Each of the field will have values of either 0 or 1. I want to have a script or procedure to do this? Where would I do this? In the Query Analyzer?
Thanks in advance!
In the future, please do not post on multiple boards.
-
Mar 11th, 2004, 11:37 AM
#5
Thread Starter
New Member
How would you set default value of that column to 0 if I use [smallint]? Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|