|
No
Vaclav_Sal wrote: 'Table' = 'Condition string'.
but
select * from TableName where ColumnName='ConditionString'
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
hi friends,
I have a problem with web user control with firing events using AjaxPopupcontrol.
my need is, when I mouse hover the text - some other text will display as a
popuptext from database. this is working well in normal aspx pages.
but when I place the popupextenwer and other controls to the Web User Control and
place the web user control to one aspx page. it doesn't work. mouse hover worked but not getting values from database. it returns the following error message!!!
Web Service Call Failed : 500
can any one explain how to do this. giv me a code for this.
Thanks in Advance!!!
Sabarees
|
|
|
|
|
Wow - SQL questions in the ASP.NET forum, and now ASP.NET questions in the SQL forum ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I guess one day he/she will get idea on posting questions in right forum.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
Hello All
I have a server with MS SQL Server 2005 DataBase on it
and I set the connection string for the client to the
database on the server.
now my question is, does the processing (CPU activity) while making
a query (or a transaction) on the server or on the client?
and if it is on the client, how do I change it to the server?
Thanks
|
|
|
|
|
The parsing, compilation and execution of the query is performed on the server, not the client.
|
|
|
|
|
|
hi friend i want to rollback all the transaction of today when there is some Exception thrown while executing today Query how i can do this
in C#.
wasim khan
|
|
|
|
|
I'm not quite sure what yuo are trying to achieve, but you enclose your sql in a try catch with a transaction:
<pre>try
{
SQLConnection conn = new SQLConnection(connectionString);
conn.begintran():
...do your sql
conn.committran();
}
catch (Exception)
{
conn.rollbacktran();
}
finally
{
conn.close();
conn.dispose();
}</pre>
I may have the syntax slightly wrong, I don't have c# on this laptop to check, but yuo should get the idea.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Do you mean you want to roll back an earlier transaction if a later transaction fails?
|
|
|
|
|
|
Hi,
I have a stored procedure that I can not get to work. I am passing a value for the sort order in the GROUP BY clause, but code does not want to create the stored procedure. What am I doing wrong:
create PROCEDURE [dbo].[nsp_SearchManager_716]
(
@RequestedNB VARCHAR(50),
@Sort VARCHAR(50),
@SortOrder VARCHAR(50)
)
AS
SELECT
DISTINCT *
FROM
tblResult WITH (NOLOCK)
WHERE
sRequestedNB = @RequestedNB
ORDER BY
sSalary @SortOrder;
I would appreciate any sort of help.
Thanks
Brendan
|
|
|
|
|
I'm fairly certain that it wont evaulate the variable @SortOrder to get the direction. however you can do
EXEC ('SELECT DISTINCT * '+
'FROM tblResult WITH (NOLOCK) '+
'WHERE sRequestedNB = ' + @RequestedNB +
'ORDER BY sSalary ' + @SortOrder)
which will create then execute the string including evaluating the varibles. you could also put the sring into a varchar varible so that you can do SELECT or EXEC on it for testing purposes. limiting the size of your sort order varible to 3 (ASC, DSC) would help prevent someproblems from wherever this gets called. Hope this works for you.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
The syntax won't work unfortunately - I wish it would. there are two real options, create some dynamic sql or
if @SortOrder = 'ASC'
begin
SELECT
DISTINCT *
FROM
tblResult WITH (NOLOCK)
WHERE
sRequestedNB = @RequestedNB
ORDER BY
sSalary ASC
end
else
begin
SELECT
DISTINCT *
FROM
tblResult WITH (NOLOCK)
WHERE
sRequestedNB = @RequestedNB
ORDER BY
sSalary DESC
end
Alternatively, would it be possible to do the order by back in your code?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
If salary is a number simply multiply -1 or 1 on it for desc and asc sorting.
It is an easy way to do dynamic sorting of number fields (and dates).
|
|
|
|
|
Good idea, never thought about doing that.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
hi..
can anyone help in merging two sqlreports into one report.the one report has landscape orientation and other report has portrait mode.
if it is not possible to merge then how can we use the subreport method to do the same..
|
|
|
|
|
Hi Friends,
I am using SQL Server 2005. I am facing the following problem. I need to know how to apply if condition in query.
I am having one table called Test1 with two fields c_name, average.
CC 7
CC 6
CC 8
IGC 2
IGC 4
IGC 6
HC 4
HC 5
NM 9
NM 6
NC 2
NC 5
NC 9
JC 4
JC 3
JC 1
The above are the values in that table.
Now I am using the following query to display the c_name, count(college) with average >5 group by c_name
select c_name,count(c_name) as Total from test1
where average>5 group by c_name
Result :
CC 3
IGC 1
NC 1
NM 2
Based on my query I am getting the above result. In the above result the colleges HC and JC are not coming because it has average only less than 5. But for my case, I want to display the college name with the total as 0 if that college doesnt have average >5. I need to modify the above query to get the result like below.
CC 3
IGC 1
NC 1
NM 2
HC 0
JC 0
Please help for this.
Thanks in Advance,
Regards,
|
|
|
|
|
Try this:
select c_name, sum(case when average > 5 then 1 else 0 end) as Total
from Test1
group by c_name
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi Bob,
Thanks lot for ur help.
Its working well.
Regards,
|
|
|
|
|
No problem
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi,
I have database backup from sql server 2005, i want to restore that backup file to sql server 2000. I have tried attach database and restore database but i am not able to do that. Is there any way to achieve this? please help me.
Thanks
Warm Regards
Prakash-B
|
|
|
|
|
Backups created with Microsoft SQL Server 2005 cannot be restored to an earlier version of SQL Server.
With the help of Export/Import OR some third party Tool you can transfer your data from 2005 to 2000 and this is the way only.
Parwej Ahamad
R & D with IIS 5.0/6.0
modified on Friday, June 13, 2008 11:57 AM
|
|
|
|
|
Seems reasonable to me, what makes you beleive you will be able to restore a 05 DB on 2000. I would have thought this would be a futile effort.
You will be able to DTS, or select the data across. You may even be able to use replication but restore, not a chance.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
i had a problem with sending mail using trigger when Update data from a table. Procedure is executed successfully. but when i update record from a particular table. I had a following error
xp_sendmail: Either there is no default mail client or the current mail
client cannot fulfill the messaging request. Please run Microsoft Outlook
and set it as the default mail client.
(0 row(s) affected)
Can any one explain what's my problem and give me a solution for this.
it's Urgent !!!!!!!
Thanks in Advance!!!
Sabarees
modified on Thursday, June 12, 2008 6:01 PM
|
|
|
|