Click here to Skip to main content
15,901,283 members
Home / Discussions / Database
   

Database

 
QuestionODBC driver and MSAccess, what's wrong? Pin
Konstantin S. Diguine18-Apr-03 1:59
Konstantin S. Diguine18-Apr-03 1:59 
GeneralApplication is still running or a crash occured Pin
ovidiu_pon17-Apr-03 22:08
ovidiu_pon17-Apr-03 22:08 
GeneralRe: Application is still running or a crash occured Pin
andyharman18-Apr-03 4:21
professionalandyharman18-Apr-03 4:21 
GeneralRe: Application is still running or a crash occured Pin
ovidiu_pon20-Apr-03 20:51
ovidiu_pon20-Apr-03 20:51 
Generalstored procedure problem Pin
AlphaS17-Apr-03 12:36
AlphaS17-Apr-03 12:36 
GeneralRe: stored procedure problem Pin
Rein Hillmann17-Apr-03 13:49
Rein Hillmann17-Apr-03 13:49 
GeneralRe: stored procedure problem Pin
AlphaS18-Apr-03 10:35
AlphaS18-Apr-03 10:35 
GeneralRe: stored procedure problem Pin
Rein Hillmann18-Apr-03 13:25
Rein Hillmann18-Apr-03 13:25 
No, the set command will only modify the variables. The data in the table will not be modified.

<br />
INSERT INTO LicenseInfo (LicenseOwner) VALUES (@LicenseOwner)<br />
<br />
SET @LicenseID = SCOPE_IDENTITY()<br />
SET @StartDate = GETDATE()<br />
SET @EndDate = GETDATE()<br />


In the above code, the only value that will get set in the new row in the table is the LicenseOwner. The other values in the table will get the default values (or NULL if no default is set).

To update the table values, you need to pass them into the table. Now, I'm assuming that LicenseID is an identity field, so that will be automatically set. This is how I would implement the procedure:

<br />
declare @MyDate datetime<br />
SET @MyDate = GETDATE() -- this will allow us to have one unique date instead of calling getdate() twice <br />
SET @StartDate = @MyDate<br />
SET @EndDate = @MyDate<br />
<br />
INSERT INTO LicenseInfo (LicenseOwner, StartDate, EndDate) <br />
VALUES (@LicenseOwner, @StartDate, @EndDate)<br />
<br />
SET @LicenseID = @@identity<br />


Hope this helps.
GeneralRe: stored procedure problem Pin
AlphaS18-Apr-03 21:03
AlphaS18-Apr-03 21:03 
GeneralMSDE server performance question Pin
Member 9617-Apr-03 7:27
Member 9617-Apr-03 7:27 
GeneralRe: MSDE server performance question Pin
Mark Smithson17-Apr-03 8:22
Mark Smithson17-Apr-03 8:22 
GeneralRe: MSDE server performance question Pin
Member 9617-Apr-03 8:51
Member 9617-Apr-03 8:51 
GeneralRe: MSDE server performance question Pin
andyharman18-Apr-03 4:07
professionalandyharman18-Apr-03 4:07 
GeneralRe: MSDE server performance question Pin
Member 9619-Apr-03 18:08
Member 9619-Apr-03 18:08 
QuestionSQL Server Insert and trigger question? Pin
Bart-Man17-Apr-03 4:57
Bart-Man17-Apr-03 4:57 
AnswerRe: SQL Server Insert and trigger question? Pin
Chris Meech17-Apr-03 7:47
Chris Meech17-Apr-03 7:47 
GeneralRe: SQL Server Insert and trigger question? Pin
Bart-Man17-Apr-03 9:48
Bart-Man17-Apr-03 9:48 
GeneralRe: SQL Server Insert and trigger question? Pin
Chris Meech17-Apr-03 10:06
Chris Meech17-Apr-03 10:06 
GeneralRe: SQL Server Insert and trigger question? Pin
Bart-Man17-Apr-03 10:43
Bart-Man17-Apr-03 10:43 
GeneralSQL problem Pin
John-theKing16-Apr-03 21:53
John-theKing16-Apr-03 21:53 
GeneralRe: SQL problem Pin
Richard Deeming16-Apr-03 23:22
mveRichard Deeming16-Apr-03 23:22 
QuestionHow to rename a table in a database? Pin
Paul Selormey16-Apr-03 20:02
Paul Selormey16-Apr-03 20:02 
AnswerRe: How to rename a table in a database? Pin
DiWa16-Apr-03 21:28
DiWa16-Apr-03 21:28 
GeneralRe: How to rename a table in a database? Pin
Paul Selormey17-Apr-03 0:51
Paul Selormey17-Apr-03 0:51 
GeneralRe: How to rename a table in a database? Pin
Paul Selormey17-Apr-03 1:50
Paul Selormey17-Apr-03 1:50 

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.