|
hi all,
I want to append the value '123' with the value in column A. Column A is having few NULL value rows. NUll values should be replaced by the new value and others should be appended. How to do this in all rows of column A?
Thanks in advance
|
|
|
|
|
Gosh you really need to pick up a basic book on SQL!
UPDATE myTable
SET myColumn = ISNULL(myColumn,'') + 'abc'
|
|
|
|
|
hi all,
i created table like that below
create table extable(empid int primary key identity(1,1),empname varchar(50) not null,salary money not null)
when i execute sp_help it already created one index for that table.
sp_help extable
PK__extable__3D9E16F4
Is it clustered index or non-clustered index ?
what is the use of that index, how can improve that performance of the retrieving data
This is haneef.............................................................
|
|
|
|
|
The primary key is, by default, created as a clustered index. It will be used for lookups using "empid" in your case.
Improving performance for retrieving data depends on how you lookup the data. For example, if you tend to lookup using empname put an index on that. If you lookup using empname and salary then create an index which includes both those columns.
This is obviously a simplistic answer - indexing is a fine art where you must balance performance.
|
|
|
|
|
Hi,
The clustered index is created on primary key. a table can have only one clustered index the reason the data is arranged in physical order, sql server will maintain index record this will contain all index values mean empid in particular order. When we fire an select query this will arrange the result set in following format and fetch the corresponding record. The proper implementation of clustered index will reduce the query response time.
The disadvantage is All the index values should present in Index Record Table( here is empids)
empid
101 ---------> 101 XXX India
102 ---------> 102 YYY USA
103 ---------> 103 ZZZ UK
Non Clustered index on table will arrange result set in heap sorting order this mean not all index values should not present in Index Record. This will occupies less memory space. We will usually created on Non primary keys.
-.Net Professional.
modified on Tuesday, May 20, 2008 3:10 AM
|
|
|
|
|
hi all,
i want to update the column value with the value already in that column in a table(based on where condition)
For example,
table 1
--------
id name
1 abc
2 xyz
Now i'm appending the value '123' with the value in the column 'name'. the result should be like
id name
1 abc123
2 xyz123
How to do this......
|
|
|
|
|
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...
|
|
|
|