SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to insert values into User DefinedTableType
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mohan123
Constraint Violating Yak Guru

India
252 Posts

Posted - 10/16/2012 :  10:11:47  Show Profile  Reply with Quote
Hello all,

i am not able insert values into through store Procedure showing an error
Msg 2756, Level 16, State 1, Procedure usp_HandleException, Line 54
Invalid value 547 for state. Valid range is from 0 to 255.

in Sp side i pass three parameters @i_AppUserId KEYID ,
@i_PatientUserId KEYID ,
@t_tUserMeasure tUserMeasure readonly

in that one is @t_tUserMeasure User DefinedTableType
(MeasureId
MeasureUOMId
MeasureValueText
MeasureValueNumeric
Comments
datetaken
DataSourceid)
and rest of the columns outside :

isPatientAdministered ,
DueDate ,
StatusCode ,
CreatedByUserId,
now i am executing to insert like this

declare @t_tUserMeasure tUserMeasure
insert into @t_tUserMeasure values(1,1,'quantity','Testing','20120720',1)

exec [usp_UserMeasure_MultiInsert]
@i_AppUserId = 23,
@i_PatientUserId = 226650,
@t_tUserMeasure = @t_tUserMeasure

but no result???????

P.V.P.MOhan

webfred
Flowing Fount of Yak Knowledge

Germany
8679 Posts

Posted - 10/16/2012 :  10:24:11  Show Profile  Visit webfred's Homepage  Reply with Quote
What do you say about this?

Invalid value 547 for state. Valid range is from 0 to 255


Too old to Rock'n'Roll too young to die.
Go to Top of Page

mohan123
Constraint Violating Yak Guru

India
252 Posts

Posted - 10/17/2012 :  01:46:48  Show Profile  Reply with Quote
Hey web fred

In table Type defind function i had extra parameter and i gave dummy ID's of reference tables.So thats the reason it shown error after some modifications it worked out well
declare @t_tUserMeasure tUserMeasure
insert into @t_tUserMeasure values(55,1,'quant','Testing','2012-07-20',1)

exec [usp_UserMeasure_MultiInsert]
@i_AppUserId = 23,
@i_PatientUserId = 214559,
@t_tUserMeasure = @t_tUserMeasure


P.V.P.MOhan
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000