corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » Very simple MS SQL question


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author Very simple MS SQL question
pow
Premium Member

Avatar

Registered: 11th Sep 06
Location: Hazlemere, Buckinghamshire
User status: Offline
27th Sep 13 at 13:16   View Garage View User's Profile U2U Member Reply With Quote

I've just started to mess around with MS SQL (Express for now) 2012 and am playing around creating takes and running queries. One thing I'm trying to do is get a users Full Name into an entry.

If I use SUSER_SNAME() I get the correct username in the form DOMAIN\user. What I want is the full name that is tied to that username. So currently I'm getting DOMAIN\pow but what I really want is David Pow

How do I do it?
evilrob
Premium Member

Avatar

Registered: 16th Mar 12
Location: Your mum's house
User status: Offline
27th Sep 13 at 15:28   View Garage View User's Profile U2U Member Reply With Quote

Are your user names DOMAIN\firstname.lastname?
pow
Premium Member

Avatar

Registered: 11th Sep 06
Location: Hazlemere, Buckinghamshire
User status: Offline
27th Sep 13 at 15:35   View Garage View User's Profile U2U Member Reply With Quote

No, hence why I want the full name
VrsTurbo
Premium Member

Registered: 8th Jun 10
User status: Offline
27th Sep 13 at 16:34   View Garage View User's Profile U2U Member Reply With Quote

Create link server to query AD then use variables and open query.

 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
FAO: Programmers barteh Geek Day 6 777
6th Nov 07 at 14:02
by barteh
 
System Center Configuration Manager 2007 Pablo Geek Day 13 349
6th Feb 08 at 14:39
by Pablo
 
Php help? (mysql_num_rows) Whittie Geek Day 17 1506
15th Jan 10 at 14:38
by Dom
 
dash removal Johnston_888 General Chat 63 8154
12th Oct 14 at 16:33
by taylorboosh
 
SQL Experts Bart Geek Day 1 257
7th Jul 11 at 18:09
by Mike2k111
 

Corsa Sport » Message Board » Off Day » Geek Day » Very simple MS SQL question 29 database queries in 0.0097308 seconds