显示标签为“familiar”的博文。显示所有博文
显示标签为“familiar”的博文。显示所有博文

2012年3月25日星期日

Anyone here familiar with stored procedures?

Hi there! I would like to return a default status value (-101) if the -100 and 200 conditions are not met. Is there any way I can go about it?


ALTER PROCEDURE spServiceFormGet (@.TicketNo int, @.Name char(50))
AS

IF NOT EXISTS (SELECT SolutionID FROM ServiceForm where SolutionID = @.TicketNo)
RETURN -100

IF EXISTS (SELECT SolutionID, SolvedBy FROM ServiceForm
WHERE SolutionID = @.TicketNo AND SolvedBy LIKE @.Name
OR SolutionID = @.TicketNo AND SolvedBy IS NULL)
SELECT * FROM serviceform where SolutionID=@.TicketNo
RETURN 200

ELSE <-- something like that
RETURN -101 <-- something like that

Thanks,
-Gabian-Gabian,
Do a google search on MSSQL Output Variables.

You should return a @.outputStatus variable here.

ScAndal|||I am not sure I understand what a return code is buying you in this case - Is there more to the proc than you are posting?

If there is no solutionid matching the ticket (first test) than you know there will be no solutionid matching a ticket AND a name...

Why not just execute the select with the (ticketid, name) filter and interogate the result set for records. If the count = 0 - you know there are no solutionid's matching this ticketno and/or name ??|||Thanks for answering guys, I've got it!

-Gabian-sql

Anyone familiar with dashCommerce?

I've installed it on my local machine using SQL Server 2005 Express with no problem. Now I need to install it on the server. I want to use the remote SQL Server 2005 database, but that means installing the scripts manually. I did that and thought it went well, but I'm getting all kinds of errors, so there's a problem of some kind.

I have SQL Server 2005 Express installed. I's be happy enough to use that, but I don't know how to. I tried to install and got an error that I couldn't create a database. I don't want to try to do it manually again, that didn't work very well before.

How do I do this?

Diane

Did you successfully install Express edition on the server? What kind of Sql Server is installed on your remote server? What kind of error are you getting. Without seeing the errors, it is very hard to tell what might be the problem. Post the error here.

2012年3月22日星期四

Anybody seen this error? - 37000 - Storage Allocation record not a

> I am not familiar with the error message, but is there any more information
> in the SQL Server error log. Does Stopping/Starting SQL server help? Have you
> tried defragmenting the disc? Are you using a fixed value for file growth on
> all the databases (including tempdb).
> John
It's SQL Server 7 on NT.
Stopping and starting SQL Server does not resolve the problem.
Defragmentation is not an issue either. We're really stumped, and have
opened a call with the makers of the software that is reporting the
error from SQL Server.
[vbcol=seagreen]
> "jonathan.beckett" wrote:
Hi Jonathan
You should be able to run SQL profiler to find out what commands are being
sent to SQL Server and possibly track down what is causing it.
John
"jonathan.beckett" wrote:

>
> It's SQL Server 7 on NT.
> Stopping and starting SQL Server does not resolve the problem.
> Defragmentation is not an issue either. We're really stumped, and have
> opened a call with the makers of the software that is reporting the
> error from SQL Server.
>
>
>