My create view code like this
create VIEW [dbo].[vw_test]
AS
SELECT 'B' AS rtype, ID FROM TB_A
UNION ALL
SELECT 'V' AS rtype, ID FROM TB_B
GO
How to create a PK with. I need to do full-text search. Tks
My create view code like this
create VIEW [dbo].[vw_test]
AS
SELECT 'B' AS rtype, ID FROM TB_A
UNION ALL
SELECT 'V' AS rtype, ID FROM TB_B
GO
How to create a PK with. I need to do full-text search. Tks
Normally, you could create a unique clustered index on a view, but not an actual primary key constraint. Article here.
However, the SQL in the view contains a UNION so you can't do this.