Click here to Skip to main content
15,891,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Dear friends I am NEW to asp.net(2mnths)

string query=Select FID , Fname, Subject FROM [Learn].[dbo].[Fdetail] where Subject IN('DBMS')

in above statement i want to add those selected values in another table

how can get these value..thanks in advance
Posted

Learn to do it yourself :
Step 1: aspnet_dbconnection[^]
Step 2: sql_injection[^]
 
Share this answer
 
USE THIS TEXT COMMAND

INSERT INTO table2 (FID , Fname, Subject)
SELECT FID , Fname, Subject FROM table1
 
Share this answer
 
try this.
SQL
Select FID , Fname, Subject into AnotherTable FROM [Learn].[dbo].[Fdetail] where Subject IN('DBMS')
 
Share this answer
 
Comments
bhushan sinkar 24-Jan-14 4:34am    
dear friends in table2 i have other columns except FID,Fname,Subject ..
when i try to insert values in remaining columns i get error

plz help me out...
Karthik_Mahalingam 24-Jan-14 4:46am    
if you want to copy, the table schema of both should be similar, then only the exact data will be dumped to another table...
else it will result in some invalid data.
bhushan sinkar 24-Jan-14 4:58am    
Thnks to all dear frds...i have some column not null...i rectify it

thnks once again...hv gd day
Karthik_Mahalingam 24-Jan-14 5:04am    
welcome :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900