Click here to Skip to main content
15,912,273 members
Home / Discussions / Database
   

Database

 
GeneralRe: Complex SQL View Pin
Dayekh27-Sep-06 3:06
Dayekh27-Sep-06 3:06 
GeneralRe: Complex SQL View Pin
albCode27-Sep-06 3:10
albCode27-Sep-06 3:10 
GeneralRe: Complex SQL View Pin
Dayekh27-Sep-06 3:15
Dayekh27-Sep-06 3:15 
GeneralRe: Complex SQL View Pin
albCode27-Sep-06 3:30
albCode27-Sep-06 3:30 
GeneralRe: Complex SQL View Pin
Dayekh27-Sep-06 3:48
Dayekh27-Sep-06 3:48 
GeneralRe: Complex SQL View Pin
albCode27-Sep-06 3:58
albCode27-Sep-06 3:58 
QuestionInsert Record in Tables Pin
shapper27-Sep-06 1:18
shapper27-Sep-06 1:18 
AnswerRe: Insert Record in Tables Pin
Mike Dimmick27-Sep-06 2:13
Mike Dimmick27-Sep-06 2:13 
An INSERT statement can only target one table.

It is possible to target an INSERT statement to a view in SQL Server if you're prepared to create an INSTEAD OF trigger on the view, but this trigger will have to be coded to perform an INSERT into each table separately.

The general way of handling this is to use the SCOPE_IDENTITY() function to discover the identity value of the last row inserted.

You could consider creating a stored procedure:
CREATE PROC uspInsertWebContentLocalized
(
  @contentName varchar(n),
  @contentPage varchar(n),
  @contentCulture varchar(n),
  @contentHtml varchar(n)
)
AS
INSERT INTO web_Content ( ContentName, ContentPage )
VALUES ( @contentName, @contentPage )

INSERT INTO web_ContentLocalized 
  ( ContentId, ContentCulture, ContentHtml )
VALUES
  ( SCOPE_IDENTITY(), @contentCulture, @contentHtml )


Stability. What an interesting concept. -- Chris Maunder

QuestionHow to search a dataset Pin
Rip Kirby27-Sep-06 0:11
Rip Kirby27-Sep-06 0:11 
AnswerRe: How to search a dataset Pin
Kschuler27-Sep-06 8:41
Kschuler27-Sep-06 8:41 
GeneralRe: How to search a dataset Pin
Rip Kirby27-Sep-06 23:48
Rip Kirby27-Sep-06 23:48 
GeneralRe: How to search a dataset Pin
Kschuler28-Sep-06 3:05
Kschuler28-Sep-06 3:05 
GeneralRe: How to search a dataset Pin
Rip Kirby28-Sep-06 9:25
Rip Kirby28-Sep-06 9:25 
QuestionGetting Maximum number: Pin
Shahzad.Aslam26-Sep-06 23:55
Shahzad.Aslam26-Sep-06 23:55 
AnswerRe: Getting Maximum number: Pin
albCode27-Sep-06 1:02
albCode27-Sep-06 1:02 
AnswerRe: Getting Maximum number: Pin
Rob Graham27-Sep-06 2:27
Rob Graham27-Sep-06 2:27 
AnswerRe: Getting Maximum number: Pin
Eric Dahlvang27-Sep-06 3:40
Eric Dahlvang27-Sep-06 3:40 
QuestionEncrypt in Dotnet and Decrypt in SQL 2000 Pin
Prash.26-Sep-06 21:54
Prash.26-Sep-06 21:54 
QuestionHow to write if i have 3 condition for WHERE? Pin
cheeken2u26-Sep-06 20:21
cheeken2u26-Sep-06 20:21 
AnswerRe: How to write if i have 3 condition for WHERE? Pin
albCode27-Sep-06 4:05
albCode27-Sep-06 4:05 
QuestionIDENT_CURRENT Pin
Polymorpher26-Sep-06 19:15
Polymorpher26-Sep-06 19:15 
QuestionHow to excute parameterized storeprocedure in LinkedServer Pin
Rickey_Me26-Sep-06 18:55
Rickey_Me26-Sep-06 18:55 
QuestionProblem with SELECT query using ADO.NET and C# Pin
Baz26-Sep-06 10:06
Baz26-Sep-06 10:06 
AnswerRe: Problem with SELECT query using ADO.NET and C# Pin
indianet26-Sep-06 10:40
indianet26-Sep-06 10:40 
AnswerRe: Problem with SELECT query using ADO.NET and C# Pin
Rob Graham26-Sep-06 16:27
Rob Graham26-Sep-06 16:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.