SQL insert error
Below code saying error incorreect syntax near "Main" INSERT INTO tbl ( 'Week', Main, a, b, c, d, e ) Select 'Week', Main, a, b, c, d, e FROM tbl_link ...
Below code saying error incorreect syntax near "Main" INSERT INTO tbl ( 'Week', Main, a, b, c, d, e ) Select 'Week', Main, a, b, c, d, e FROM tbl_link ...
Will the isSelect-method of QSqlQuery return true when a stored procedure containing a SELECT-statment is executed on sqlserver? ...
In MySQL (particularly InnoDB) is there any way to know which tables were affected (updated / deleted rows) by CASCADE UPDATES / DELETES or regular triggers? ...
I have two columns: beginTime and duration. I'm trying to calculate the endTime. The problem is that i get empty results back. I have tried several things. DATE_ADD(startTime, INTERVAL `duration` MINUTE) AS endTime DATE_ADD(startTime, INTERVAL '10' MINUTE) AS endTime DATE_ADD(startTime, INTERVAL 10 MINUTE) AS endTime But everytime ...
Hi, insert into XYZ(col1, col2) values (1,2) update XYZ set ... where col1 = 1 COMMIT As in can see in the above code, we havent yet commited our insert statement, and we performed an update operation on the same row, and finally we commit the whole batch. What exactly would happen in this case? Are there any chances of loosing data ...
working with: ASP.net using VB.net connecting to MS SQL Server What I'm trying to do is take the result of a SQL select query and place that in a string variable so it can be used in things like a textbox or label. code so far that doesn't work... Imports System.Data.SqlClient Partial Class dev_Default Inherits System.Web.UI.Page...
In oracle I can specify the columns, which should induce a firing of a trigger: create or replace trigger my_trigger before update of col1, col2, col3 on my_table for each row begin // the trigger code will be executed only if col1 or col2 or col3 was updated end; Now I want to do the following: I don't want the trigger to fire, whe...
Hi, I'm working on a employee booking application. I've got two different entities Projects and Users that are both assigned a variable number of Skills. I've got a Skills table with the various skills (columns: id, name) I register the user skills in a table called UserSkills (with two foreign key columns: fk_user and fk_skill) I reg...
I've got a trigger in a sql server table. This trigger has disappeared. Is there something systematic that might be causing it to be deleted? There is no replication on this db. ...
Hi, In MS Access I have a query wich takes two parameters and I'd like to get the result of this query in a ADO.NET DataSet with a TableAdapter. In Visual Studio Express 2008 I can't select the query in the assistant. In fact it seems I can't select any queries with parameters. Is there any way to use am Access parameterized query in A...
This is the first time I've dealt with Oracle, and I'm having a hard time understanding why I'm receiving this error. I'm using Oracle's ODT.NET w/ C# with the following code in a query's where clause: WHERE table.Variable1 = :VarA AND (:VarB IS NULL OR table.Variable2 LIKE '%' || :VarB || '%') AND (:VarC IS NULL OR table.Variable3...
While validation can prevent most SQL errors, there are situations that simply cannot be prevented. I can think of two of them: uniqueness of some column and wrong foreign key: validation cannot be effective as the an object can be created or deleted by other parties just after validation and before db insertion. So there are (at least) ...
In SQL Server, the following works: sp_help MyProc sp_depends MyTable But if you include the owner, it fails with a syntax error: sp_help dbo.MyProc sp_depends dbo.MyTable It makes you put the param in quotes for it to work. Yet, I could do the following no problem: exec dbo.MyProc Why the inconsistency? Is there a reason? ...
I am building a table for tracking the history of particular objects in my database. Currently I have following columns: HistoryId int IDENTITY(1,1) NOT NULL HistoryDate datetimeoffset(7) NOT NULL HistoryTypeId int NOT NULL HistoryDetails nvarchar(max) NULL For the most part each history item will be self-explanatory through the His...
I have a Firebird database (running on server version 2.1.3) and am connecting to it with Delphi 2007 using the DBExpress objects (using the Interbase driver) One of my tables in the database looks something like this CREATE TABLE MYTABLE ( MYDATE Timestamp NOT NULL, MYINDEX Integer NOT NULL, ... Snip ... PRIMARY KEY (MYDAT...
I am in need of an application that can periodically transmit select rows from a PostgreSQL database across a network to a second PostgreSQL server. Typically these will be the most recent row added, pulled and transmitted every 10-30 seconds. The primary servers run in a MS Windows environment with a high-latency, and occasionally int...
I have 3 very large stored procedure I need convert from SQL Server to Oracle, is that a converter out there that anyone has tried that would work for this? I really don't want to have to do this manually if there is another option. ...
I have three tables being used for this problem: songs, blacklist, and whitelist. The songs table has a column named "accessType" which stores one of these four values: public, private, blacklist, whitelist. I'm trying to fetch a list of all the songs a user may access. The first condition is that songs.accessType != private. Here comes ...
I am trying to do a bulk upload into a SQL server DB. The source file has duplicates which I want to remove, so I was hoping that the operation would automatically upload the first one, then discard the rest. (I've set a unique key constraint). Problem is, the moment a duplicate upload is attempted the whole thing fails and gets rolled b...
How would I go about doing a query that returns results of all rows that contain dates for current year and month at the time of query. Timestamps for each row are formated as such: yyyy-mm-dd I know it probably has something to do with the date function and that I must somehow set a special parameter to make it spit out like such:...