Showing posts with label properly. Show all posts
Showing posts with label properly. Show all posts

Friday, March 30, 2012

Problem running multiple SP's

Hello,
I have two SP that are similar to the one below. When trying to run both of
them through Query analyzer the first one will execute properly but the
second one will say that it executed but doesn't really update any fields.
The only difference between the two is the name of the table that gets
updated and the number of tests. If I run either one independently through
there own query windows they both work.
TIA for any help.
CREATE PROCEDURE [dbo].[sp_UpdateRF] AS
-- Update RF Grades
DECLARE @.TestName VARCHAR(30)
DECLARE @.TestGrade CHAR(10)
DECLARE @.Employee_ID char(7)
DECLARE curRF CURSOR FOR SELECT TestName, TestGrade, Import.Employee_ID
FROM Import, RF
WHERE Import.Employee_ID = RF.Employee_ID
AND SUBSTRING(TestName, 1, 1)= '5'
OPEN curRF
WHILE @.@.FETCH_STATUS = 0
BEGIN
FETCH NEXT FROM curRF INTO @.TestName, @.TestGrade, @.Employee_ID
IF SUBSTRING(@.TestName, 3, 1) = '1'
BEGIN
UPDATE RF
SET RF.[1] = @.TestGrade
WHERE @.Employee_ID = RF.Employee_ID
AND RF.[1] IS NULL
END
IF SUBSTRING(@.TestName, 3, 1) = '2'
BEGIN
UPDATE RF
SET RF.[2] = @.TestGrade
WHERE @.Employee_ID = RF.Employee_ID
AND RF.[2] IS NULL
END
IF SUBSTRING(@.TestName, 3, 1) = '3'
BEGIN
UPDATE RF
SET RF.[3] = @.TestGrade
WHERE @.Employee_ID = RF.Employee_ID
AND RF.[3] IS NULL
END
IF SUBSTRING(@.TestName, 3, 1) = '4'
BEGIN
UPDATE RF
SET RF.[4] = @.TestGrade
WHERE @.Employee_ID = RF.Employee_ID
AND RF.[4] IS NULL
END
IF SUBSTRING(@.TestName, 3, 1) = '5'
BEGIN
UPDATE RF
SET RF.[5] = @.TestGrade
WHERE @.Employee_ID = RF.Employee_ID
AND RF.[5] IS NULL
END
IF SUBSTRING(@.TestName, 3, 1) = '6'
BEGIN
UPDATE RF
SET RF.[6] = @.TestGrade
WHERE @.Employee_ID = RF.Employee_ID
AND RF.[6] IS NULL
END
IF SUBSTRING(@.TestName, 3, 1) = 'F'
BEGIN
UPDATE RF
SET RF.F = @.TestGrade
WHERE @.Employee_ID = RF.Employee_ID
END
END
CLOSE curRF
DEALLOCATE curRF
GOOn Thu, 25 Aug 2005 15:14:47 -0700, XImhotep wrote:

>Hello,
>I have two SP that are similar to the one below. When trying to run both of
>them through Query analyzer the first one will execute properly but the
>second one will say that it executed but doesn't really update any fields.
>The only difference between the two is the name of the table that gets
>updated and the number of tests. If I run either one independently through
>there own query windows they both work.
>TIA for any help.
Hi XImhotep,
The problem is that you have some statements in the wrong order. You
should always have a FETCH _before_ testing @.@.FETCH_STATUS. If you don't
have a fetch before that, you'll end up testing the last fetch status of
the previously executed cursor.
The proper order of events is
DECLARE CURSOR
OPEN CURSOR
FETCH FIRST
WHILE @.@.FETCH_STATUS = 0
BEGIN
-- do something
FETCH NEXT
END
CLOSE CURSOR
DEALLOCATE CURSOR
However, most cursors are not needed at all. In 99% of the situations, a
set-based alternative will be faster, shorter, easier to read and hence
easier to maintain.
Your post doesn't reveal enough of your tables to make it worth an
attempt at rewriting it. However, if you post more information about
this, I'll be happy to have a look (and many others will too). See
www.aspfaq.com/5006 for an explanation of the information you should
provide if you s help.
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||XImhotep wrote:
> Hello,
> I have two SP that are similar to the one below. When trying to run
> both of them through Query analyzer the first one will execute
> properly but the second one will say that it executed but doesn't
> <SNIP>
Try adding some debug code to the procedures and see if they are both
running the updates. Also, how are you executing the two procedures? Do
you have two EXEC statements in the same QA window that are being
executed as a batch?
David Gugick
Quest Software
www.imceda.com
www.quest.com|||Thanks for the help. I missed the fetch statement at the bottom. Everyhting
is working now.
Thanks again.
"Hugo Kornelis" <hugo@.pe_NO_rFact.in_SPAM_fo> wrote in message
news:08isg1lm0qc9s5f8001gd2relr27k9s568@.
4ax.com...
> On Thu, 25 Aug 2005 15:14:47 -0700, XImhotep wrote:
>
> Hi XImhotep,
> The problem is that you have some statements in the wrong order. You
> should always have a FETCH _before_ testing @.@.FETCH_STATUS. If you don't
> have a fetch before that, you'll end up testing the last fetch status of
> the previously executed cursor.
> The proper order of events is
> DECLARE CURSOR
> OPEN CURSOR
> FETCH FIRST
> WHILE @.@.FETCH_STATUS = 0
> BEGIN
> -- do something
> FETCH NEXT
> END
> CLOSE CURSOR
> DEALLOCATE CURSOR
> However, most cursors are not needed at all. In 99% of the situations, a
> set-based alternative will be faster, shorter, easier to read and hence
> easier to maintain.
> Your post doesn't reveal enough of your tables to make it worth an
> attempt at rewriting it. However, if you post more information about
> this, I'll be happy to have a look (and many others will too). See
> www.aspfaq.com/5006 for an explanation of the information you should
> provide if you s help.
> Best, Hugo
> --
> (Remove _NO_ and _SPAM_ to get my e-mail address)

Monday, March 12, 2012

Problem of SQL Server 2005 Reporting service installation

The report manager site not working properly after I install the SQL Server 2005. I have been tried to fix it since yesterday. But it just getting worse. I need to get this to work properly before I can install the Visual Studio Team Foundation Server.

I am following the Visual Studio Team Foundation Installation Guide.
The Steps I have done so far are:

1. Install SQL Server 2005 and assign application pool to reports and report server sites in IIS.

2. Try to install Team Foundation Server, but I noticed that it requires sharepoint service to be installed first. The service seems already installed in this computer. So I didn't reinstall the sharepoint service. When I try to exclude the SQL Server Reporting Services Web applications from share point service, the command throw exceptions. When I try to view the localhost/reports, the page has errors(Reports server Unable to generate a temporary class, CS2001: xxx.dll could not be found error CS2008: No inputs specified). xxx.dll refers to different dlls each time I request the page.

3. Uninstall Sharepoint and reinstall, still encounter the same problem.

4. Uninstall SQL Server 2005, I also noticed the ReportServer sites in IIS haven't been removed after uninstallation. So when I reinstall the SQL Server again, on the Report Server Installation Options page, I can't select Install the default configuration (default selection), instead the second option is selected which is no auto configuration(options are all grey out so I can't change the selection). After installation, the report server site get a no page found error.

I also noticed in IIS - Report Server(Stop) can't be start. I get a Parameter is incorrect error when I try to restart. There is two sites underIIS - Report Server(Stop) , they are Reports and ReportServer, they seems correct. But if right click the Report Server(Stop) and click Properties - Asp.NET tab. It point to the D:\Program Files\Microsoft SQL Server\InetPub\wwwroot\web.config. However, I can't find any web.config under Microsoft SQL Server\InetPub\wwwroot\. So it seems something missing there...

Please help... Any idea and suggestion are welcome!
There are a lot of pieces at work here. For some reason, SharePoint doesn't seem to be too happy. We are working on making the RS and SP combination setup experience better but this won't be until RTM. Here is what I would do:

1. Uninstall SQL Server (and RS). Delete the virtual directories in IIS and the SQL directories in the file system (including the databases)
2. Uninstall the .NET Framework 2.0 (this shouldn't be the reason, but just to be safe)
3. Reinstall SharePoint. Make sure that it is working, including the ability to exclude virtual directories.
4. Install RS. You might have to go with a 'non-default' install and use the RS Configuration tool to create the virtual directories. They will need to be in a different application pool than SharePoint. If the default install works, you will need to change the application pool for the vdirs created by setup.
5. Exclude the RS virtual directories in the SP Site Configuration.|||Thank you for your detailed information. One more question, I installed Active Directory after installed the IIS. In your case, did you install IIS after you install AD or before? I just wonder whether I should reinstall IIS.

Cheers|||Thank you very much, I uninstall IIS and sharepoint and reinstall them, everything works fine so I eventually can begin install the Foundation server, but when I install the server, I get 32000 error.
Error 32000. The Commandline "D:\ProgramFiles\Microsoft Visual Studio 2005 Enterprise Server\BISIISDIR\sdk\bin\tfsadaminst.exe" /install DIONYSUS 2420 TFGSS Hyperknowledge\TFSSETUP' return non-zero value:1

I have a look the event viewer and these errors are all cannot create *** performance counter, for example:

The report server cannot create the Cache Misses/Sec (Semantic Models) performance counter.

I wonder wether the memory is not enough in the machine...