473,418 Members | 1,605 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

getting error "“Invalid object name 'SizeMst'. “ " while exec sp

Dear All,

I am using sql2005.
i am writing stored procedure to save various master data . I recognize master by @type (input verible) and assign it to @mst veriable then based on @mst no I perform saving task . I created sp . now I am trying to execute then I am getting error
“Invalid object name 'SizeMst'. “ I am running this query from its database.

Stored perocedure is

Alter procedure [dbo].[Sp_RestMst_Save]
@type int ,
@id varchar(20),
@shortdesp varchar(50),
@longdesp varchar(100),
@userid varchar(50),
@ipadd varchar(50)
as
declare @mst int
set @mst = @type

if ( @mst = 1)
begin ;
-- saving data in sizemst

update SizeMst set sshortdesp = @shortdesp , sdesp = @longdesp,smodifiedby = @userid , smodifieddt = getdate() ,ipadd = @ipadd where sizeid = @id;
if(@@rowcount = 0)
insert into SizeMst(sizeid,sshortdesp,sdesp,screatedby,screate ddt,ipadd) values(@id,@shortdesp,@longdesp,@userid, getdate(),@ipadd);


end ;
else
if(@mst = 2)
begin ;
-- saving data in brandMst
update BrandMst set bshortdesp = @shortdesp ,bdesp = @longdesp, bmodifiedby = @userid , bmodifieddt = getdate() ,ipadd = @ipadd where brandid = @id;
if(@@rowcount = 0)
insert into brandMst(brandid,bshortdesp,bdesp,bcreatedby,bcrea teddt,ipadd) values(@id,@shortdesp,@longdesp,@userid, getdate(),@ipadd);

end ;
else
if(@mst = 3)
begin ;
-- saving data in metalktmst
update MetalKtMst set mshortdesp = @shortdesp ,mdesp = @longdesp, mmodifiedby = @userid , mmodifieddt = getdate() ,ipadd = @ipadd where metalktid = @id;
if(@@rowcount = 0)
insert into MetalKtMst(metalktid,mshortdesp,mdesp,mcreatedby,m createddt,ipadd) values(@id,@shortdesp,@longdesp,@userid, getdate(),@ipadd);

end ;







Please guide me in doing so or give me some useful link.
Thanks



regards
imran khan
Jul 7 '07 #1
1 3150
Vidhura
99
Dear All,

I am using sql2005.
i am writing stored procedure to save various master data . I recognize master by @type (input verible) and assign it to @mst veriable then based on @mst no I perform saving task . I created sp . now I am trying to execute then I am getting error
“Invalid object name 'SizeMst'. “ I am running this query from its database.

Stored perocedure is

Alter procedure [dbo].[Sp_RestMst_Save]
@type int ,
@id varchar(20),
@shortdesp varchar(50),
@longdesp varchar(100),
@userid varchar(50),
@ipadd varchar(50)
as
declare @mst int
set @mst = @type

if ( @mst = 1)
begin ;
-- saving data in sizemst

update SizeMst set sshortdesp = @shortdesp , sdesp = @longdesp,smodifiedby = @userid , smodifieddt = getdate() ,ipadd = @ipadd where sizeid = @id;
if(@@rowcount = 0)
insert into SizeMst(sizeid,sshortdesp,sdesp,screatedby,screate ddt,ipadd) values(@id,@shortdesp,@longdesp,@userid, getdate(),@ipadd);


end ;
else
if(@mst = 2)
begin ;
-- saving data in brandMst
update BrandMst set bshortdesp = @shortdesp ,bdesp = @longdesp, bmodifiedby = @userid , bmodifieddt = getdate() ,ipadd = @ipadd where brandid = @id;
if(@@rowcount = 0)
insert into brandMst(brandid,bshortdesp,bdesp,bcreatedby,bcrea teddt,ipadd) values(@id,@shortdesp,@longdesp,@userid, getdate(),@ipadd);

end ;
else
if(@mst = 3)
begin ;
-- saving data in metalktmst
update MetalKtMst set mshortdesp = @shortdesp ,mdesp = @longdesp, mmodifiedby = @userid , mmodifieddt = getdate() ,ipadd = @ipadd where metalktid = @id;
if(@@rowcount = 0)
insert into MetalKtMst(metalktid,mshortdesp,mdesp,mcreatedby,m createddt,ipadd) values(@id,@shortdesp,@longdesp,@userid, getdate(),@ipadd);

end ;







Please guide me in doing so or give me some useful link.
Thanks



regards
imran khan


Invalid object name 'SizeMst'.It means the table is missing in the database.
Check the tablename u given is correct and exist in current database
Jul 9 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: vincent wehren | last post by:
Hi, Trying to grasp Py_NewInterpreter()in a simple app embedding Python, I was wondering why the following gives me an error: int main() { PyThreadState *tstate; Py_Initialize();
3
by: Stephen Poley | last post by:
Could some kind soul explain the errors and warnings that the W3C CSS validator generates for page: http://www.atlis.nl/testsite/nl/ Results at: http://tinyurl.com/5pxqx The error "Invalid...
9
by: Wally | last post by:
I am trying to display images from an Access 2000 database and I get an error "Invalid Parameter Used" when I execute the code line "picBLOB.Image = Image.FromStream(stmBLOBData)" in my Visual...
0
by: Dica | last post by:
i'm getting an error when trying set my dataAdapter's selectCommand. the sqlStatement is a storedProc which takes parameters, so it's constructed as: sqlSelectCommand1.CommandText = ""; ...
0
by: Simon Harris | last post by:
I'm trying to access a password protected web service. My code is as follows: Dim BS7666 As New bs7666.BS7666 'New instance of my web service Dim CredCache As CredentialCache = New...
6
by: Patrick Dugan | last post by:
Hello, I'm trying to load different images (icons) into a PictureBox1.Image. The first image loads just fine, but the second image always returns the error "Invalid property used." It doesn't...
3
by: Arnold | last post by:
I am having problem loading the image from the database. It gives this error: "Invalid parameter used." This is my source code: Private abyt() As Byte Private fo As New OpenFileDialog Private sf...
8
by: lawrence k | last post by:
I've installed Apache 1.3.36 on my Redhat EL 3 machine. Now I'm trying to install PHP 5.1.4. I can not get the ./configure command to work. I keep getting this error: configure: error: Invalid...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.