Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert/Update Statement

Status
Not open for further replies.

JeffOrtho

IS-IT--Management
Jan 9, 2013
13
US
I have a table with 20 rows. I want to import 10k+ rows from an Excel. Do i have to have every column on the excel to match the table in SQL, not just the ones i want to insert? I'm just confused why i cannot get this to import.

I want to be able to just say insert these items into this table. I'm thinking it may be because i dont have the same columns in excel to match the SQL table.
 
You don't really mention how you are importing the records but you can import only the fields you need.

For more specifics you might want to post a data sample and let us know what method your using.

Simi
 
I am using the SQL import wizard to create my table with the data i want to then import into my table needing the updated info.

This is the table i want to update. Some of the items are not in that table yet, will an insert have to be done in order to then do an update?
SQL:
ITEMNMBR	RBI_Kit_Type	RBI_Dangerous_Code	RBI_Is_Special_CB	RBI_Expiry_Date_CB_Requi	RBI_UPCEANISBN	RBI_UPCA_Number	RBI_EAN13_Number	RBI_Manufacturer_Number	RBI_Cubage	RBI_Height	RBI_Width	RBI_Length	WMI_Handle_Code	WMI_Inner_Pack_Size	WMI_Middle_Pack_Size	WMI_Outer_Pack_Size	RBI_Value_Price	DEX_ROW_ID
OT-2200                        	0	2	0	0	               	               	               	12345	0	0	0	0	 	0	0	0	0	3
P033-19822/C                   	0	1	0	0	               	               	               	12345	0	0	0	0	 	0	0	0	0	4
P033-19822/P                   	0	1	0	0	               	               	               	12345	0	0	0	0	 	0	0	0	0	5

This below is the information i want to update in the table above.
SQL:
ITEMNMBR	RBI_LENGTH	RBI_WIDTH	RBI_HEIGHT	RBI_CUBAGE
014-114  	1.5	1.75	0.75	1.96875
014-115  	1.5	1.75	0.75	1.96875
014-214	        1.5	1.75  	0.75	1.96875

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top