How to insert datas from a table to another table ?
Hi, I have two tables : USER and USER_1 I want to insert datas from USER_1 to USER. How to do it ? I try to do it, but without success : INSERT INTO USER WHERE id IN (SELECT * FROM USER_1) ...
Hi, I have two tables : USER and USER_1 I want to insert datas from USER_1 to USER. How to do it ? I try to do it, but without success : INSERT INTO USER WHERE id IN (SELECT * FROM USER_1) ...
I am having trouble with my queries not returning any results. There are no errors in the query but i expect to see a result and i don't get any Here is my table structure CREATE TABLE IF NOT EXISTS `boards` ( `boardid` int(2) NOT NULL auto_increment, `boardname` varchar(255) NOT NULL default '', `boarddesc` varchar(255) NOT NUL...
Hi, I have a question regarding DataBase design. I have a Entity Table named: CARS and I have a Lookup Table named: COLORS Table CARS has: Id, Name and Table COLORS has just: ColorName Table COLORS has a short list of colors, instead CARS could have a long list of entities. CARS has a Primary Key on ID. My questions are: Adding a ...
Hello Guys, I have noticed something over the last few months. Each time we run a script that has a transaction statements let say we stop the query unexpectedly this action actually lock the database. The only way out is to destroy the transaction each time. I have never experience this before even though I have stopped the query in t...
Hi , I know the usage of joins but sometimes i came across such a situation when i was not able to decide which join will be suitable a left or right. Please show me some light. Here is the query where i am stucked SELECT count(ImageId) as [IndividualRemaining], userMaster.empName AS ID#, ...
Is it possible to insert only 100 records at a time per transactionScope? I would like to do things that way to avoid timeouts on my application. using(var scope = new TransactionScope()) { foreach ( object x in list) { // doing insertOnSubmit here } context.SubmitChanges(); scope.Complete(); } So I would...
I have a set of consecutive rows I want to get based upon their primary key, which is an auto-incrementing integer. Assuming that there are no holes, is there any performance between between: SELECT * FROM `theTable` WHERE `id` IN (n, ... nk); and: SELECT * FROM `theTable` WHERE `id` BETWEEN n AND nk; ...
The data from the infile is in the format MM/DD/YYYY how do I tell the control file to load it into the database as YYYYMM? ...
I can't seem to get the GETDATE() syntax to work in a Job Step of type Transact-Sql Script. I put in the command as: execute insertMostRecentUpdate @Data='Data', @Date=GETDATE()-1 But I get an "incorrect syntax near ')'" error when parsing or trying to run it. Any thoughts? ...
I am almost done converting a MySQL app to Linq2SQL but struggling to get my head round this last SQL query SELECT a.URL, b.URL AS DuplicateURL FROM Pages a INNER JOIN Pages b ON a.MetaDescription = b.MetaDescription AND a.PageID <> b.PageID WHERE a.DomainID = @reportid AND b.DomainID = @reportid AND LENGTH(TRIM(a...
I want a single query to produce the following results.. To result in records that are in table1 and in table2 and were not in table3. There are more than 10,000 records in each table..so i am looking for an efficient one. In all the table Cono is the primary key.. In detail with tables. TABLE 1:- Cono th-123 th-124 th-125 T...
Right now I have a project called reports with several reports. In solution explorer it looks like this: Shared Data Sources -- DEV Reports -- Report1 -- Report2 -- Report3 I want to make it look like this and have the same structure carry over to the report manager website when I click deploy. Shared Data Sources -- DEV Folder...
I'm using adapter.InsertCommand to insert some data into a table. The only problem is that it's executed twice, thus giving me double entries in the DB. I've tried following the example in the documentation of adapter.InsertCommand and my own code, but get the same result. This is my code: public class nokernokDAL { SqlConnection ...
I get an "invalid object name" error when I try to insert records into a table that I just created. I am using Microsoft SQL 2000. I am testing all of this on the super user account, so there are no permissions issues. Create the table: CREATE TABLE [table_test2] ( [User 4] [varchar] (10) NULL , [User 3] [varchar] (10) NULL , [U...
Hi all, there is a database of all users in a network,I need to write a query where in when the user logs in.. all the user id's should be displayed in page except his..plzz hlp..thnx ...
Environment: SQL, LINQ, C# I have 2 WinForms running on different computers. They all hit the same database, and it's extremely critical that these forms don't affect the state of the database. I have a couple of questions. WinForm1, the linq queries in this form are all try/catched, if there is a concurrency conflict, I believe thi...
At a new job, I've just been exposed to the concept of putting logic into SQL statements. In MySQL, a dumb example would be like this: SELECT P.LastName, IF(P.LastName='Baldwin','Michael','Bruce') AS FirstName FROM University.PhilosophyProfessors P // This is like a ternary operator; if the condition is true, it returns // th...
Does SQL Server 2008 have a built in debugger? I've got a stored procedure that returns an error if it is fed a string of alphabetic characters (as opposed to numeric) and I'd like to be able to determine what line it gets to before returning an error. ...
Is there a way to copy a SQL Server Database Diagram to another server? I found this and modified it sightly to copy only one diagram: INSERT INTO dbB.dbo.sysdiagrams SELECT [name],[principal_id],[version],[definition] FROM dbA.dbo.sysdiagrams Where name = 'MyDiagramName' But I need to copy it to another Server (Development to Produ...
Hi, I have a table for contents on a page. The page is divided into sections. I want to get the last version for each page-section. Id (int) Version (int) SectionID Id Version SectionID Content 1 1 1 AAA 2 2 1 BBB 3 1 2 CCC 4 2 2 ...