0
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[createaccount]
@account VARCHAR(15),
@password VARCHAR(32)

AS

SET NOCOUNT ON

DECLARE @DateActivated AS CHAR(8)

IF NOT EXISTS (SELECT account FROM ACCOUNT_TBL WHERE account = @account) BEGIN
INSERT INTO ACCOUNT_TBL (account, [password], id_no2, isuse, member, realname)
VALUES (@account, @password, @password, 'T', 'A', 'F')

SET @DateActivated = CONVERT(CHAR(8), GETDATE()-1, 112 ) --Is the date today - 1
--UPDATE ACCOUNT_TBL_DETAIL SET BlockTime = @DateYesterday WHERE account = @userid
--INSERT INTO ACCOUNT_TBL_DETAIL (account, gamecode, tester, m_chLoginAuthority, regdate, BlockTime, EndTime, WebTime, isuse)
-- VALUES (@account, 'A000', '2', 'F', GETDATE(), '20990101', '20990101', '20050101', 'O')

INSERT INTO ACCOUNT_TBL_DETAIL (account, gamecode, tester, m_chLoginAuthority, regdate, BlockTime, EndTime, WebTime, isuse)
VALUES (@account, 'A000', '2', 'F', GETDATE(), @DateActivated, '20990101', '20050101', 'O')

Edited by amras123: n/a

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by amras123
0
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[createaccount]
@account VARCHAR(15),
@password VARCHAR(32)

AS

SET NOCOUNT ON

DECLARE @DateActivated AS CHAR(8)

IF NOT EXISTS (SELECT account FROM ACCOUNT_TBL WHERE account = @account) BEGIN
INSERT INTO ACCOUNT_TBL (account, [password], id_no2, isuse, member, realname)
VALUES (@account, @password, @password, 'T', 'A', 'F')

SET @DateActivated = CONVERT(CHAR(8), GETDATE()-1, 112 ) --Is the date today - 1
--UPDATE ACCOUNT_TBL_DETAIL SET BlockTime = @DateYesterday WHERE account = @userid
--INSERT INTO ACCOUNT_TBL_DETAIL (account, gamecode, tester, m_chLoginAuthority, regdate, BlockTime, EndTime, WebTime, isuse)
-- VALUES (@account, 'A000', '2', 'F', GETDATE(), '20990101', '20990101', '20050101', 'O')

INSERT INTO ACCOUNT_TBL_DETAIL (account, gamecode, tester, m_chLoginAuthority, regdate, BlockTime, EndTime, WebTime, isuse)
VALUES (@account, 'A000', '2', 'F', GETDATE(), @DateActivated, '20990101', '20050101', 'O')

this is my error:

Msg 102, Level 15, State 1, Procedure createaccount, Line 21
Incorrect syntax near ')'.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.