Working on joining up two legacy DB systems into new database where I can avoid silly problems like what you see below. I am trying to do a join on two tables where the text data is different and it generally works except for instances where the actual full last name wasn't used in the other table. There are other columns that are part ...
A C# program I am working on will need to export data to one or more tables of data. Some columns of these tables will be related to one another, such that the ID column of of one table may be reference by the cell of another table. This seems like the common case for setting up a DataRelation. But I'm trying to understand how these rela...
Hi all.
I've managed to do some ant-script to populate my databases.. (simple script that runs some .sql files, like 'create', 'populate', 'drop', etc.)
Is there any way in hell that an ant-script can create the database itself from scratch? This is for JavaDB-Derby (from the glassfish bundle). Since it's a project for university, we f...
I've the following method which allows me to protect MySQL entities:
public function Tick($string)
{
$string = explode('.', str_replace('`', '', $string));
foreach ($string as $key => $value)
{
if ($value != '*')
{
$string[$key] = '`' . trim($value) . '`';
}
}
return implode('.', $string);
}
...
Hi,
I have one source database, which I want to copy (table structures) to new database.
I need to execute this package at least 50 times.
Each time my source database is same, but destination database varies.
So I decided to create a DTS package that will receive a destination database name as a parameter.
Que: Is is possible to pa...
I wonder what are your most common sql optimization that you used.
...
Hi all, could you point me to a good place to start with Oracle stored procedures syntax/usage? I can't seem to find any good place there. I'm fairly proficient in (java, C/C++) programming and I do know enough SQL for my needs right now, but I've been suggested to use stored procedures to do my business, which is:
Take results from a q...
Hi,
I have inserted some records in one of my table which are upto 5000.
But now i realize that these records should not be inserted in this table. I can't delete the records one by one. Or can't distinguish the inserted records for the previous records in the table.
How can i rollback this insert statement, so that my table return t...
I have a table with lots of columns, say I have columns
A, B, C, D
in each of these columns, only one column in any one record will be filled and the others will always be NULL.
I need a select statement that will return the Column of the non null Column.
I've tried coalesce, but this return a value, not the column to which the ...
I'm in the unfortunate situation of developing an app using SQL Server 2005 in the development environment but SQL Server 2000 on the production server. I have a fairly complex SELECT query which works fine on the development/test server but falls over in the production environment:
SELECT tbl_questions.Question, tbl_questions.Question...
Hi,
Please have a look at the below SQL code.
DECLARE @RET TABLE(OID BIGINT NOT NULL,rowid bigint identity);
DECLARE @ResultTbl TABLE(OID BIGINT,sOID BIGINT,partkey bigint);
DECLARE @PATOID as VARCHAR(4000)
SET @PATIENTOID= '95,96,192,253,110,201,201,83,87,88,208,208,208,208'
INSERT INTO @RET SELECT OID FROM dbo.FGETBIGINTLIST(@PATOI...
I wanted to know what would be the easiest / best way to get a dataset contained within a datagridview into a sql database.
Points to note:
The data comes from a CSV file that is imported into the application.
The user then has the option to modify cell data
They then press a button and hopefully upload to sql table
It is given that th...
I have below error when i execute the following script;
Could you specify what it is and how it can be resolved?
Insert table(OperationID,OpDescription,FilterID)
values (20,'Hierachy Update',1)
Server: Msg 544, Level 16, State 1, Line 1
Cannot insert explicit value for identity column in table 'table' when IDENTITY_INSERT is set to ...
I'm doing the following query and getting all rows returned, regardless of date:
SELECT DISTINCT p.name, p.category, u.f_name, t.name
FROM (
prizes p, tags t, results r
)
LEFT JOIN
users u
ON (r.user_id = u.id)
LEFT JOIN
f_tag_lookup tl
ON (tl.tag_id = t.id)
WHERE r.tag_id = t.id
...
Hi,
I currently have the following stored procedure;
CREATE PROCEDURE web.insertNewCampaign
(
@tmp_Id BIGINT,
@tmp_Title VARCHAR(100),
@tmp_Content VARCHAR(8000),
@tmp_Pledge DECIMAL(7,2),
--@tmp_Recipients BIGINT,
@tmp_Date DATETIME,
@tmp_Private BIT,
@tmp_Template BIGINT,
@tmp_AddyBook BIGINT
)
AS
...
It is my day for weird errors.
I use a database project and as a part of Post Deployment, we use SQL Scripts to populate data in our tables.
alter authorization on database::atlas to sa;
go
ALTER DATABASE ATLAS SET MULTI_USER WITH ROLLBACK IMMEDIATE;
GO
:r C:\Scripts\Script.DisableTriggers.sql
:r C:\Scripts\dbo\Script.dbo.PaymentMeth...
I'm not responsible for this design, but I've have to extract data from this schema that looks something like this (SQL Server 2000):
CREATE TABLE contract
(
contract_id int,
account_id int, /* account table */
responsible_id int, /* account table */
holding_id int, /* account table */
billingaddress_id int, /* address tab...
I have a query containing three inner join statements in the Where clause. The query takes roughly 2 minutes to execute. If I simply change the order of two of the inner joins, performance drops to 40 seconds.
How can doing nothing but changing the order of the inner joins have such a drastic impact of query performance? I would have th...
I'm trying to find duplicate "keys" so that they can be addressed and made into proper, unique keys.
I recently learned that a HAVING clause can filter the results of an aggregate query by targeting the results of a GROUP BY. You GROUP BY the alleged "key" and HAVING where the count is > 1, and there are your problem rows.
My question ...
I need to get a Bit from a sql server into c#. I tried differnt solutions like:
bool active = rdr.GetSqlBinary(5);
Int16 active = rdr.GetSqlBinary(5);
But can't find any way to get the Bit.
Can someone give an example?
...