Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Insert Query Help

Author  Topic 

anuraag205
Yak Posting Veteran

58 Posts

Posted - 2013-06-01 : 08:00:29
Can any one please help me on INSERT

am trying to insert but pops out with error.

here is the query.

If already have similar issues solved please provide the link.

am only a select user till yesterday..so never thought of gng to learn about insert stuff.

=======================================================
INSERT INTO
pk_SupplierLocationID,fk_SupplierID,fk_CountryID,fk_LocationID,IsAirport,IsMeetnGreet,
IsDeskInTermainl,Description,IsShutOnHolidays,Address1,Address2,Address3,City,State,
PostCode,ContactEmailID,ContactPhone,PublicNote,PrivateNote,WorkingHoursSummary,
IsShowOnWebSite,IsActive,IsDeleted,CreateUserID,CreateDateTime,UpdateUserID,UpdatedDateTime
from dbo.tblSupplierLocation where fk_SupplierID in (423)

SELECT
pk_SupplierLocationID, fk_SupplierID, fk_CountryID, fk_LocationID,IsAirport,
IsMeetnGreet, IsDeskInTermainl, Description, IsShutOnHolidays, Address1,
Address2, Address3, City, State, PostCode, ContactEmailID, ContactPhone,
PublicNote, PrivateNote, WorkingHoursSummary, IsShowOnWebSite,IsActive,
IsDeleted, CreateUserID, CreateDateTime, UpdateUserID,
UpdatedDateTime

from dbo.tblSupplierLocation where fk_SupplierID in (414)
=========================================================================

Thanks in advance

Thanks

MuMu88
Aged Yak Warrior

549 Posts

Posted - 2013-06-01 : 09:04:05
INSERT INTO syntax is

INSERT INTO [TABLE NAME] ([Column names....])
SELECT .....

Refer to your other posting:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=185746

and aslo there is a good description of this topic at:

http://blog.sqlauthority.com/2007/08/15/sql-server-insert-data-from-one-table-to-another-table-insert-into-select-select-into-table/
Go to Top of Page
   

- Advertisement -