Click here to Skip to main content
15,895,256 members
Home / Discussions / Database
   

Database

 
GeneralRe: Ordering rows by multiple coluimns Pin
Branislav Vidovic11-Aug-09 0:23
Branislav Vidovic11-Aug-09 0:23 
GeneralRe: Ordering rows by multiple coluimns Pin
Luc Pattyn13-Aug-09 3:28
sitebuilderLuc Pattyn13-Aug-09 3:28 
Questionerror:characters found after end of sql statement Pin
myinstincts9-Aug-09 19:03
myinstincts9-Aug-09 19:03 
AnswerRe: error:characters found after end of sql statement Pin
Vimalsoft(Pty) Ltd9-Aug-09 22:05
professionalVimalsoft(Pty) Ltd9-Aug-09 22:05 
QuestionRetrieve data from column with xml data type, SQL Server 208 Pin
A.Petkovic9-Aug-09 1:19
A.Petkovic9-Aug-09 1:19 
AnswerRe: Retrieve data from column with xml data type, SQL Server 208 Pin
Vimalsoft(Pty) Ltd9-Aug-09 22:11
professionalVimalsoft(Pty) Ltd9-Aug-09 22:11 
GeneralRe: Retrieve data from column with xml data type, SQL Server 208 Pin
A.Petkovic10-Aug-09 1:42
A.Petkovic10-Aug-09 1:42 
QuestionUDF, SPROC in SQL Server Express 2008 Pin
Dirso8-Aug-09 10:42
Dirso8-Aug-09 10:42 
Hi,
I'd like to put all my database management in StoredProcedures or Functions, but I'm having a small problem:
1) I know I can't use INSERT, UPDATE or DELETE in UDFs, right?
2) So i created a SPROC that inserts a record to a simple table (id, name) and returns the ID in an output parameter. It's working fine.
3) I create a UDF that executes this SPROC and returns the ID... and here is my problem... looks like I can't execute my own SPROCs from a UDF. Frown | :(
4) So.. how do I achieve this goal? Inserting a record and returning the auto generated id back to my web browser (asp.net application).
Here is some of my code:

CREATE PROCEDURE finsTeste 
	@snome varchar(50), 
	@nid int output
AS
BEGIN
	SET NOCOUNT ON;
	INSERT INTO teste (nome) VALUES (@snome)
	SELECT @nid = SCOPE_IDENTITY()
END
GO
CREATE FUNCTION insTeste 
(
	@snome varchar(50)
)
RETURNS int
AS
BEGIN
	DECLARE @nid int
	EXECUTE finsTeste @snome, @nid output
	RETURN @nid;
END
GO


And then in the asp.net page I run a ExecuteScalar(StoredProcedure, "insTeste", params);

Thanks,
Dirso

AnswerRe: UDF, SPROC in SQL Server Express 2008 Pin
i.j.russell8-Aug-09 11:10
i.j.russell8-Aug-09 11:10 
GeneralRe: UDF, SPROC in SQL Server Express 2008 Pin
Dirso8-Aug-09 12:36
Dirso8-Aug-09 12:36 
Questionforeign key Pin
Amit Patel19858-Aug-09 0:15
Amit Patel19858-Aug-09 0:15 
AnswerRe: foreign key Pin
Eddy Vluggen8-Aug-09 5:08
professionalEddy Vluggen8-Aug-09 5:08 
QuestionFULL JOIN in Access 2003 Pin
Branislav Vidovic8-Aug-09 0:10
Branislav Vidovic8-Aug-09 0:10 
AnswerRe: FULL JOIN in Access 2003 Pin
Blue_Boy8-Aug-09 2:09
Blue_Boy8-Aug-09 2:09 
AnswerRe: FULL JOIN in Access 2003 Pin
Jerry Hammond8-Aug-09 3:40
Jerry Hammond8-Aug-09 3:40 
AnswerRe: FULL JOIN in Access 2003 Pin
riced9-Aug-09 1:15
riced9-Aug-09 1:15 
GeneralRe: FULL JOIN in Access 2003 Pin
Branislav Vidovic9-Aug-09 20:41
Branislav Vidovic9-Aug-09 20:41 
GeneralRe: FULL JOIN in Access 2003 Pin
riced10-Aug-09 3:04
riced10-Aug-09 3:04 
AnswerRe: FULL JOIN in Access 2003 Pin
Baran M9-Aug-09 18:42
Baran M9-Aug-09 18:42 
QuestionLARGE database query Pin
kshincsk8-Aug-09 0:04
kshincsk8-Aug-09 0:04 
AnswerRe: LARGE database query Pin
Jerry Hammond8-Aug-09 3:36
Jerry Hammond8-Aug-09 3:36 
AnswerRe: LARGE database query Pin
Baran M9-Aug-09 18:46
Baran M9-Aug-09 18:46 
AnswerRe: LARGE database query Pin
Mycroft Holmes10-Aug-09 3:15
professionalMycroft Holmes10-Aug-09 3:15 
QuestionSome sql server 2008 question Pin
E_Gold7-Aug-09 23:11
E_Gold7-Aug-09 23:11 
AnswerRe: Some sql server 2008 question Pin
Eddy Vluggen8-Aug-09 5:03
professionalEddy Vluggen8-Aug-09 5:03 

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.