Click here to Skip to main content
15,886,783 members
Home / Discussions / Database
   

Database

 
GeneralRe: Pleaes help me with this query Pin
Meysam Mahfouzi26-Aug-07 11:32
Meysam Mahfouzi26-Aug-07 11:32 
GeneralRe: Pleaes help me with this query Pin
Colin Angus Mackay26-Aug-07 11:44
Colin Angus Mackay26-Aug-07 11:44 
GeneralRe: Pleaes help me with this query Pin
Meysam Mahfouzi28-Aug-07 3:25
Meysam Mahfouzi28-Aug-07 3:25 
AnswerRe: Pleaes help me with this query Pin
Michael Potter27-Aug-07 5:41
Michael Potter27-Aug-07 5:41 
GeneralRe: Pleaes help me with this query Pin
Meysam Mahfouzi28-Aug-07 3:08
Meysam Mahfouzi28-Aug-07 3:08 
GeneralRe: Pleaes help me with this query Pin
Colin Angus Mackay28-Aug-07 6:55
Colin Angus Mackay28-Aug-07 6:55 
GeneralRe: Pleaes help me with this query Pin
Meysam Mahfouzi28-Aug-07 21:38
Meysam Mahfouzi28-Aug-07 21:38 
QuestionProblem with cursor Pin
Developer61126-Aug-07 4:06
Developer61126-Aug-07 4:06 
Hi there .

I have cursor that navigate on sysusers table , and get the name of user for drop it ,via exec sp_dropuser @name . but when i want to execute this function give me a error .

Error : Select statements included within a function can not return data to a client

I don't know how can i solve this problem .

My Function :
<br />
CREATE FUNCTION fDropAllSystemUsers()<br />
<br />
returns int<br />
as<br />
	begin<br />
		declare @result int<br />
		declare @name char(20)<br />
<br />
					<br />
		declare UserNavigator cursor for 		<br />
			select [name] from sysusers where [name] <> 'dbo' and islogin = 1<br />
			<br />
			open UserNavigator 	<br />
			<br />
			if (@@FETCH_STATUS <> 0)<br />
				return 0<br />
				<br />
			while(@@FETCH_STATUS = 0)	<br />
			begin<br />
				exec sp_dropuser @name				<br />
				fetch next from UserNavigator into @name	<br />
			end<br />
		fetch next from UserNavigator<br />
		<br />
		close UserNavigator<br />
		deallocate UserNavigator<br />
		<br />
		set @result = 0;<br />
		return @result<br />
	end <br />


Please help me .

DMASTER

AnswerRe: Problem with cursor [modified] Pin
John-ph26-Aug-07 20:10
John-ph26-Aug-07 20:10 
AnswerRe: Problem with cursor Pin
John-ph26-Aug-07 21:08
John-ph26-Aug-07 21:08 
Questionconnect to MYSQL database located on web Pin
Rupesh Kumar Swami25-Aug-07 23:19
Rupesh Kumar Swami25-Aug-07 23:19 
QuestionHow to drop builtin\administrators account from sql server Pin
Developer61125-Aug-07 22:39
Developer61125-Aug-07 22:39 
AnswerRe: How to drop builtin\administrators account from sql server Pin
Mark Churchill26-Aug-07 18:07
Mark Churchill26-Aug-07 18:07 
GeneralRe: How to drop builtin\administrators account from sql server Pin
Developer61126-Aug-07 19:35
Developer61126-Aug-07 19:35 
GeneralRe: How to drop builtin\administrators account from sql server Pin
Burnsys229-Aug-07 4:35
Burnsys229-Aug-07 4:35 
Questionoutput to struct Pin
ginjikun25-Aug-07 6:53
ginjikun25-Aug-07 6:53 
AnswerRe: output to struct Pin
Christian Graus26-Aug-07 0:30
protectorChristian Graus26-Aug-07 0:30 
QuestionProblem with piece of code Pin
ChrisFarrugia25-Aug-07 6:12
ChrisFarrugia25-Aug-07 6:12 
AnswerRe: Problem with piece of code Pin
Colin Angus Mackay25-Aug-07 6:51
Colin Angus Mackay25-Aug-07 6:51 
QuestionAlternate of listbox.itemdata property Pin
RaveRare24-Aug-07 23:51
RaveRare24-Aug-07 23:51 
GeneralRe: Alternate of listbox.itemdata property Pin
John-ph25-Aug-07 0:41
John-ph25-Aug-07 0:41 
AnswerRe: Alternate of listbox.itemdata property Pin
Rupesh Kumar Swami25-Aug-07 23:38
Rupesh Kumar Swami25-Aug-07 23:38 
QuestionBest practices to save, edit, insert, view records on a Complex form vb.net Pin
RaveRare24-Aug-07 22:09
RaveRare24-Aug-07 22:09 
AnswerRe: Best practices to save, edit, insert, view records on a Complex form vb.net Pin
Christian Graus24-Aug-07 22:49
protectorChristian Graus24-Aug-07 22:49 
GeneralRe: Best practices to save, edit, insert, view records on a Complex form vb.net Pin
RaveRare24-Aug-07 22:53
RaveRare24-Aug-07 22:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.