Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #5495
| From | "Er!k \\/!$$Er" <nospam@nospam.url> |
|---|---|
| Newsgroups | comp.lang.clipper.visual-objects |
| Subject | Re: Debug options Vo2Ado when using SQL Express? |
| Date | 2013-07-11 20:09 +0200 |
| Organization | Netfront http://www.netfront.net/ |
| Message-ID | <krmscs$1fo9$1@adenine.netfront.net> (permalink) |
| References | <5c53e6e7-c12c-4ac7-a8d9-4696c30a06a9@googlegroups.com> <c0a58b21-cd0a-4253-9aef-eb080bc0d216@googlegroups.com> |
Rob,
What both Johan and I try to explain, is that Count() will never return
null.
So you code should be
IF @nROWS=0
BEGIN
....
END
Erik
"Rob van Erk" schreef in bericht
news:c0a58b21-cd0a-4253-9aef-eb080bc0d216@googlegroups.com...
Thanks for the input.
Willie,
What I did is run an "Execute" in SQL Express. This returns a "command
completed successfully". So, content of SP seems ok. Not sure if I can run /
test the Stored Procedure using paramaters in MS Management Studio.
Johan,
I already tried what you suppose but I got an error "incorrect syntax near
'END'. I removed the last 'END' from below code and now the code is
accepted.
BEGIN TRANSACTION
SELECT @nROWS = count(username) FROM DBTIMEREG WHERE UNIQUEKEY = @sKEY
IF @nROWS = 0
BEGIN
INSERT INTO [DBTIMEREG]
(username,logindate,device,pcname,uniquekey)
VALUES(@sUser,@sDate,@sDevice,@sPcname,@sKey)
END
===> removed this line END
COMMIT TRANSACTION
Erik,
Thanks. "0" is returned if the getuser()+curdate() does not exist. If user
exist (e.g. he restarted his PC on same day) than only logoff date will be
saved in same record. So, I only want to save login/logoff data of a user in
one row/record. Hence my idea to use the record count to check if record
already exist on SQL Server.
--- news://freenews.netfront.net/ - complaints: news@netfront.net ---
Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Debug options Vo2Ado when using SQL Express? Rob van Erk <erk.v@hotmail.com> - 2013-07-10 13:16 -0700
Re: Debug options Vo2Ado when using SQL Express? Willie Moore <williem@wmconsulting.com> - 2013-07-11 11:30 +0000
Re: Debug options Vo2Ado when using SQL Express? Johan Nel <johan.nel@xsinet.co.za> - 2013-07-11 05:01 -0700
Re: Debug options Vo2Ado when using SQL Express? "Er!k \\/!$$Er" <nospam@nospam.url> - 2013-07-11 14:04 +0200
Re: Debug options Vo2Ado when using SQL Express? Johan Nel <johan.nel@xsinet.co.za> - 2013-07-11 05:20 -0700
Re: Debug options Vo2Ado when using SQL Express? Rob van Erk <erk.v@hotmail.com> - 2013-07-11 09:58 -0700
Re: Debug options Vo2Ado when using SQL Express? "Er!k \\/!$$Er" <nospam@nospam.url> - 2013-07-11 20:09 +0200
Re: Debug options Vo2Ado when using SQL Express? Rob van Erk <erk.v@hotmail.com> - 2013-07-11 12:25 -0700
csiph-web