SELECT col1, col2
INTO dbo.TableTwo
FROM dbo.TableOne
WHERE col3 LIKE @search_key
SELECT ... INTO ...
is for temporary tables which is why I get an error that dbo.TableTwo
already exists.dbo.TableOne
into dbo.TableTwo
?
insert into Gengl_Del Select Tdate,DocNo,Book,GlCode,OpGlcode,Amt,Narration
from Gengl where BOOK='" & lblBook.Caption & "' AND DocNO=" & txtVno.Text & ""
select
into existing table database..existingtable
from database..othertables....
SELECT
ID = IDENTITY(INT, 1, 1),
name
INTO table2
FROM table1