Ask a Question related to ASP.NET General, Design and Development.
-
TaeHo Yoo #1
Have a problem with using cursors in SQL server enterprise manager
Have a problem with using cursors in SQL server enterprise manager.
My code sql query is followed
---------------------------------------
DECLARE @element_name varchar(100)
DECLARE elements_cursor CURSOR FOR
SELECT element_name
FROM KB_Element_Ref
OPEN elements_cursor
FETCH NEXT FROM elements_cursor INTO @element_name
WHILE @@FETCH_STATUS = 0
BEGIN
PRINT @element_name
FETCH NEXT FROM elements_cursor INTO @element_name
END
CLOSE elements_cursor
DEALLOCATE elements_cursor
------------------------------------------------------------
I have more than 100 rows int KB_Element_Ref table.
but when I execute this query, it said only a row has affected and did't
print any element_name.
does any one know what is going on?
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
TaeHo Yoo Guest
-
Enterprise Manager Errors on UNIX
CFMX 7.0.1 multiserver configuration on UNIX (Solaris 9). When creating a new instance in CFAdmin Enterprise Manager Instance Manager I get the... -
Settings Manager in the Enterprise
Where are the settings stored when the web tool is used to adjust local flash player settings? For example: the auto update is turned off or the... -
Can't connect to remote sql server from asp.net buk ok from Enterprise Manager
Remove now aspnet user from admin group! (no matter is a test server, is a bad practique). You server is win2003? I don't can connect to Sql Server... -
ASP enterprise manager ?
Has anyone tried the ASP.NET Enterprise Manager ? I've installed it but after starting up it produces errors, I've started it by using... -
Enterprise Manager Problem
I can connect fine via query analyzer, but it takes several minutes to expand the databases on one particular server. Other servers, database... -
Vaclav Jedlicka #2
Re: Have a problem with using cursors in SQL server enterprise manager
your code is correct
are you sure the table is not empty?
Vaclav
"TaeHo Yoo" <anonymous@devdex.com> wrote in message
news:uNMxxf6ODHA.3152@TK2MSFTNGP10.phx.gbl...> Have a problem with using cursors in SQL server enterprise manager.
> My code sql query is followed
> ---------------------------------------
> DECLARE @element_name varchar(100)
> DECLARE elements_cursor CURSOR FOR
> SELECT element_name
> FROM KB_Element_Ref
>
> OPEN elements_cursor
> FETCH NEXT FROM elements_cursor INTO @element_name
>
> WHILE @@FETCH_STATUS = 0
> BEGIN
> PRINT @element_name
> FETCH NEXT FROM elements_cursor INTO @element_name
> END
>
> CLOSE elements_cursor
> DEALLOCATE elements_cursor
> ------------------------------------------------------------
> I have more than 100 rows int KB_Element_Ref table.
> but when I execute this query, it said only a row has affected and did't
> print any element_name.
> does any one know what is going on?
>
>
> *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> Don't just participate in USENET...get rewarded for it!
Vaclav Jedlicka Guest
-
Rhys Gravell #3
Re: Have a problem with using cursors in SQL server enterprise manager
Try
<CODE>
DECLARE @element_name varchar(100)
DECLARE elements_cursor CURSOR FOR SELECT element_name FROM
KB_Element_Ref
SELECT COALESCE(element_name,'Null Value') FROM KB_Element_Ref
OPEN elements_cursor
FETCH NEXT FROM elements_cursor INTO @element_name
WHILE @@FETCH_STATUS = 0
BEGIN
PRINT '<<' + @element_name + '>>'
FETCH NEXT FROM elements_cursor INTO @element_name
END
CLOSE elements_cursor
DEALLOCATE elements_cursor
</CODE>
in query analyzer to help check if a zero length string, or null is
being returned.
Rhys Gravell
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Rhys Gravell Guest



Reply With Quote

