Assuming the FirstName
is all of the characters up to the first space:
SELECT
SUBSTRING(username, 1, CHARINDEX(' ', username) - 1) AS FirstName,
SUBSTRING(username, CHARINDEX(' ', username) + 1, LEN(username)) AS LastName
FROM
whereever
More Related Contents:
- T-SQL: Export to new Excel file
- SQL MERGE statement to update data
- How to get the last record per group in SQL
- How to get week number of the month from the date in sql server 2008
- T-SQL strip all non-alpha and non-numeric characters
- Avoiding IF ELSE due to variable been NULL
- Recursive Child/Parent queries in T/SQL
- to select all the employees who have joined most recently under king
- Unpivot with column name
- Get first day of week in SQL Server
- How to connect to local instance of SQL Server 2008 Express
- Convert varchar into datetime in SQL Server
- Export query result to .csv file in SQL Server 2008
- Check if a row exists, otherwise insert
- Convert Xml to Table SQL Server
- TSQL: How to convert local time to UTC? (SQL Server 2008)
- How can I load a large flat file into a database table using SSIS?
- Script to kill all connections to a database (More than RESTRICTED_USER ROLLBACK)
- How does this CASE expression reach the ELSE clause?
- TransactSQL to run another TransactSQL script
- How to convert number of minutes to hh:mm format in TSQL?
- Store multiple bit values in a single table column
- SQL Server equivalent to MySQL enum data type?
- Grant SELECT permission on a view, but not on underlying objects
- Using IF ELSE statement based on Count to execute different Insert statements
- Restoring database from .mdf and .ldf files of SQL Server 2008
- Restrict SQL Server Login access to only one database
- Average of multiple columns
- How can I get a trigger to fire on each inserted row during an INSERT INTO Table (etc) SELECT * FROM Table2?
- What are row, page and table locks? And when they are acquired?