|
Hi All,
OUR DB is SQL SERVER 2000 and it is in a server which having windows 2003 standard x64 edition.
and our client machine is having windows web server 2008 and we are trying to connect SQL DB for there.
But we have recieved error like below.
"
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
"
can you please help to fix the issue?
Thanks in advance.
|
|
|
|
|
The error is quite general so:
- recheck the connection string at client side (protocol, instance name, server name etc.)
- check that the server side is listening on desired protocol (also check it's settings)
- check that there are no firewalls blocking the conversation. If needed open the port in Vista firewall
|
|
|
|
|
Hi all,
I want to get concatenatenames of all rows in one column ..can any one help me.
suppose i get A
B
C AS 3 3 DIFFERENT ROWS
I WANT TO CONCATENATE GET ABC AS THE RESULT = NEW COLUMN..
CAN ANY ONE CAN HELP
|
|
|
|
|
An easy way would be writing a stored procedure, opening a cursor on the table, loop through it and while looping, concatenate the return string.
|
|
|
|
|
I hate cursors so I love this concat function
DECLARE @Text VARCHAR(8000)<br />
<br />
SET @Text = ''<br />
<br />
SELECT @Text = @Text + ',' + class<br />
FROM PFClass<br />
<br />
SELECT @Text
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Agreed......much rather use WHILE EXISTS(
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Yeah, also thought it was neat.
|
|
|
|
|
You can use COALESCE function of sql server for this purpose.
Do good and have good.
|
|
|
|
|
You reckon? How exactly?
Regards,
Rob Philpott.
|
|
|
|
|
Something like this:
create table #X
(
C char(1)
)
insert into #X values ('A')
insert into #X values ('B')
insert into #X values ('C')
declare @z as varchar(2000)
set @z = ''
select @z = @z + C from #X
select @z
drop table #x
yields: ABC
Regards,
Rob Philpott.
|
|
|
|
|
Thank u verymuch it worked fine...
|
|
|
|
|
Is it possible to call a web service from Stored Procedure (Sql Server 2000),
If so how can we achieve this?
Thanks In Advance
|
|
|
|
|
vamsimohan21 wrote: Is it possible to call a web service from Stored Procedure (Sql Server 2000)
One way could be to create a program that calls the web service and use for example xp_cmdshell to call this program.
|
|
|
|
|
Mika Wendelius wrote: xp_cmdshell
Not recommended because this opens a high-risk security hole. IMHO, xp_cmdshell should be avoided at all costs.
|
|
|
|
|
Dave Kreskowiak wrote: Not recommended because this opens a high-risk security hole
True in many cases, but with Sql Server 2000 that was the only way that came in mind.
|
|
|
|
|
Its not a Good idea. Why Dont you call a Stored a Stored Procedure from a Web Service?
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswam@its.co.za
|
|
|
|
|
I have Table1 in Db Ms Access connection to VB2005
the Table has these columns A,B,C,D,F,G,H.. the typed of H is Date/time and the Typed of D is number and other columns is Text
I tried this Sql and it succeed with me.
Select Last( F),Last( G), SUM(D), A,B,C FROM Table1 Group by A, B, C
I want to make modification on that sql by define that row not by Last, but by MAX(H), or Order By H DESC
it's mean if the Table like this:
A :: B :: C :: D :: F :: G :: H
xxx :: yyy :: zzz :: 111 :: fff :: ggg ::2 Dec 08
xxx :: yyy :: zzz :: 222 :: rrr :: sss :: 1 Dec 08
x99 :: y99 :: z99 :: 432 :: uuu :: vvv :: 3 Dec 08
the result will be like this
A :: B :: C :: D :: F :: G
xxx :: yyy :: zzz :: 333 :: fff :: ggg
x99 :: y99 :: z99 :: 432 :: uuu :: vvv
|
|
|
|
|
did you try
Order by max(H) desc
Or
name the colum max(h) DateOrder
Order by DateOrder Desc
One of them may work in Access. Make sure that H is a date field NOT varchar.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Yes I tried but it is only work alone not with group
it's mean If I used like this
Select A,B,C.... From Table1 ORDER BY H DESC
It will works.
But If I tried to used in that Select
Select F,G,ORDER BY H DESC SUM(D), A,B,C From Table1 Group by A,B,C
it will not works
my problem is I don't know how to select the F,G in that Sql ORDER BY H DESC.
|
|
|
|
|
I have an email addresses from different employee and I only want to get the character before the @ sign, how can we do it in SQL?
I have tried the substring but it didnt work since the length of email add varies.
ex. MSantos@yahoo.com
CSanBeda@hotmail.com
Aaloya@gmail.com
I want to get the character before @ sign result should be
MSantos
CSanBeda
Aaloya
Thanks
Dabsukol
|
|
|
|
|
You can use CHARINDEX , like:
select substring('MSantos@yahoo.com', 1, charindex('@', 'MSantos@yahoo.com') - 1)
|
|
|
|
|
select substring(columnname, 1, charindex('@', columnname) - 1) from tablename
Do good and have good.
|
|
|
|
|
Probably a dumb question, but I can't figure this out.
Suppose I have 2 tables:
ORDERS(id,cust_id,date,price)
CUSTOMERS(cust_id,name)
I want to know how much money the customer #3 spent, and how many orders he did, okay:
SELECT COUNT(*), SUM(price)
FROM orders
WHERE cust_id=3
So far so good, now I want to know this, but I want to narrow it down to the latest 50 orders he did (or to the latest x orders if x < 50), how can I do that?
SELECT COUNT(*), SUM(price)
WHERE cust_id=3
ORDER BY date DESC
LIMIT 50
doesn't work, because there's still only 1 row returned. I'm a bit clueless
Thanks for your help!
|
|
|
|
|
Limit doesn't work because you are actually groupping everything into a single row. If you want to restrict the data that goes into the group operation, you have to do it in where or for example use inline views.
If you want to use where condition, it could be something like:
SELECT COUNT(*), SUM(price)
FROM Orders o1
WHERE cust_id=3
AND 50 <= (select count(*)
from Orders o2
where o2.cust_id = o1.cust_id
and o2.date < o1.date)
|
|
|
|
|
I see. Is subquerying the only solution? I'm not sure this is going to be run very fast.
|
|
|
|