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
1 3150
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
Sign in to post your reply or Sign up for a free account.
Similar topics
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();
|
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...
|
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...
|
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 = "";
...
|
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...
|
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...
|
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...
|
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...
|
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
|
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...
|
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...
|
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,...
|
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...
|
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,...
|
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...
|
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,...
|
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...
| |