Another method is to use app_name() function. App_name() function is used to return the name of the application from which data come. Consider the following example
declare @t table(
userid int,
timein datetime,
timeout datetime,
source varchar(200)
default app_name()
)
insert into @t(userid,timein,timeout)
select 1001,'20100710 08:30:20','20100710 18:45:00'
select * from @t
The result is:
userid timein timeout source
------ ------------------- ------------------- ------------------------
1001 2010-07-10 08:30:20 2010-07-10 18:45:00 Microsoft SQL Server
Management Studio - Query
Read more: Beyond Relational