Search code examples
sqlsql-serversql-insertcreate-table

Sql Create Table Code Failing


For the life of me I don't know why the code below is failing. Any input would be greatly appreciated. Many thanks.

Create table #t_dem_pflow               
(unit varchar(10),              
source varchar(7))              

insert into #t_dem_pflow                
(unit, source)              
values  


insert into #t_dem_pflow                
(unit, source)              
values  


/*      

insert into #t_dem_pflow                
(unit, source)              
values          
*/          

Create table #t_dem_decsvc          
(unit varchar(10),          
source varchar(7))          


insert into #t_dem_decsvc           
(unit, source)          
values          


Create table #t_dem_InUnsched           
(unit varchar(10),
source varchar(7))


insert into #t_dem_InUnsched
(unit, source)
values

error message:

Msg 156, Level 15, State 1, Line 10 Incorrect syntax near the keyword 'insert'.

Msg 156, Level 15, State 1, Line 22 Incorrect syntax near the keyword 'Create'.

Msg 156, Level 15, State 1, Line 32 Incorrect syntax near the keyword 'Create'.

Msg 102, Level 15, State 1, Line 38 Incorrect syntax near 'values'.


Solution

  • Your insert statements are incomplete..

    Your current syntax:

    insert into #t_dem_InUnsched (unit, source) values
    

    What it should be:

    insert into #t_dem_InUnsched (unit, source) values ('UNIT NAME', '/SOURCE')