Click here to Skip to main content
15,889,216 members
Home / Discussions / Database
   

Database

 
AnswerRe: MS SQL Server Trigger help Pin
R. Giskard Reventlov9-Nov-11 3:49
R. Giskard Reventlov9-Nov-11 3:49 
GeneralRe: MS SQL Server Trigger help Pin
eddjusted9-Nov-11 3:56
eddjusted9-Nov-11 3:56 
AnswerRe: MS SQL Server Trigger help Pin
Corporal Agarn9-Nov-11 6:26
professionalCorporal Agarn9-Nov-11 6:26 
QuestionMySQL query help Pin
eddjusted9-Nov-11 3:02
eddjusted9-Nov-11 3:02 
AnswerRe: MySQL query help Pin
Blue_Boy9-Nov-11 3:18
Blue_Boy9-Nov-11 3:18 
GeneralRe: MySQL query help Pin
eddjusted9-Nov-11 3:20
eddjusted9-Nov-11 3:20 
AnswerRe: MySQL query help Pin
Bernhard Hiller9-Nov-11 20:56
Bernhard Hiller9-Nov-11 20:56 
QuestionProblem in query Pin
uspatel8-Nov-11 18:52
professionaluspatel8-Nov-11 18:52 
SQL
ALTER PROCEDURE [dbo].[insert_task_details11]
      @taskname varchar(150),
   @completiondate varchar(30)
  
   
  
AS
BEGIN
DECLARE @DataID int
select DataID=MAX(taskid) from tblTaskAssign;
   insert into tblJobs (taskid,taskname,completiondate) values (DataID,@taskname,@completiondate)
END

I want to insert maximum taskid into tblJobs.
It gives Error The name "DataID" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted.

and if I use @DataId instedat od DataID, null value goes in taskid in tblJobs.

How to solve this problem
thanks
AnswerRe: Problem in query Pin
_Damian S_8-Nov-11 18:59
professional_Damian S_8-Nov-11 18:59 
GeneralRe: Problem in query Pin
uspatel8-Nov-11 19:28
professionaluspatel8-Nov-11 19:28 
AnswerRe: Problem in query Pin
Blue_Boy8-Nov-11 21:36
Blue_Boy8-Nov-11 21:36 
GeneralRe: Problem in query Pin
uspatel9-Nov-11 1:31
professionaluspatel9-Nov-11 1:31 
Questionsaving changes to sqlserver2008 Pin
MalarGayu8-Nov-11 15:41
MalarGayu8-Nov-11 15:41 
AnswerRe: saving changes to sqlserver2008 Pin
_Damian S_8-Nov-11 17:54
professional_Damian S_8-Nov-11 17:54 
AnswerRe: saving changes to sqlserver2008 Pin
uspatel8-Nov-11 19:33
professionaluspatel8-Nov-11 19:33 
AnswerNot Allow Null ? Pin
David Mujica9-Nov-11 3:16
David Mujica9-Nov-11 3:16 
QuestionLesserOf function Pin
PIEBALDconsult8-Nov-11 15:05
mvePIEBALDconsult8-Nov-11 15:05 
AnswerRe: LesserOf function Pin
Andy_L_J8-Nov-11 21:28
Andy_L_J8-Nov-11 21:28 
GeneralRe: LesserOf function Pin
PIEBALDconsult9-Nov-11 1:45
mvePIEBALDconsult9-Nov-11 1:45 
AnswerRe: LesserOf function Pin
Andy_L_J9-Nov-11 7:33
Andy_L_J9-Nov-11 7:33 
AnswerRe: LesserOf function Pin
Jörgen Andersson8-Nov-11 22:50
professionalJörgen Andersson8-Nov-11 22:50 
QuestionAccumulation with multiple conditions Pin
VentsyV8-Nov-11 9:16
VentsyV8-Nov-11 9:16 
AnswerRe: Accumulation with multiple conditions Pin
Jörgen Andersson8-Nov-11 10:05
professionalJörgen Andersson8-Nov-11 10:05 
GeneralRe: Accumulation with multiple conditions Pin
VentsyV8-Nov-11 11:30
VentsyV8-Nov-11 11:30 
GeneralRe: Accumulation with multiple conditions Pin
Jörgen Andersson8-Nov-11 11:54
professionalJörgen Andersson8-Nov-11 11:54 

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.