Click here to Skip to main content
12,447,721 members (57,643 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# SQL
what is the command for insert data into view?
Posted 1-Jan-13 22:33pm
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

hi alirezamilani,

Please check below url for your reference

Views In SQL Server[^]
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

Hi,

Refer the below link to insert data into view.

http://www.java2s.com/Tutorial/SQLServer/0320__View/Insertintoaview.htm[^]
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 4

You task is depend on complexity of the view. If you create a view using single table, you can insert the data using normal insert statement. If you create complex view by joining multiple tables, this is bit hard. You may have to use "INSTEAD OF Triggers"

http://msdn.microsoft.com/en-us/library/ms175521.aspx
  Permalink  
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 5

Hi

You can insert data into view if bellow conditions are ok.
1- your view getting data from table (some view hasn't table in it's background)
2- hole of columns in your view are insert-able
3- your view has not group by in construction
4- another columns in your tables(that your view is construct from they) have default value or are null-able

if upper conditions it's OK for your view you can use from bellow script for this action:

Insert [ServerName].[SchemaName].[ViewName] (FirstColumnName, ...)
Values(FirstColumnValue, ...)
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 7

HI,

Check the following links for your answer.

Insert data into a view (SQL Server)
nserting to a View

Thanks
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Insert x in to blah. It's just a normal insert statement.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 6

Hi,

Insert data directly into respective tables your view get automatically updated.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160811.3 | Last Updated 2 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100