|
update table
set name = name + '123'
|
|
|
|
|
Thanks a lot....
now my sp is working fine
|
|
|
|
|
Hi All,
i Want to know that how can save the List in MS-Access Database?
i m using a CListCtrl for the list.
please help me fo this ,
i m waiting for ur helpful answers.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
I am joining two tables with INNER JOIN and I am getting duplicate entries.
I used DISTINCT but its not working.
Do we have some other keywords for the same?
Thanks in advance,
|
|
|
|
|
You do not get duplicate entries if you can't DISTINCT them away.
At least one of the values in your SELECT list differs from the others, making the rows different.
DISTINCT will remove "duplicated" rows.
|
|
|
|
|
try to use TOP 1
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
Hi, Try in this way, I am not sure this will resolve your question. Distinct will impact on performance ( number of cpu reads)
WHILE EXISTS (select * FROM Table1 GROUP BY col1,col2.., HAVING count(*) > 1)
BEGIN
SET ROWCOUNT 1
DELETE e FROM Table1 e.empid WHERE EXISTS (select empid from @tab i where i.empid = e.empid AND i.name = e.name GROUP BY i.empid, i.name HAVING count(*) > 1)
SET ROWCOUNT 0
END
|
|
|
|
|
Hello,
In deploying my application it is required that it attach a sql server database to the .net framwork sql engine because there is no servers in the client computer.
How can I accomplish this task (deploying the app with out having a full running instance of sql server)?
Thanks.
Dad
|
|
|
|
|
AFAIK you need a SQL server installed.
If you need to deploy a SQL Server, take a look at the Express Edition which IIRC is free to use.
|
|
|
|
|
the error is _CrtIsValidHeapPointer function returning FALSE.
for example:
<pre>ResultSet *rs = stmt->executeQuery();
int nCol = 0;
{
vector<MetaData> vMetaData = rs->getColumnListMetaData();
nCol = (int) vMetaData.size();
} //now deconstructing vMetaData, the error is like this:</pre>
Debug Assertion Failed!
Program: ...
File: dbgheap.c
Ling: 1132
Expression: _CrtIsValidHeapPointer(pUserData)
windwosXP sp3 vs.net 2003
Oracle11g OCCI
|
|
|
|
|
Try in the C/C++ forum.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
thanks
but it is no use in my code:
ResultSet *rs = stmt->executeQuery();
int nCol = 0;
try
{
vector<MetaData> vMetaData = rs->getColumnListMetaData();
nCol = (int) vMetaData.size();
}
catch (...)
{
}
the errors are the same as before!
|
|
|
|
|
I have a SQL result coming as
ID Created Status
================================================
1 2008-05-10 Active
4 2008-05-11 Active
3 2008-05-12 Inactive
2 2008-05-13 Inactive
I want the same to come as (Order by ID)
ID Created Status
================================================
Con1 2008-05-10 Active
Con2 2008-05-13 Inactive
Con3 2008-05-12 Inactive
Con4 2008-05-11 Active
How do i do this using SQL
|
|
|
|
|
Are you wanting this for display purposes only or for saving to a DB?
If you are inserting you should be able to do something like INSERT INTO tbl_WHATEVER "CON" & ID
I think you could do something similar for display purposes:
SELECT ("Con" & ID, Created, Status)
FROM tbl_WHATEVER
SORT ASC
I haven't tried it though.
|
|
|
|
|
Try this:
Select 'Con' + convert(varchar(20),ID), *
From TableName
Order by ID (desc)
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
select 'Con'+cast(ID as varchar),Created,Status from myTable order by ID asc
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
Hi all,
I have a simple mysql query which returns user data stored in some table, e.g:
SELECT *
FROM cpa_candidate c
WHERE c.firstname like 'john' AND
c.lastname like 'smith'
The above query runs with no problems and returns data as expected.
Now I want to use variables in the query for the values in the criteria:
set @fname = 'john';
set @lname = 'smith';
SELECT *
FROM cpa_candidate c
WHERE c.firstname like @fname AND
c.lastname like @lname
When I execute the query above, an empty recordset is returned. What could be causing this? I tried casting the variables to varchar - no help, I even tried enclosing them in quotes - no help! Someone please help me
Thank you in advance!
|
|
|
|
|
declare @fname as varchar(255)<br />
decare @lname as varchar(255)<br />
set @fname = 'john';<br />
set @lname = 'smith';<br />
<br />
SELECT * FROM <br />
cpa_candidate c <br />
WHERE c.firstname like '%' + @fname + '%' AND <br />
c.lastname like '%' + @lname '%'
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
Thanks for the response man, but I have tried this and it did not work...
|
|
|
|
|
This is a reserved word that is documented nowhere in the known universe.
Semicolons: The number one seller of ostomy bags world wide. - dan neely
|
|
|
|
|
Well, the 2005 documentation points me towards it being used in VisualFox exception handling.
It is also possible it is just reserved for the sake of future implementation, or because they thought it would be used in future implementations.
Can't find much information about it either though.
|
|
|
|
|
What documentation? SQL Server BOL states in one or two places only that it is a reserved word. I'm sure other systems have their own uses of reserved words like lineno, but I was asking what it means in T-SQL.
Semicolons: The number one seller of ostomy bags world wide. - dan neely
|
|
|
|
|
I have a join on two tables, for document header and line data:
select * from DocumentHeader dx inner join DocumentLine ix on ix.DocID = dx.DocID
I need to get sequential numbering for all DocumentLine records, as below, where all <H> lines are from table DocumentHeader and all <L> lines from DocumentLine. Note how the numbering does not restart for each new document header.
"X","@<H>","","R","2342",2008.02.29,2008.05.18,"",5016,"ZAR" "X","@<L>",1,290002,2508 "X","@<L>",2,290002,2508, "X","@<H>","","R","2342",2008.02.29,2008.05.18,"",2508,"ZAR" "X","@<L>",3,290002,2508
Any ideas of how I could achieve that in a query? BTW, I'm not asking for my work to be done, I am also hard at work trying to find a solution to this.
Semicolons: The number one seller of ostomy bags world wide. - dan neely
|
|
|
|
|
Solved! I create a temp table called #LineNumber with an identity column, LineNumber for each DocItemID in DocumentLine and just join to the temp table in my main query.
Semicolons: The number one seller of ostomy bags world wide. - dan neely
|
|
|
|
|
If you are using SS2005 then look at the row_number (also rank and partition) function. It will allow you to do this without the temp table.
Also look at a table variable, you can have the same identity field without having to create the table in the temp DB.
Never underestimate the power of human stupidity
RAH
|
|
|
|