Re: seeing views in wizard
From: Allan Mitchell (allan_at_no-spam.sqldts.com)
Date: 03/16/04
- Next message: Michas Konstantinos: "Specified filename does not exist"
- Previous message: Alison: "seeing views in wizard"
- In reply to: Alison: "seeing views in wizard"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 16 Mar 2004 07:13:33 -0000
Ok using the wizard OR the designer should be the same so
The problem with views as destinations is that you can only insert into 1
base table. If the view comprises > 1 table then specifying the view as a
whole will not work
The views are not listed in the dropdown but you can cheat and use
disconnected edit to set it for you.
Just remember this rule though
Say I have this structure
CREATE TABLE t1(id int primary key not null, descr varchar(200))
CREATE TABLE t2(id int primary key not null, t1ref int references t1(id))
--Create a view over the top
create view v1
as
select t1.id as id1,t1.descr, t2.id as id2, t2.t1ref from t1 join t2 on
t1.id = t2.t1ref
--If I do this
insert v1
values(1,'Allan',1,1)
--I get this
Server: Msg 4405, Level 16, State 2, Line 1
View or function 'v1' is not updatable because the modification affects
multiple base tables.
--But if I do this
insert v1(id1, descr)
values(1,'Allan')
--it works
-- ---------------------------- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.allisonmitchell.com - Expert SQL Server Consultancy. www.SQLDTS.com - The site for all your DTS needs. I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "Alison" <anonymous@discussions.microsoft.com> wrote in message news:ab8901c40ad5$434cb970$a601280a@phx.gbl... > Hello all, > I think this is a simple question, should I be able to see > the views lited in my dropdown destination list of tables > when importing data. If so is there any simple reasons why > I may not be able to do so? > thanks > alison
- Next message: Michas Konstantinos: "Specified filename does not exist"
- Previous message: Alison: "seeing views in wizard"
- In reply to: Alison: "seeing views in wizard"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|