• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 167
  • Last Modified:

sql server column with firstname lastname

create a new table
where
      [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,
) ON [PRIMARY]
0
rgb192
Asked:
rgb192
  • 2
  • 2
1 Solution
 
David L. HansenProgrammer AnalystCommented:
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.

see: http://www.sqlservercentral.com/Forums/Topic598738-145-1.aspx
0
 
Patrick MatthewsCommented:
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...

Regards,

Patrick
0
 
David L. HansenProgrammer AnalystCommented:
I often do such concatenations in a view instead of building it permanently into a table.
0
 
rgb192Author Commented:
not a homework assignment
0
 
rgb192Author Commented:
thanks
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now