Click here to Skip to main content
15,919,434 members
Home / Discussions / Database
   

Database

 
QuestionUnexpected existing transaction --> error Pin
Jagadeesh Jupalli12-Aug-07 23:14
Jagadeesh Jupalli12-Aug-07 23:14 
AnswerRe: Unexpected existing transaction --> error Pin
andyharman13-Aug-07 4:29
professionalandyharman13-Aug-07 4:29 
GeneralRe: Unexpected existing transaction --> error Pin
Jagadeesh Jupalli13-Aug-07 8:08
Jagadeesh Jupalli13-Aug-07 8:08 
Questionhow to generate autonumber in ceratin sequence Pin
biswa4712-Aug-07 22:11
biswa4712-Aug-07 22:11 
AnswerRe: how to generate autonumber in ceratin sequence Pin
Blue_Boy12-Aug-07 23:53
Blue_Boy12-Aug-07 23:53 
QuestionIF EXISTS? Pin
Illegal Operation12-Aug-07 21:16
Illegal Operation12-Aug-07 21:16 
AnswerRe: IF EXISTS? Pin
Blue_Boy12-Aug-07 21:29
Blue_Boy12-Aug-07 21:29 
AnswerRe: IF EXISTS? Pin
Pete O'Hanlon12-Aug-07 22:31
mvePete O'Hanlon12-Aug-07 22:31 
One way to do this would be:
DECLARE @FID INT
DECLARE @LID INT

SET NOCOUNT ON

SELECT @FID = [ID] FROM FirstNames WHERE FirstName = 'Fritz'

IF @FID IS NULL
BEGIN
  INSERT INTO FirstNames(FirstName) VALUES ('Fritz')
  SET @FID = Scope_Identity()
END

SELECT @LID = [ID] FROM LastNames WHERE LastName = 'Blignaut'

IF @LID IS NULL
BEGIN
  INSERT INTO LastNames(LastName) VALUES ('Blignaut')
  SET @LID = Scope_Identity()
END

INSERT INTO Users VALUES (@FID, @LID)
Are you sure that you really want to normalize down to this level? You are going to be doing an awful lot of looking up on information which is going to be wasteful in system processing terms.

Deja View - the feeling that you've seen this post before.

QuestionMap one table to another in MSSQL Pin
big_nige12-Aug-07 11:25
big_nige12-Aug-07 11:25 
AnswerRe: Map one table to another in MSSQL Pin
Colin Angus Mackay12-Aug-07 12:01
Colin Angus Mackay12-Aug-07 12:01 
GeneralRe: Map one table to another in MSSQL Pin
big_nige12-Aug-07 12:30
big_nige12-Aug-07 12:30 
GeneralRe: Map one table to another in MSSQL Pin
Colin Angus Mackay12-Aug-07 14:21
Colin Angus Mackay12-Aug-07 14:21 
GeneralRe: Map one table to another in MSSQL Pin
big_nige12-Aug-07 14:55
big_nige12-Aug-07 14:55 
GeneralRe: Map one table to another in MSSQL Pin
big_nige14-Aug-07 12:18
big_nige14-Aug-07 12:18 
QuestionVista & SQL Server Pin
mehrdadc4812-Aug-07 7:46
mehrdadc4812-Aug-07 7:46 
AnswerRe: Vista & SQL Server Pin
Colin Angus Mackay12-Aug-07 12:01
Colin Angus Mackay12-Aug-07 12:01 
AnswerRe: Vista & SQL Server Pin
Russell Jones13-Aug-07 5:57
Russell Jones13-Aug-07 5:57 
Questionsql server ce Pin
sivadomacha12-Aug-07 6:31
sivadomacha12-Aug-07 6:31 
QuestionAttach Database sql server 2000 Pin
Rami Said Abd Alhalim12-Aug-07 5:19
Rami Said Abd Alhalim12-Aug-07 5:19 
AnswerRe: Attach Database sql server 2000 Pin
Paul Conrad12-Aug-07 6:24
professionalPaul Conrad12-Aug-07 6:24 
AnswerRe: Attach Database sql server 2000 Pin
Nouman Bhatti12-Aug-07 21:28
Nouman Bhatti12-Aug-07 21:28 
QuestionAdd/Update error Pin
Shaimmaa12-Aug-07 1:17
Shaimmaa12-Aug-07 1:17 
AnswerRe: Add/Update error Pin
Colin Angus Mackay12-Aug-07 3:51
Colin Angus Mackay12-Aug-07 3:51 
Questionprocedure or function "procedure name" has too many argument specified Pin
isiran12-Aug-07 0:35
isiran12-Aug-07 0:35 
AnswerRe: procedure or function "procedure name" has too many argument specified Pin
Colin Angus Mackay12-Aug-07 3:50
Colin Angus Mackay12-Aug-07 3:50 

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.