TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sudharani G
NA
19
710
While craeting 2nd table with foreign key getting an error?
Sep 1 2015 8:39 AM
CREATE TABLE [dbo].[tbl_AddItems](
[id] [int] IDENTITY(1,1) NOT NULL,
[ProductId] AS ('SHPLT'+right('0000'+CONVERT([varchar](10),[ID],(0)),(4)))PERSISTED NOT NULL,
CONSTRAINT PK_ProductId PRIMARY KEY CLUSTERED(ProductId),
[ProductCategory] [varchar](20) NULL,
[ProductName] [varchar](30) NULL,
[Price] [decimal](6, 2) NULL,
[ProductCode] [varchar](20) NULL,
[Descriptions] [varchar](max) NULL,
[Stock] [int] NULL,
[Discount] [int] NULL
)
CREATE TABLE [dbo].[tbl_AddImages]
(
[Id] INT IDENTITY(1,1) NOT NULL,
[ProductId] AS ('SHPLT'+right('0000'+CONVERT([varchar](10),[ID],(0)),(4)))PERSISTED NOT NULL,
CONSTRAINT [FK_ProductId] FOREIGN KEY([ProductId]) REFERENCES [tbl_AddItems] ([ProductId]),
[ImgId] [varchar](20) NULL,
[ImgPath] [varchar](100) NULL
)
here getting an error while creating tbl_AddItems
"
CREATE TABLE failed because the following SET options have incorrect settings: 'ANSI_PADDING'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or filtered indexes and/or query notifications and/or XML data type methods and/or spatial index operations.
"
Can anyone help me?
Reply
Answers (
2
)
how to combine multiple select statements in stored proc
Search Result stored procedure