Click here to Skip to main content
16,013,642 members
Home / Discussions / Database
   

Database

 
AnswerRe: checking the datatype of a column in a table Pin
Arun.Immanuel4-Jun-07 6:53
Arun.Immanuel4-Jun-07 6:53 
AnswerRe: checking the datatype of a column in a table Pin
andyharman4-Jun-07 6:58
professionalandyharman4-Jun-07 6:58 
QuestionVeeeeeeeeeery slow queries in MS SQL 2005 Pin
3fonov4-Jun-07 3:51
3fonov4-Jun-07 3:51 
QuestionRe: Veeeeeeeeeery slow queries in MS SQL 2005 Pin
andyharman4-Jun-07 6:13
professionalandyharman4-Jun-07 6:13 
AnswerRe: Veeeeeeeeeery slow queries in MS SQL 2005 Pin
3fonov4-Jun-07 7:01
3fonov4-Jun-07 7:01 
GeneralRe: Veeeeeeeeeery slow queries in MS SQL 2005 Pin
andyharman4-Jun-07 7:28
professionalandyharman4-Jun-07 7:28 
GeneralRe: Veeeeeeeeeery slow queries in MS SQL 2005 Pin
3fonov4-Jun-07 22:52
3fonov4-Jun-07 22:52 
AnswerRe: Veeeeeeeeeery slow queries in MS SQL 2005 Pin
Pete O'Hanlon4-Jun-07 23:30
mvePete O'Hanlon4-Jun-07 23:30 
First of all, is source_id an autoincrement column? If it is, don't reselect it - use the Scope_Identity() function to retrieve it in your insert, e.g.
INSERT INTO sources
(internal_id, parent_id, updated, sstate, title, rng, course, speed, stype,lat,lon)
VALUES
(@internal_id, @parent_id, getutcdate(), @sstate, @title, @rng, @course, @speed, @stype, @lat*100000000, @lon*10000000);
SET @source_id = SCOPE_IDENTITY()
If it's a uniqueidentifier column, select the GUID yourself and then insert it as part of the insert statement.

Secondly, why are you performing the SELECT @state = select in the update portion? I can't see anywhere that you are using this in your procedure.

Third, you are performing a calculation in your query. I would consider either moving it outside the query, or using a computed column in the table.

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

QuestionRe: Veeeeeeeeeery slow queries in MS SQL 2005 Pin
3fonov4-Jun-07 23:51
3fonov4-Jun-07 23:51 
Questionmicrosoft access 2000 Pin
villaa4-Jun-07 3:05
villaa4-Jun-07 3:05 
AnswerRe: microsoft access 2000 Pin
Rob Graham4-Jun-07 5:03
Rob Graham4-Jun-07 5:03 
Questionhow to add the picture or movie into the table Pin
ganesamoorthidhayalan4-Jun-07 2:15
ganesamoorthidhayalan4-Jun-07 2:15 
AnswerRe: how to add the picture or movie into the table Pin
Colin Angus Mackay4-Jun-07 2:39
Colin Angus Mackay4-Jun-07 2:39 
AnswerRe: how to add the picture or movie into the table Pin
Giorgi Dalakishvili4-Jun-07 5:41
mentorGiorgi Dalakishvili4-Jun-07 5:41 
Questionwhat is the cursor? Pin
saravanan053-Jun-07 23:13
saravanan053-Jun-07 23:13 
AnswerRe: what is the cursor? Pin
originSH3-Jun-07 23:25
originSH3-Jun-07 23:25 
AnswerRe: what is the cursor? Pin
ganesamoorthidhayalan4-Jun-07 2:20
ganesamoorthidhayalan4-Jun-07 2:20 
AnswerHomework alert Pin
leckey4-Jun-07 4:06
leckey4-Jun-07 4:06 
GeneralRe: Homework alert Pin
originSH4-Jun-07 5:19
originSH4-Jun-07 5:19 
GeneralRe: Homework alert Pin
leckey4-Jun-07 9:55
leckey4-Jun-07 9:55 
QuestionSQL 2000 Reporting Services - Blank pages while rendering matrix in PDF format Pin
Ravindranath Kini3-Jun-07 19:07
Ravindranath Kini3-Jun-07 19:07 
QuestionDTS Package..?? Pin
Xandip3-Jun-07 17:23
Xandip3-Jun-07 17:23 
QuestionBasic SQL question Pin
eggie53-Jun-07 14:42
eggie53-Jun-07 14:42 
AnswerRe: Basic SQL question Pin
Arun.Immanuel3-Jun-07 14:51
Arun.Immanuel3-Jun-07 14:51 
AnswerRe: Basic SQL question Pin
Christian Graus3-Jun-07 14:53
protectorChristian Graus3-Jun-07 14:53 

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.