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
 General SQL Server Forums
 Script Library
 SQL - Insert into, Values, & Select script

Author  Topic 

mintz87
Starting Member

2 Posts

Posted - 2004-10-06 : 12:25:27
hello all -

i am trying to insert one column of data from another table and then load the rest of the columns with the data that is in the quotes. i am using ms access to test my script and of course access doesn't like my script. this data has to inputted at the same time due to the required fields in the table. any help will be much appreciative and of course i am on a tight deadline.


INSERT INTO NUMBER_PORTABILITY_AVAIL_ASSOC [ACAT_ID, NPT_TYPE, UPD_CNT, LAST_CHG_OPER, LAST_CHG_DATETIME, ACCESS_LEVEL]
VALUES
(SELECT ID
FROM PTDSP0_AVAILABILITY_CATALOG
WHERE CSC_SERVICE_CODE='#Y'), 'LNP', '1', 'CSG&TICKET', SYSDATE, 'NONE';


thanks in advance
Jr

mintz87
Starting Member

2 Posts

Posted - 2004-10-06 : 16:41:43
I found the resolution:

INSERT INTO NUMBER_PORTABILITY_AVAIL_ASSOC (ACAT_ID, NPT_TYPE,
UPD_CNT, LAST_CHG_OPER, LAST_CHG_DATETIME, ACCESS_LEVEL)
SELECT ac.ID, 'LNP', '1', 'CSG_TICKET', SYSDATE, 'NONE'
FROM AVAILABILITY_CATALOG ac
WHERE ac.CSC_SERVICE_CODE='#Y';

I hope this helps everyone
Go to Top of Page
   

- Advertisement -