Showing posts with label fails. Show all posts
Showing posts with label fails. Show all posts

Friday, March 23, 2012

name pipe VS tcpip

I found that I can only use name pipe to connect to the sql server.
When I use tcpip, it fails to connect.
I am sure I have enabled the TCP/IP protocol in SQL server
What causes it?
sql is using port no.1433 and I have try using dynamically determine port
and force it to 1433 in ODBC setting.
thank you very much
"!" <!@.!.!> wrote in message news:%236FqHb0qEHA.3416@.TK2MSFTNGP15.phx.gbl...
> I found that I can only use name pipe to connect to the sql server.
> When I use tcpip, it fails to connect.
> I am sure I have enabled the TCP/IP protocol in SQL server
> What causes it?
> sql is using port no.1433 and I have try using dynamically determine port
> and force it to 1433 in ODBC setting.
There are a lot of reasons that this can fail, application type being one of
them. Reference the following as a troubleshooting guide:
http://support.microsoft.com/default...b;en-us;827422
Steve

Monday, March 12, 2012

Mysql Vs Mssql query

Hi,
I have a query that works perfectly in Mysql but fails in MSSQL.
Can anyone please throw light on this issue and guide me on how to avoid
this?
quote:

select cust_name,cust_email from customer,cust_departments
where customer.cust_id=cust_departments.cust_id and
cust_departments.dept_id='1' and cust.notify_ticket='1' group by
cust_departments.cust_id


The error thrown is Column 'cust_name' is invalid in the select list because
it is not contained in either an aggregate function or the GROUP BY clause.
What do I do?
Thanks and Regards,
Celia>
quote:

> select cust_name,cust_email from customer,cust_departments
> where customer.cust_id=cust_departments.cust_id and
> cust_departments.dept_id='1' and cust.notify_ticket='1' group by
> cust_departments.cust_id
>

I have no idea what you expect to see in MySQL. Why are using GROUP BY? Do
you multiple cust_name/cust_email combinations for a single cust_id? If so,
which one do you expect to show (I assume you only want one cust_id per
row)?
Perhaps you could provide schema (I have no idea what table cust_name /
cust_email belong to), sample data and desired results as per
http://www.aspfaq.com/5006|||Does MySQL not have DISTINCT? Is that why the group by is being used?
Also you should not use the old join style - update it to the ANSI syntax
select DISTINCT cust_name,cust_email
from customer
join cust_departments on customer.cust_id=cust_departments.cust_id and
cust_departments.dept_id='1'
where cust.notify_ticket='1'
celia wrote:
> Hi,
> I have a query that works perfectly in Mysql but fails in MSSQL.
> Can anyone please throw light on this issue and guide me on how to avoid
> this?
>
quote:

> select cust_name,cust_email from customer,cust_departments
> where customer.cust_id=cust_departments.cust_id and
> cust_departments.dept_id='1' and cust.notify_ticket='1' group by
> cust_departments.cust_id
>

> The error thrown is Column 'cust_name' is invalid in the select list becau
se
> it is not contained in either an aggregate function or the GROUP BY clause
.
> What do I do?
> Thanks and Regards,
> Celia
>