User-Defined Tables

I need to create a user defined table to insert data for two additional faculty members into my adjuncts table.
My table is set up like this:

(Faculty_ID Char(1),
LastName VARCHAR(20),
FirstName VARCHAR(20),
Department VARCHAR(10),
Campus VARCHAR(10),
Term CHAR(1));
jphilliAsked:
Who is Participating?
 
Kyle AbrahamsConnect With a Mentor Senior .Net DeveloperCommented:
select top 1 * itno #tmp from <table>

delete from #tmp

#tmp is now an exact copy of your table.


insert into #tmp (Faculty_ID, LastName, FirstName . . .)
values ('A', 'AB', 'ABC'. . . )

insert into <table> select * from #tmp
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Okay.  The below T-SQL creates the table.   Replace YourTableName with whatever you want to name it.

IF OBJECT_ID('YourTableName') IS NOT NULL
      DROP TABLE YourTableName
GO

CREATE TABLE YourTableName
      (Faculty_ID Char(1),
      LastName VARCHAR(20),
      FirstName VARCHAR(20),
      Department VARCHAR(10),
      Campus VARCHAR(10),
      Term CHAR(1))

>to insert data for two additional faculty members into my adjuncts table.
So .. you have faculty and adjuncts tables?  More details please.
0
 
jphilliAuthor Commented:
Thank you very much!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.