473,378 Members | 1,427 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,378 software developers and data experts.

type difference

Hi,

I am tryind to delete from a table using a Stored Procedure, but I don't
know how to do the following:

The DELETE STATEMENT must be:

DELETE FROM MESSAGES
WHERE MSSGID IN (@MSGIDS)

The problem is that @MSGIDS always is something like this:
1,3,5,7,11,12. It's VARCHAR parameter. The problem is that MSSGID is the
Primary key and it is INT. How could be solved this problem?

Thank you in advance!

Viktor
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.754 / Virus Database: 504 - Release Date: 06.9.2004 a.
Nov 16 '05 #1
2 1189
create the param by concatenating the id's:

string param = id1+","+id2+","+id3;

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk
"Viktor Popov" <vi****@yahoo.com> schrieb im Newsbeitrag
news:#F**************@TK2MSFTNGP09.phx.gbl...
Hi,

I am tryind to delete from a table using a Stored Procedure, but I don't
know how to do the following:

The DELETE STATEMENT must be:

DELETE FROM MESSAGES
WHERE MSSGID IN (@MSGIDS)

The problem is that @MSGIDS always is something like this:
1,3,5,7,11,12. It's VARCHAR parameter. The problem is that MSSGID is the
Primary key and it is INT. How could be solved this problem?

Thank you in advance!

Viktor
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.754 / Virus Database: 504 - Release Date: 06.9.2004 a.

Nov 16 '05 #2
Hi Viktor,
It looks like you need something like the Javascript Eval() function,
rather than getting the correct type.

You could pass the string as usual and then split it in SQL-Server and
store it in a temporary table. Take a look at this article:
http://www.winnetmag.com/SQLServer/A...071/21071.html

/Hugo

On Thu, 9 Sep 2004 10:09:26 +0300, Viktor Popov wrote:
From: Viktor Popov <vi****@yahoo.com>
Subject: type difference
Date: Thu, 9 Sep 2004 10:09:26 +0300
Lines: 25
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2741.2600
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2742.200
Message-ID: <#F**************@TK2MSFTNGP09.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.csharp
NNTP-Posting-Host: 212-104-102-239.cable.evrocom.net 212.104.102.239
Path: TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
Xref: TK2MSFTNGP08.phx.gbl microsoft.public.dotnet.languages.csharp:273618

Hi,

I am tryind to delete from a table using a Stored Procedure, but I don't
know how to do the following:

The DELETE STATEMENT must be:

DELETE FROM MESSAGES
WHERE MSSGID IN (@MSGIDS)

The problem is that @MSGIDS always is something like this:
1,3,5,7,11,12. It's VARCHAR parameter. The problem is that MSSGID is the
Primary key and it is INT. How could be solved this problem?

Thank you in advance!

Viktor
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.754 / Virus Database: 504 - Release Date: 06.9.2004 a.

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Terje Slettebų | last post by:
Hi. I'm new here, and sorry if this has been discussed before; I didn't find it searching the PHP groups. (I've also read recommendations to cross-post to the other PHP groups, but if that is...
13
by: dawatson833 | last post by:
I have several stored procedures with parameters that are defined with user defined data types. The time it takes to run the procedures can take 10 - 50 seconds depending on the procedure. If I...
4
by: ad | last post by:
I am confuse about type and class in some book about C#. What is the difference between type and class?
1
by: Rob Griffiths | last post by:
Can anyone explain to me the difference between an element type and a component type? In the java literature, arrays are said to have component types, whereas collections from the Collections...
31
by: Spiro Trikaliotis | last post by:
Hello, I have a question regarding subtracting a pointer from another one. Assume I have two pointers p1 and p2, which both point to a memory area obtained with malloc(). Assume p1 = p2 + some...
3
by: john | last post by:
Hi to All To demonstrate: public class MyBaseGenericClass<T> { } public class MyGenericClass1<T: MyBaseGenericClass<T> {
7
by: Arpan | last post by:
The .NET Framework 2.0 documentation states that An Object variable always holds a pointer to the data, never the data itself. Now w.r.t. the following ASP.NET code snippet, can someone please...
7
by: Michael | last post by:
Hi, I could understand the difference between class and object. However, I could find out a good definiton of type. how to understand the relaitonship between type, class, and object? Thanks! ...
21
by: Nikolaus Rath | last post by:
Hello, Can someone explain to me the difference between a type and a class? After reading http://www.cafepy.com/article/python_types_and_objects/ it seems to me that classes and types are...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.