rgb192
asked on
want to allow null values
want to set
date, orderid, trackingnumber, shipper, cost, void, name,address
to allow null values
(from not null to null)
date, orderid, trackingnumber, shipper, cost, void, name,address
to allow null values
(from not null to null)
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[trackingnumbers](
[trackingnumberid] [int] IDENTITY(1,1) NOT NULL,
[date] [datetime] NOT NULL CONSTRAINT [DF_trackingnumbers_date] DEFAULT (getdate()),
[orderid] [varchar](50) NOT NULL,
[trackingnumber] [varchar](50) NOT NULL,
[shipper] [varchar](10) NOT NULL,
[cost] [decimal](10, 2) NOT NULL,
[void] [varchar](20) NOT NULL,
[name] [varchar](100) NOT NULL,
[address] [varchar](100) NOT NULL,
CONSTRAINT [PK__trackingnumbers__2B3F6F97] PRIMARY KEY CLUSTERED
(
[trackingnumberid] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
trackingnumbers is an existing table
would i do this
ALTER TABLE [dbo].[trackingnumbers] alter column [orderid] [varchar](50) NULL --
for every column
instead copy the current data to a temporary table ... recreate the table and move the data back to the original table
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks
Open in new window