Showing posts with label figured. Show all posts
Showing posts with label figured. Show all posts

Monday, March 19, 2012

EMAIL from SQL express

Hello

Just figured out that database mail is not available in SQL Express.
Anyone have any ideas on how I can send mail from sql express ... as
part of a trigger ?

Regards

RobOn Thu, 6 Dec 2007 10:52:46 -0800 (PST), roblowein
<rob.lowein@.gmail.comwrote:

All versions of SQL Server have support for Common Language Runtime
and .NET Integration. So you could write a .NET assembly to send
emails.

-Tom.

Quote:

Originally Posted by

>Hello
>
>Just figured out that database mail is not available in SQL Express.
>Anyone have any ideas on how I can send mail from sql express ... as
>part of a trigger ?
>
>Regards
>
>Rob

|||On Dec 7, 4:41 am, Tom van Stiphout <no.spam.tom7...@.cox.netwrote:

Quote:

Originally Posted by

On Thu, 6 Dec 2007 10:52:46 -0800 (PST), roblowein
>
<rob.low...@.gmail.comwrote:
>
All versions of SQL Server have support for Common Language Runtime
and .NET Integration. So you could write a .NET assembly to send
emails.
>
-Tom.
>
>
>

Quote:

Originally Posted by

Hello


>

Quote:

Originally Posted by

Just figured out that database mail is not available in SQL Express.
Anyone have any ideas on how I can send mail from sql express ... as
part of a trigger ?


>

Quote:

Originally Posted by

Regards


>

Quote:

Originally Posted by

Rob- Hide quoted text -


>
- Show quoted text -


Thanks for the reply.... could provide any more details ... this
quite new to me

THansk

Rob|||On Dec 6, 10:41 pm, Tom van Stiphout <no.spam.tom7...@.cox.netwrote:

Quote:

Originally Posted by

On Thu, 6 Dec 2007 10:52:46 -0800 (PST), roblowein
>
<rob.low...@.gmail.comwrote:
>
All versions of SQL Server have support for Common Language Runtime
and .NET Integration. So you could write a .NET assembly to send
emails.
>
-Tom.
>
>
>

Quote:

Originally Posted by

Hello


>

Quote:

Originally Posted by

Just figured out that database mail is not available in SQL Express.
Anyone have any ideas on how I can send mail from sql express ... as
part of a trigger ?


>

Quote:

Originally Posted by

Regards


>

Quote:

Originally Posted by

Rob- Hide quoted text -


>
- Show quoted text -


Tom, I too am interested in some type of example. Do you do
development work in a language - VB, C#, Delphi or other?

Thanks|||On Sun, 9 Dec 2007 08:01:36 -0800 (PST), scoots987
<scoots987@.gmail.comwrote:

In Books Online, the topic "CLR [SQL Server] about CLR integration
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/denet9/html/c73e628a-f54a-411a-bfe3-6dae519316cc.htm
has a simple "Hello World" example.

-Tom.

Quote:

Originally Posted by

>On Dec 6, 10:41 pm, Tom van Stiphout <no.spam.tom7...@.cox.netwrote:

Quote:

Originally Posted by

>On Thu, 6 Dec 2007 10:52:46 -0800 (PST), roblowein
>>
><rob.low...@.gmail.comwrote:
>>
>All versions of SQL Server have support for Common Language Runtime
>and .NET Integration. So you could write a .NET assembly to send
>emails.
>>
>-Tom.
>>
>>
>>

Quote:

Originally Posted by

>Hello


>>

Quote:

Originally Posted by

>Just figured out that database mail is not available in SQL Express.
>Anyone have any ideas on how I can send mail from sql express ... as
>part of a trigger ?


>>

Quote:

Originally Posted by

>Regards


>>

Quote:

Originally Posted by

>Rob- Hide quoted text -


>>
>- Show quoted text -


>
>Tom, I too am interested in some type of example. Do you do
>development work in a language - VB, C#, Delphi or other?
>
>Thanks
>

Friday, February 17, 2012

Effectively using subqueries

Hi, I have searched through this forum and haven't found the answer to a problem I am having so I figured I will post it.

My SQL statement:

Select * FROM tblData WHERE LastName=
(SELECT tblData.LastName FROM tblData GROUP BY tblData.LastName HAVING (Count(tblData.LastName)>1))"

What I am trying to do: I am trying to make an SQL filter that I can apply to my form in order to only show records with duplicate last names. The sub query returns names that are already in the table. I then compare what is found to be duplicate with the original table in order to just show only the duplicate records. Everything works fine as long as there is only one name thats duplicated.

When there are multiple duplicate names then I run into an error.

When the statement is put into a string and executed in VBA I get this error:

"Run-time error '3021': No current record."

When the statement is put into a query and run against the DB I get this error:

"At most one record can be returned by this subquery"

So yeah, any help would be greatly appreciated. Am I going about this all wrong or am I just forgetting something? Thanks for any help.It is because ur subquery returns more than one value when u have more than one duplicates.This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.Check the code below.

Select distinct t.* FROM tblData t
inner join
( SELECT LastName FROM tblData
GROUP BY LastName
HAVING (Count(*)>1)
) as tm
on t.LastName=tm.LastName|||I understand what you did and it works fine when I run it as a query, but when I try and apply it as a filter it doesn't work. It just returns all records.