Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: SQL2000SQL-server-2005, +
I am planning to attach the application user name along with the connection string as follows
Application Name=MyApplicationUserName;Data Source=ServerName; Initial Catalog=DatabaseName; Integrated Security=SSPI; 
So that I could set up default value rather than sending it from the front-end
CREATE TABLE Persons
(
P_Id int NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Address varchar(255),
InsertedBy varchar(255) DEFAULT  APP_NAME()
)
Please advise if there's any better way of doing it.
 
ThanX in advance
Posted 10-Apr-12 8:37am
appyks629
Edited 10-Apr-12 13:15pm
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

CREATE TABLE Persons
(
P_Id int NOT NULL,
LastName nvarchar(255) NOT NULL,
FirstName nvarchar(255),
Address nvarchar(255),
CreatedBy int,
CreatedOn datetime DEFAULT getdate(),
UpdatedBy int,
UpdatedOn datetime 
)
 

By doing this you can track the user (when multiple user have access to the same page) if it gets updated.
 

Regards,
Ashish
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 710
1 OriginalGriff 543
2 Abhinav S 318
3 thatraja 245
4 Tadit Dash 140
0 Sergey Alexandrovich Kryukov 8,322
1 OriginalGriff 4,790
2 Peter Leow 3,784
3 Maciej Los 3,515
4 Er. Puneet Goel 3,107


Advertise | Privacy | Mobile
Web03 | 2.8.140415.2 | Last Updated 11 Apr 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid