Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 complex SQL query with parameters

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-08-24 : 20:06:44
Matt writes "I have this SQL Stored Procedure:

CREATE PROCEDURE DoBookMark
(
@OwnerID as int,
@ParentID as int,
@FolderName as varchar(255),
@Description as varchar(255),
@OpenToPublic as bit
)
AS
IF Exists(SELECT FolderName, OwnerID FROM Bookmarks_Directories WHERE OwnerID=@OwnerID AND FolderName=@FolderName AND ParentID=@ParentID)
BEGIN
UPDATE Bookmarks_Directories SET ParentID=@ParentID,OwnerID=@OwnerID,FolderName=@FolderName, Description=@Description, OpenToPublic=@OpenToPublic WHERE FolderName=@FolderName AND OwnerID=@OwnerID AND ParentID=@ParentID
SELECT @@IDENTITY AS 'MarkID'
END
ELSE
BEGIN
INSERT Bookmarks_Directories (ParentID,OwnerID,FolderName,Description,OpenToPublic) VALUES (@ParentID,@OwnerID,@FolderName,@Description,@OpenToPublic)
SELECT @@IDENTITY AS 'MarkID'
END



and am calling it usign ASP. I want to get the "MarkID" field. In the SQL Query Analyzer, the field is returned, but using ASP, I get nothing... Here is the ASP Code I am using...

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "myDSN", "myUser", "myPassword"
SQL = "EXECUTE DoBookMark 5,9,'Other', 'Other Documents', 1"
Set RS = Conn.Execute(SQL)
If NOT RS.EOF then
response.write "
MarkID: " & RS.Fields("MarkID")
End If
Set RS = nothing
Conn.Close
Set Conn = nothing


Any ideas?

SQL Server: 7.0 (All up-to-date)
OS: Windows2000 Server"


   

- Advertisement -