sql server column with firstname lastname

Posted on 2010-01-05
Last Modified: 2012-05-08
create a new table
      [ShipFirstName] [varchar](100) NULL,
      [ShipLastName] [varchar](100) NULL,

are in the same column separated by a space

CREATE TABLE [dbo].[names](
      [id] [int] IDENTITY(1,1) NOT NULL,
      [ShipFirstName] [varchar](100) NULL,
      [ShipLastName] [varchar](100) NULL,
Question by:rgb192
    LVL 15

    Accepted Solution

    You can concatonate first and last during a select query or if you want to create a new table based on another, you can concatonate first and last during the creation (I'd create it then do a bulk insert which uses the concatonation in the bulk insert.

    LVL 92

    Expert Comment

    by:Patrick Matthews
    Hello rgb192,

    With respect,

    1) The structure of your question looks very much like a test/homework question and

    2) Why would you even want to do that in the first place?  It would take your nice, atomized data and destroy
    its atomicity...


    LVL 15

    Expert Comment

    by:David L. Hansen
    I often do such concatenations in a view instead of building it permanently into a table.

    Author Comment

    not a homework assignment

    Author Closing Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    by Mark Wills PIVOT is a great facility and solves many an EAV (Entity - Attribute - Value) type transformation where we need the information held as data within a column to become columns in their own right. Now, in some cases that is relatively…
    When writing XML code a very difficult part is when we like to remove all the elements or attributes from the XML that have no data. I would like to share a set of recursive MSSQL stored procedures that I have made to remove those elements from …
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now