Click here to Skip to main content
15,897,273 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
i want to write the querry in sql server in which I WANT TO GET "MACHINE NAME", "USER NAME", "CURRENT DATE" AND "IP ADREESS"
Posted

You should be more specific, which user name?

However for the rest you can take a look at this:

SELECT @@SERVERNAME


http://msdn.microsoft.com/en-us/library/aa933172(v=sql.80).aspx[^]

Second thing, Google is your friend. Take a look at this:

http://stackoverflow.com/questions/142142/sql-query-to-get-servers-ip-address[^]

Current date:
SELECT GETDATE()


If you have spent 90 sec on google you could got the same answers!
 
Share this answer
 
Try
to get Machine Name
SQL
select host_name()


to get user Name
SQL
SELECT SYSTEM_USER
select ORIGINAL_LOGIN()
SELECT SUSER_SNAME()


to get Current Date
select  Getdate()


to get IP address
Refer Link:- http://beyondrelational.com/blogs/madhivanan/archive/2007/08/27/get-ip-address.aspx[^]
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900