Solved

500pts SQL Copy Tables, in SQLite, URGENT PLEASE

Posted on 2006-11-19
6
212 Views
Last Modified: 2008-03-06
Hi Im using SQLite for one of my project
SQLite is similar to MSSQL, but less features

I have TableA with X, Y , Z Columns
and TableB with X,Y,Z and Q Columns

I want to copy all the rows with Q=1 in TableB to TableA

Whats the fastes way to do this?

Any method without using recordset?
Please help
Udana
0
Comment
Question by:udanabanana
  • 3
  • 2
6 Comments
 
LVL 9

Accepted Solution

by:
dduser earned 500 total points
Comment Utility
Write this query.

Insert into TableA(X,Y,Z)
Select X,Y,Z from TableB where Q = 1

Regards,

dduser
0
 

Author Comment

by:udanabanana
Comment Utility
so in VB is this like
con.execute("Insert into TableA(X,Y,Z) Select X,Y,Z from TableB where Q = 1")
Am I correct?
0
 
LVL 9

Expert Comment

by:dduser
Comment Utility
I am not sure in VB, but you can try out...

Regards,

dduser
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 9

Expert Comment

by:dduser
Comment Utility
Yes you can do it.., i just asked my colleague who is Programmer i am a DBA

Regards,

dduser
0
 
LVL 7

Expert Comment

by:TRACEYMARY
Comment Utility
make the select command above a stored procedre

create procedure  sp_myname

as
   insert into
   select.......

then in vb your set up the connection string and just do
   exec sp_myname

0
 

Author Comment

by:udanabanana
Comment Utility
Thanks guys
all work good
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now