Showing posts with label default. Show all posts
Showing posts with label default. Show all posts

Friday, March 30, 2012

Is using a named instance better over using a default instance?

If you were asked to install SQL 2005 on a machine, would u install a default instance or a named one? And why would u choose one over the other? Also, r there any issues with using a default instance?

Thank you for all your help.

Named instances allow for somewhat better server management -the names could reflect the SQL version. In an enviroment with lots of servers, various migration projects in play, and future upgrades, a simple way to know about the server is quite valuable.

For example:

Instance Name: LON_ACCT_Std05
Instance Name: NYC_HR_Ent05
Instance Name: DEN_INV_Exp05
Instance Name: LAX_ORD_Dev00

|||In addition, there is only one default instance on a machine. If you want to install multiple instances of SQL Server including 2000 and 2005, the rest should be named instances. Otherwise, setup will complain.|||

The other thing to think about is that the default instance name, MSSQLSERVER, is merely the defaul "named instance". No difference at all, but as pointed out, naming them allows you to describe them a bit.

Thanks,
Sam Lester (MSFT)

Is UMS threads different from worker threads ?

I have read that there is only one UMS thread per processor . So for a 4 way
box, there are only 4 UMS threads . What are the default 255 worker threads
then ?
So if i have 5 processes that want to run in parallel... does that mean only
1 process will be worked upon while the remaining 4 would be queued to be
processed ? Can someone bring some more light here ?Hassan,
I think what you call UMS threads are listener threads that put work in the
scheduler queue and wakeup sleeping/waiting threads.
(most of )The other threads are scheduled to work for the client that has a
connection to sqlserver, everything ranging from network I/O, disk I/O,
sqlprocessing, etc is done by the other worker threads. WHen a thread does
an I/O (network or disk) it will wait/sleep until the I/O event finishes.
The (worker) thread is then availabel for other work. When the I/O finishes
it (the sql process) it is rescheduled again.
.
--
Mario
www.sqlinternals.com
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:eJ5H0B$lDHA.2732@.TK2MSFTNGP11.phx.gbl...
> I have read that there is only one UMS thread per processor . So for a 4
way
> box, there are only 4 UMS threads . What are the default 255 worker
threads
> then ?
> So if i have 5 processes that want to run in parallel... does that mean
only
> 1 process will be worked upon while the remaining 4 would be queued to be
> processed ? Can someone bring some more light here ?
>sql

Wednesday, March 28, 2012

Is this supposed to be funny?

http://support.microsoft.com/default...b;EN-US;220960
SQL Server 2000 SP3
I see no "options" from any of the three console menus. I see Console | =
Window | Help. Under Console I see
Exit. Under Window I see the normal Windows stuff. Under Help I see =
Help stuff. I selected each branch of
the tree to see if I would ever get "options." I did when selecting the =
branch under Console Root within Tools.=20
But that was way off the mark of this article. I guess it's a practical =
joke?
--=20
George Hester
_________________________________
The article wasn't written clearly.
You do all these from launching mmc.exe
Instead of Console menu, try File menu. By default it should be in
author mode.
Yih-Yoon Lee
George Hester wrote:
> http://support.microsoft.com/default...b;EN-US;220960
> SQL Server 2000 SP3
> I see no "options" from any of the three console menus. I see Console | Window | Help. Under Console I see
> Exit. Under Window I see the normal Windows stuff. Under Help I see Help stuff. I selected each branch of
> the tree to see if I would ever get "options." I did when selecting the branch under Console Root within Tools.
> But that was way off the mark of this article. I guess it's a practical joke?
>

Is this supposed to be funny?

http://support.microsoft.com/default.aspx?scid=3Dkb;EN-US;220960
SQL Server 2000 SP3
I see no "options" from any of the three console menus. I see Console | = Window | Help. Under Console I see
Exit. Under Window I see the normal Windows stuff. Under Help I see = Help stuff. I selected each branch of
the tree to see if I would ever get "options." I did when selecting the = branch under Console Root within Tools. But that was way off the mark of this article. I guess it's a practical = joke?
-- George Hester
_________________________________The article wasn't written clearly.
You do all these from launching mmc.exe
Instead of Console menu, try File menu. By default it should be in
author mode.
Yih-Yoon Lee
George Hester wrote:
> http://support.microsoft.com/default.aspx?scid=kb;EN-US;220960
> SQL Server 2000 SP3
> I see no "options" from any of the three console menus. I see Console | Window | Help. Under Console I see
> Exit. Under Window I see the normal Windows stuff. Under Help I see Help stuff. I selected each branch of
> the tree to see if I would ever get "options." I did when selecting the branch under Console Root within Tools.
> But that was way off the mark of this article. I guess it's a practical joke?
>

Monday, March 26, 2012

Is this possible without using cursors?

Hi!

I have 2 tables: Person and Address

Person
(
PersonID int PK
)

Adress
(
AddresID int PK,
PersonID int FK,
Default -- 1 if address is default for person
)

so when I join those table it yelds (for example):

p1 a1 1
p1 a2 0
p1 a3 0
p2 a4 1
p3 a5 0
p3 a6 0

Person may:
- have one default addres and some non-default;
- haven't default address;
- have only default adres

So proper result is:

p1 a1 p1 a1
p2 a4 OR p2 a4
p3 a5 p3 a6

I want to get list of persons and their adresses in following manner:

Get person and
- default adress ID if exists for this person
- any address ID else

Is this possible without using cursors?

Regards,
Walter

Walter:

This can be done with an outer join. The main thing to verify is what you want to do when you have NULL returned for OUTER TABLE results:

select p.personID,
a.addressID,
a.[default]
from Person p
left join address a
on p.personID = a.personID
and a.[default] = 1

-- Sample Output:

-- personID addressID default
-- -- -- -
-- 1 1 1
-- 2 4 1
-- 3 NULL NULL

Dave

|||

Hmmm...

I that statement, you have persons with defaults addresses, or info that there's no default address. But there is no addressID when it is non-default. We don't want NULLs, but any non-default addressID...

Walte

|||

Sorry about that. Is this closer to what you have in mind?

select personID,
addressID
from ( select p.personID,
a.addressID,
a.[default],
row_number () over
( partition by p.personID
order by a.[default] desc, a.addressID
) as seq
from Person p
inner join address a
on p.personID = a.personID
) a
where seq = 1

-- Sample Output:

-- personID addressID
-- -- --
-- 1 1
-- 2 4
-- 3 5

|||

Please mention the version of SQL Server so it is easy to suggest the correct solution that will work in that version or all versions. You can do below in SQL Server 2005:

select ...

from Person as p

cross apply (

select top 1 *

from Address as a

where a.PersonID = p.PersonID

order by a.Default desc

) as pa

And add an index on (Address.PersonID, Address.Default DESC) to get the best performance. If you need solution for older version of SQL Server then please reply back.

|||

I simulated 32767 rows of person data with about 75000 rows of address data with:

drop table dbo.Person
go
create table dbo.Person
(
PersonID int primary key
)
go
drop table dbo.address
go

create table dbo.Address
(
AddressID int primary key,
PersonID int,
[default] tinyint
)
go

insert into person
select iter
from small_iterator

insert into address
select personID,
personID,
0
from person
where personID % 11 > 1

insert into address
select 32768 + personID,
personID,
0
from person
where personID % 11 < 2

insert into address
select 2*32768 + personID,
personID,
0
from person
where personID %17 not in (3, 5, 13)

insert into address
select 3*32768 + personID,
personID,
0
from person
where personID %23 not in (7, 10, 13, 19)

First, I ran this query with these results:

declare @.begDt datetime
set @.begDt = getdate()

select personID,
addressID
from ( select p.personID,
a.addressID,
a.[default],
row_number () over
( partition by p.personID
order by a.[default] desc, a.addressID
) as seq
from Person p
inner join address a
on p.personID = a.personID
) a
where seq = 1

print ' '
select datediff (ms, @.begDt, getdate()) as [Elapsed Time]

-- Sample Output:

-- personID addressID
-- -- --
-- 1 32769
-- 2 2
-- ...
-- 32766 32766
-- 32767 32767


-- |--Filter(WHERE:([Expr1004]=(1)))
-- |--Sequence Project(DEFINE:([Expr1004]=row_number))
-- |--Compute Scalar(DEFINE:([Expr1006]=(1)))
-- |--Segment
-- |--Sort(ORDER BY:([p].[PersonID] ASC, Angel.[default] DESC, Angel.[AddressID] ASC))
-- |--Hash Match(Inner Join, HASH:([p].[PersonID])=(Angel.[PersonID]), RESIDUAL:([Mugambo].[dbo].[Address].[PersonID] as Angel.[PersonID]=[Mugambo].[dbo].[Person].[PersonID] as [p].[PersonID]))
-- |--Clustered Index Scan(OBJECT:([Mugambo].[dbo].[Person].[PK__Person__7D63964E] AS [p]))
-- |--Clustered Index Scan(OBJECT:([Mugambo].[dbo].[Address].[PK__Address__7F4BDEC0] AS Angel))

-- Table 'Worktable'. Scan count 0, logical reads 0, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
-- Table 'Address'. Scan count 1, logical reads 196, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
-- Table 'Person'. Scan count 1, logical reads 55, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.


-- Elapsed Time
--
-- 656

And then ran this query with these results:

declare @.begDt datetime
select @.begDt = getdate()

select p.personID,
pa.addressID
from person p
cross apply
( select top 1 *
from address as a
where a.personID = p.personID
order by a.[default] desc
) pa

print ' '
select datediff (ms, @.begDt, getdate()) as [Elapsed Time]

-- |--Nested Loops(Inner Join, OUTER REFERENCES:([p].[PersonID]))
-- |--Clustered Index Scan(OBJECT:([Mugambo].[dbo].[Person].[PK__Person__7D63964E] AS [p]))
-- |--Sort(TOP 1, ORDER BY:(Angel.[default] DESC))
-- |--Index Spool(SEEK:(Angel.[PersonID]=[Mugambo].[dbo].[Person].[PersonID] as [p].[PersonID]))
-- |--Clustered Index Scan(OBJECT:([Mugambo].[dbo].[Address].[PK__Address__7F4BDEC0] AS Angel))

-- Table 'Worktable'. Scan count 32767, logical reads 242508, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
-- Table 'Address'. Scan count 1, logical reads 196, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
-- Table 'Person'. Scan count 1, logical reads 55, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
-- Elapsed Time
--
-- 2563


Dave

|||Please add an index on (Address.PersonID, Address.Default DESC) and you will get the best performance with the APPLY approach. Also, the results from both queries will not be identical because of the additional ordering on AddressID in your query.|||

Hi,

thanks for yours posts :) Unfortunately I use SQL SERVER 2000....

Regards,
Walter

|||

The following query might help you

Select Person.PersonID,Isnull(Adress.AddresID,Adress2.AddresID) from Person
left Outer Join Adress on Person.PersonID = Adress.PersonID And Adress.isDefault = 1
left Outer Join Adress Adress2 On Person.PersonID = Adress2.PersonID And Adress2.isDefault = 0
and Adress2.AddresID = (Select Top 1 AddresID From Adress Sub Where Adress2.PersonID = Sub.PersonID Order By newId())

|||

Select Person.PersonID,Isnull(Adress.AddresID,Adress2.AddresID) from Person
left Outer Join Adress on Person.PersonID = Adress.PersonID And Adress.isDefault = 1
left Outer Join Adress Adress2 On Person.PersonID = Adress2.PersonID And Adress2.isDefault = 0
and Adress2.AddresID = (Select Top 1 AddresID From Adress Sub Where Adress2.PersonID = Sub.PersonID Order By newId())

This query has me confused; I am not sure that I am getting the correct return data for my large test case.

|||

Here if there is a default value then it will pull that value..

If there is no default value instead of fetching Min/Max address id it will pull the random address from the DB.

May be your test case fail if you try to get Max/Min address id as expected.

Change your test case as "IN Non Default Address List instead of Particular Address"

|||Well, I am getting nulls for some address IDs and some rows that have duplicate personIDs. And I agree with you in that this might be a data problem. (I gotta get something to eat.)|||

Mani:

Ran the following three queries and got the results that follow:

select count(*) as [Person Records] from person
select count(distinct personID) as [Address Records] from address
select count(distinct a.personID) [Matched Person Records] from person a inner join address b on a.personID = b.personID

-- Person Records
-- --
-- 32767

-- Address Records
--
-- 32767

-- Matched Person Records
-- -
-- 32767

Therefore, I do not think that the problem is a data problem. I re-examined your select and I question this line:

and Adress2.AddresID = (Select Top 1 AddresID From Adress Sub Where Adress2.PersonID = Sub.PersonID Order By newId())

specifically, the "... Where Address2.PersonID ..." portion. I think this is the source of the NULL and duplicate PersonID records. When I change this line to:

and Adress2.AddresID = (Select Top 1 AddresID From Adress Sub Where Adress2.PersonID = Sub.PersonID Order By newId())

I get what I perceive to be "correct" results. Please verify whether or not you aggree.

Also, I completely agree with Umachandar's assessment that we need an additional index. I am therefore going to add a cover index based on (1) personID, (2) default and (3) addressID.

Running one more test.

Dave

|||

Mani:

Ran the following three queries and got the results that follow:

select count(*) as [Person Records] from person
select count(distinct personID) as [Address Records] from address
select count(distinct a.personID) [Matched Person Records] from person a inner join address b on a.personID = b.personID

-- Person Records
-- --
-- 32767

-- Address Records
--
-- 32767

-- Matched Person Records
-- -
-- 32767

Therefore, I do not think that the problem is a data problem. I re-examined your select and I question this line:

and Adress2.AddresID = (Select Top 1 AddresID From Adress Sub Where Adress2.PersonID = Sub.PersonID Order By newId())

specifically, the "... Where Address2.PersonID ..." portion. I think this is the source of the NULL and duplicate PersonID records. When I change this line to:

and Adress2.AddresID = (Select Top 1 AddresID From Adress Sub Where Adress2.PersonID = Sub.PersonID Order By newId())

I get what I perceive to be "correct" results. Please verify whether or not you aggree.

Also, I completely agree with Umachandar's assessment that we need an additional index. I am therefore going to add a cover index based on (1) personID, (2) default and (3) addressID.

Running one more test.

Dave

|||

I ran the modified version of Mani's query against my mock tables and got the following results:

-- |--Compute Scalar(DEFINE:([Expr1010]=isnull([Address].[AddressID], [Address].[AddressID])))
-- |--Nested Loops(Left Outer Join, OUTER REFERENCES:([Person].[PersonID]))
-- |--Merge Join(Right Outer Join, MANY-TO-MANY MERGE:([Address].[PersonID])=([Person].[PersonID]), RESIDUAL:([Address].[PersonID]=[Person].[PersonID]))
-- | |--Sort(ORDER BY:([Address].[PersonID] ASC))
-- | | |--Clustered Index Scan(OBJECT:([tempdb].[dbo].[Address].[PK__Address__701695AD]), WHERE:([Address].[default]=1))
-- | |--Clustered Index Scan(OBJECT:([tempdb].[dbo].[Person].[PK__Person__6E2E4D3B]), ORDERED FORWARD)
-- |--Hash Match(Cache, HASH:([Person].[PersonID]), RESIDUAL:([Person].[PersonID]=[Person].[PersonID]))
-- |--Nested Loops(Inner Join, OUTER REFERENCES:([Address].[AddressID]))
-- |--Sort(TOP 1, ORDER BY:([Expr1009] ASC))
-- | |--Compute Scalar(DEFINE:([Address].[AddressID]=[Address].[AddressID], [Expr1009]=newid()))
-- | |--Index Spool(SEEK:([Address].[PersonID]=[Person].[PersonID]))
-- | |--Clustered Index Scan(OBJECT:([tempdb].[dbo].[Address].[PK__Address__701695AD]))
-- |--Clustered Index Seek(OBJECT:([tempdb].[dbo].[Address].[PK__Address__701695AD]), SEEK:([Address].[AddressID]=[Address].[AddressID]), WHERE:([Address].[PersonID]=[Person].[PersonID] AND [Address].[default]=0) ORDERED FORWARD)

-- Table 'Worktable'. Scan count 0, logical reads 0, physical reads 0, read-ahead reads 0.
-- Table 'Person'. Scan count 1, logical reads 54, physical reads 0, read-ahead reads 0.
-- Table 'Address'. Scan count 3, logical reads 585, physical reads 0, read-ahead reads 0.
-- Table 'Worktable'. Scan count 85514, logical reads 347474, physical reads 0, read-ahead reads 0.

-- Elapsed Time
--
-- 2186

I next added this index:

create index address_personID_ndx
on address (personID, [default] desc, addressID)

And then I re-tested the modified version of Mani's query and received these improved results:

-- |--Compute Scalar(DEFINE:([Expr1010]=isnull([Address].[AddressID], [Address].[AddressID])))
-- |--Nested Loops(Left Outer Join, OUTER REFERENCES:([Person].[PersonID]))
-- |--Merge Join(Right Outer Join, MANY-TO-MANY MERGE:([Address].[PersonID])=([Person].[PersonID]), RESIDUAL:([Address].[PersonID]=[Person].[PersonID]))
-- | |--Index Scan(OBJECT:([tempdb].[dbo].[Address].[address_personID_ndx]), WHERE:([Address].[default]=1) ORDERED FORWARD)
-- | |--Clustered Index Scan(OBJECT:([tempdb].[dbo].[Person].[PK__Person__6E2E4D3B]), ORDERED FORWARD)
-- |--Hash Match(Cache, HASH:([Person].[PersonID]), RESIDUAL:([Person].[PersonID]=[Person].[PersonID]))
-- |--Nested Loops(Inner Join, OUTER REFERENCES:([Address].[AddressID]))
-- |--Sort(TOP 1, ORDER BY:([Expr1009] ASC))
-- | |--Compute Scalar(DEFINE:([Address].[AddressID]=[Address].[AddressID], [Expr1009]=newid()))
-- | |--Index Seek(OBJECT:([tempdb].[dbo].[Address].[address_personID_ndx]), SEEK:([Address].[PersonID]=[Person].[PersonID]) ORDERED FORWARD)
-- |--Index Seek(OBJECT:([tempdb].[dbo].[Address].[address_personID_ndx]), SEEK:([Address].[PersonID]=[Person].[PersonID] AND [Address].[default]=0 AND [Address].[AddressID]=[Address].[AddressID]) ORDERED FORWARD)

-- Table 'Address'. Scan count 65535, logical reads 131671, physical reads 0, read-ahead reads 0.
-- Table 'Worktable'. Scan count 0, logical reads 0, physical reads 0, read-ahead reads 0.
-- Table 'Person'. Scan count 1, logical reads 54, physical reads 0, read-ahead reads 0.
-- Elapsed Time
--
-- 1953

I then tested a different query and obtained the results that follow:

select p.personID,
( select top 1 addressID from address b
where p.personID = b.personID
order by [default] desc
) as addressID
from Person p

-- |--Compute Scalar(DEFINE:(Beer.[AddressID]=Beer.[AddressID]))
-- |--Nested Loops(Left Outer Join, OUTER REFERENCES:([p].[PersonID]))
-- |--Clustered Index Scan(OBJECT:([tempdb].[dbo].[Person].[PK__Person__6E2E4D3B] AS [p]))
-- |--Compute Scalar(DEFINE:(Beer.[AddressID]=Beer.[AddressID]))
-- |--Top(1)
-- |--Index Seek(OBJECT:([tempdb].[dbo].[Address].[address_personID_ndx] AS Beer), SEEK:(Beer.[PersonID]=[p].[PersonID]) ORDERED FORWARD)

-- Table 'Address'. Scan count 32767, logical reads 65593, physical reads 0, read-ahead reads 0.
-- Table 'Person'. Scan count 1, logical reads 54, physical reads 0, read-ahead reads 0.
-- Elapsed Time
--
-- 1890

There is not a lot of difference with respect to execution time between this query and the modified version of Mani's query. This version has one less join and therefore half the scans and half the logical reads. Also, if you neglect to add the index this query is liable to run slow because of the NESTED LOOP join and associated TABLE SCANS instead of INDEX SEEKS.

Either way, BE SURE TO ADD THE INDEX RECOMMENDED BY Umachandar!


Dave

sql

Friday, March 23, 2012

Is this how a trigger is used?

I was following this article:
http://support.microsoft.com/default.aspx?scid=3Dkb;en-us;247931&Product=3D= sql
and got it working nicely. I would like to elaborate on this. Rather = then sending a succeed registration page to the client I would like to = send them a page telling them an email has been sent to their e-mail = address. That part of it I can do. My trouble is once I generate a = password for the client I need to let SQL 2000 SP3 know it's time to = send them an e-mail. Is this a trigger? Can anyone suggest what = applications I might need to do this (except Exchange) and some = guidelines on how this can be done? Thanks.
I cannot use Exchange for this as I have Outlook 2003 installed and it = is not supported on the same server where Exchange 2003 is installed. I = only have the one Server Windows 2000 SP3.
-- George Hester
__________________________________Assuming you are using a stored procedure to generate the password, you can
send an e-mail from the stored procedure (I really don't recommend doing
this in a trigger). You can see some information about sending e-mail from
SQL Server at http://www.aspfaq.com/2403
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"George Hester" <hesterloli@.hotmail.com> wrote in message
news:ugKtPGrwDHA.1764@.TK2MSFTNGP10.phx.gbl...
I was following this article:
http://support.microsoft.com/default.aspx?scid=kb;en-us;247931&Product=sql
and got it working nicely. I would like to elaborate on this. Rather then
sending a succeed registration page to the client I would like to send them
a page telling them an email has been sent to their e-mail address. That
part of it I can do. My trouble is once I generate a password for the
client I need to let SQL 2000 SP3 know it's time to send them an e-mail. Is
this a trigger? Can anyone suggest what applications I might need to do
this (except Exchange) and some guidelines on how this can be done? Thanks.
I cannot use Exchange for this as I have Outlook 2003 installed and it is
not supported on the same server where Exchange 2003 is installed. I only
have the one Server Windows 2000 SP3.
--
George Hester
__________________________________|||Hi Aaron:
Can you believe it? I got the SQL Mail setup and it seems to be =working. Using my ISPs SMTP server. I did the test and it connected to =the MAPI profile successfully. Anyway I proceeded to use the extended =stored procedure xp_sendmail in Query Analyzer:
xp_sendmail @.recipients =3D 'hesterloli@.hotmail.com',
@.message =3D 'Hello',
@.subject =3D 'From SQL Server 2000'
Actually I sent one to that address and one to my POP3 account. Both =successfully as reported by Query Analyzer.
But I forgot to have Outlook 2003 open before I did that. So to see if =I got the mail I went to open Outlook 2003. Know what happened? =Outlook 2003 could not open. I use MAPI profiles and when I tried to =start Outlook 2003 the Error message I got was, "The service could not =be started." No offer to start in safe mode. Just the error message =box. I post it next time if I can replicate the issue again.
All I know is that it sounds like some dll went belly-up. I rebooted =and Outlook 2003 was fine and there were the two e-mails from SQL in =Outlook 2003 and Outlook Express which handles my Hotmail account.
Now I don't know what to do. I could try the xp_sendmail again with =Outlook 2003 open and see if that avoids the issue. But I just don't =know. Ever heard of this before?
-- George Hester
__________________________________
"Aaron Bertrand [MVP]" <aaron@.TRASHaspfaq.com> wrote in message =news:Ok8Io0rwDHA.1512@.TK2MSFTNGP10.phx.gbl...
> Assuming you are using a stored procedure to generate the password, =you can
> send an e-mail from the stored procedure (I really don't recommend =doing
> this in a trigger). You can see some information about sending e-mail =from
> SQL Server at http://www.aspfaq.com/2403
> > -- > Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
> > > > > "George Hester" <hesterloli@.hotmail.com> wrote in message
> news:ugKtPGrwDHA.1764@.TK2MSFTNGP10.phx.gbl...
> I was following this article:
> > =http://support.microsoft.com/default.aspx?scid=3Dkb;en-us;247931&Product=3D=
sql
> > and got it working nicely. I would like to elaborate on this. Rather =then
> sending a succeed registration page to the client I would like to send =them
> a page telling them an email has been sent to their e-mail address. =That
> part of it I can do. My trouble is once I generate a password for the
> client I need to let SQL 2000 SP3 know it's time to send them an =e-mail. Is
> this a trigger? Can anyone suggest what applications I might need to =do
> this (except Exchange) and some guidelines on how this can be done? =Thanks.
> > I cannot use Exchange for this as I have Outlook 2003 installed and it =is
> not supported on the same server where Exchange 2003 is installed. I =only
> have the one Server Windows 2000 SP3.
> > -- > George Hester
> __________________________________
> >|||This is a multi-part message in MIME format.
--=_NextPart_000_000F_01C3C2BA.A0DC3EC0
Content-Type: multipart/alternative;
boundary="--=_NextPart_001_0010_01C3C2BA.A0DDC560"
--=_NextPart_001_0010_01C3C2BA.A0DDC560
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
That's the strangest thing. I use xp_sendmail in Query Analyzer send =the mail to myself at my ISP. And the mail goes into my Inbox. Yes =that's right. Not my Outbox. But my Inbox. I saw an unsent mail there =so deleted it. Tried xp_sendmail again and sure enough there it was =ahgain in my Inbox. But as I was writng this it flew out of my Inbox =for destinations unknown. I suspect it will come back to me. Oh and =Outlook 2003 seems to have survived. I need to close it down and =re-open it to be sure...Nope it is dead dead dead. No error this time =but it won't start. Ah there it was in Task Manager. Let me end the =process and try again... well here's the error:
Got to reboot again. See ya...
-- George Hester
__________________________________
"Aaron Bertrand [MVP]" <aaron@.TRASHaspfaq.com> wrote in message =news:Ok8Io0rwDHA.1512@.TK2MSFTNGP10.phx.gbl...
> Assuming you are using a stored procedure to generate the password, =you can
> send an e-mail from the stored procedure (I really don't recommend =doing
> this in a trigger). You can see some information about sending e-mail =from
> SQL Server at http://www.aspfaq.com/2403
> > -- > Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
> > > > > "George Hester" <hesterloli@.hotmail.com> wrote in message
> news:ugKtPGrwDHA.1764@.TK2MSFTNGP10.phx.gbl...
> I was following this article:
> > =http://support.microsoft.com/default.aspx?scid=3Dkb;en-us;247931&Product=3D=
sql
> > and got it working nicely. I would like to elaborate on this. Rather =then
> sending a succeed registration page to the client I would like to send =them
> a page telling them an email has been sent to their e-mail address. =That
> part of it I can do. My trouble is once I generate a password for the
> client I need to let SQL 2000 SP3 know it's time to send them an =e-mail. Is
> this a trigger? Can anyone suggest what applications I might need to =do
> this (except Exchange) and some guidelines on how this can be done? =Thanks.
> > I cannot use Exchange for this as I have Outlook 2003 installed and it =is
> not supported on the same server where Exchange 2003 is installed. I =only
> have the one Server Windows 2000 SP3.
> > -- > George Hester
> __________________________________
> >
--=_NextPart_001_0010_01C3C2BA.A0DDC560
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

That's the strangest thing. I use =xp_sendmail in Query Analyzer send the mail to myself at my ISP. And the mail =goes into my Inbox. Yes that's right. Not my Outbox. But my =Inbox. I saw an unsent mail there so deleted it. Tried =xp_sendmail again and sure enough there it was ahgain in my Inbox. But as I =was writng this it flew out of my Inbox for destinations unknown. I suspect =it will come back to me. Oh and Outlook 2003 seems to have survived. =I need to close it down and re-open it to be sure...Nope it is dead dead =dead. No error this time but it won't start. Ah there it was in Task =Manager. Let me end the process and try again... well here's the =error:
Got to reboot again. See =ya...
-- George Hester__________________________________
"Aaron Bertrand [MVP]" wrote in message news:Ok8Io0rwDHA.1512@.TK2MSFTNGP10.phx.gbl...> =Assuming you are using a stored procedure to generate the password, you can> send =an e-mail from the stored procedure (I really don't recommend doing> =this in a trigger). You can see some information about sending e-mail =from> SQL Server at > > -- > Aaron Bertrand> SQL Server MVP> => > > > > "George Hester" wrote in message> news:ugKtPGrwDHA.1764@.TK2MSFTNGP10.phx.gbl...> I was following this article:> > =http://support.microsoft.com/default.aspx?scid=3Dkb;en-us;247931=&Product=3Dsql> > and got it working nicely. I =would like to elaborate on this. Rather then> sending a succeed =registration page to the client I would like to send them> a page telling them an =email has been sent to their e-mail address. That> part of it I can =do. My trouble is once I generate a password for the> client I need =to let SQL 2000 SP3 know it's time to send them an e-mail. Is> =this a trigger? Can anyone suggest what applications I might need to =do> this (except Exchange) and some guidelines on how this can be =done? Thanks.> > I cannot use Exchange for this as I have =Outlook 2003 installed and it is> not supported on the same server where =Exchange 2003 is installed. I only> have the one Server Windows 2000 =SP3.> > -- > George Hester> __________________________________> > =

--=_NextPart_001_0010_01C3C2BA.A0DDC560--
--=_NextPart_000_000F_01C3C2BA.A0DC3EC0
Content-Type: image/gif;
name="outlookerror07.gif"
Content-Transfer-Encoding: base64
Content-ID: <000a01c3c2e4$89a91f00$c673c318@.hesterloli.com>
R0lGODlh7AF+AAAAACwAAAAA7AF+AIYAAABAQEABBHwAAX4AAn4AAH8AAIABA30AA34BBH0BBXwB
BnsBBnwCCHoBB3sCB3sCCHsDC3gDDHgEDnYDDXcDDXgDDncEDncED3YEEHUEEHYCCXkCCXoCCnkD
CnkDC3kGGHAGGXAHGXAHGm8HGnAHG24HHG4IHG4HG28IH2wIIGwIHW0IHW4IHm0IH20JIGsJIGwE
EXQEEXUFEnQFE3MFE3QFFHMFFXIGFXIGFnEGFnIFFXMGF3EGGHEJImoJIWsJImsJI2oKJGqAAACA
gIAAAP8A/wD/AAD//wDU0Mj///8AUkAAAAAAAABSQAAAAAAAAAAAAEBAQEBAQEBAQEBACgAAAAAA
AAAAAFJAAAAAAAAAUkAAAAAAAAAAAABAQEBAQEBAQEBAQAoAAAAAAAAAAABSQAAAAAAAAFJAAAAA
AAAAAAAAQEBAQEBAQEBAQEAKAAAAAAAAAAAAUkAAAAAAAABSQAAAAAAAAAAAAEBAQEBAQEBAQEBA
CgAAAAAAAAAH/4BJgoOEhYaHiImKi4yNjo+QkZKTlJWWl5iZmpucnZ6aAUlKo6SlpqeoqaqrrK2u
r7CxsrO0tba3uLm6u7y9vr+5RKFKn8XGx8jJysvMzc7P0IfCoklC1tfY2dhB3N3e3+Dh4t4w5ebm
Kenq6+zt7u/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vERvysJDx+RXzETDzCNdvEUBzEQxzFVAy7U1zFWLyg
V5zFXHyfW9zFYHx/XxzGZCx+Y1zGaGx9Z5zGbPx8a9zGcGx8bxzHdPx7c1zHeIx7d5zHfPy5SdzH
gJx8exzIhGx6g1zIiPx5h5zIjIx5i9zIkBx5j5zF0FXJlnzJmJzJmqzJkezEMdzJawMMoqwKAbDE
bTzJWAwAn0ygpQzKX/vHiazKnicMpszGqFzFsgyOZwmRu9zLvPzLvhxLtOzKI/rExAxRhlLLXegc
yozGt0zFuax5w3zMEmXMxJzLRfzD2czM1FzNq+z/ytGsCVHrtZUwzd3sd+eMzAN8qskqztyczs8c
xeFMhpXIea0Mz7CMyNiMgRIZvebczfEMxfMMjGb5Cf9MzQHdxPvMz8Y5vAd9zAnNxAN9hP+6zsF3
z+cc0Ue80FX6zhmdz4U80azczGWs0UbM0ZKnPQ9NzCYdxNEczMAc0zA907/s0QAN0oQs0pK30q7c
0kCsytob1EI91ERd1EbN06Ds0y8MAPjW1E791FAd1VIN1SRNxkrtwpuc1Vq91Vydzujs1WANelcd
1mQtCWNd1mi9k9ac1my9eGfd1nDtzXE9126N03R91/a81ni918vw1nxd1n7912Ed2ILt1YRd2B/N
QxVHvdiM3diO/diQHdmSPdmUXdmWfdmYndmavdmc3dmPPdWgHdqiPdqkXdqmfdqondqqvdqs3dqu
/dqwHduyPdtQHQgAOw==--=_NextPart_000_000F_01C3C2BA.A0DC3EC0--|||I know that XP gets annoyed if I have two mail users at the same time on one machine (one is SQL
Server, the other is me, as interactive user), where W2K was OK with it. It seems "reasonable" that
W2KS is based on XP and exposes the same behavior. Did you consider using xp_smtp_sendmail instead?
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"George Hester" <hesterloli@.hotmail.com> wrote in message
news:ONOZbMuwDHA.3116@.tk2msftngp13.phx.gbl...
Hi Aaron:
Can you believe it? I got the SQL Mail setup and it seems to be working. Using my ISPs SMTP
server. I did the test and it connected to the MAPI profile successfully. Anyway I proceeded to
use the extended stored procedure xp_sendmail in Query Analyzer:
xp_sendmail @.recipients = 'hesterloli@.hotmail.com',
@.message = 'Hello',
@.subject = 'From SQL Server 2000'
Actually I sent one to that address and one to my POP3 account. Both successfully as reported by
Query Analyzer.
But I forgot to have Outlook 2003 open before I did that. So to see if I got the mail I went to
open Outlook 2003. Know what happened? Outlook 2003 could not open. I use MAPI profiles and when
I tried to start Outlook 2003 the Error message I got was, "The service could not be started." No
offer to start in safe mode. Just the error message box. I post it next time if I can replicate
the issue again.
All I know is that it sounds like some dll went belly-up. I rebooted and Outlook 2003 was fine and
there were the two e-mails from SQL in Outlook 2003 and Outlook Express which handles my Hotmail
account.
Now I don't know what to do. I could try the xp_sendmail again with Outlook 2003 open and see if
that avoids the issue. But I just don't know. Ever heard of this before?
--
George Hester
__________________________________
"Aaron Bertrand [MVP]" <aaron@.TRASHaspfaq.com> wrote in message
news:Ok8Io0rwDHA.1512@.TK2MSFTNGP10.phx.gbl...
> Assuming you are using a stored procedure to generate the password, you can
> send an e-mail from the stored procedure (I really don't recommend doing
> this in a trigger). You can see some information about sending e-mail from
> SQL Server at http://www.aspfaq.com/2403
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
>
>
> "George Hester" <hesterloli@.hotmail.com> wrote in message
> news:ugKtPGrwDHA.1764@.TK2MSFTNGP10.phx.gbl...
> I was following this article:
> http://support.microsoft.com/default.aspx?scid=kb;en-us;247931&Product=sql
> and got it working nicely. I would like to elaborate on this. Rather then
> sending a succeed registration page to the client I would like to send them
> a page telling them an email has been sent to their e-mail address. That
> part of it I can do. My trouble is once I generate a password for the
> client I need to let SQL 2000 SP3 know it's time to send them an e-mail. Is
> this a trigger? Can anyone suggest what applications I might need to do
> this (except Exchange) and some guidelines on how this can be done? Thanks.
> I cannot use Exchange for this as I have Outlook 2003 installed and it is
> not supported on the same server where Exchange 2003 is installed. I only
> have the one Server Windows 2000 SP3.
> --
> George Hester
> __________________________________
>|||No I didn't have to reboot. I just had to shut down the services =mssqlserver and sqlserveragent. Then Outllook 2003 fired up and I =restarted the services. Another bug? Looks like it. With Outlook 2003 =installed along side of SQL 2000 SP3 using xp_sendmail causes Outlook =2003 to fail if it is closed and restarted after using the above =extended stored procedure in Windows 2000 Server SP3.
-- George Hester
__________________________________
"Aaron Bertrand [MVP]" <aaron@.TRASHaspfaq.com> wrote in message =news:Ok8Io0rwDHA.1512@.TK2MSFTNGP10.phx.gbl...
> Assuming you are using a stored procedure to generate the password, =you can
> send an e-mail from the stored procedure (I really don't recommend =doing
> this in a trigger). You can see some information about sending e-mail =from
> SQL Server at http://www.aspfaq.com/2403
> > -- > Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
> > > > > "George Hester" <hesterloli@.hotmail.com> wrote in message
> news:ugKtPGrwDHA.1764@.TK2MSFTNGP10.phx.gbl...
> I was following this article:
> > =http://support.microsoft.com/default.aspx?scid=3Dkb;en-us;247931&Product=3D=
sql
> > and got it working nicely. I would like to elaborate on this. Rather =then
> sending a succeed registration page to the client I would like to send =them
> a page telling them an email has been sent to their e-mail address. =That
> part of it I can do. My trouble is once I generate a password for the
> client I need to let SQL 2000 SP3 know it's time to send them an =e-mail. Is
> this a trigger? Can anyone suggest what applications I might need to =do
> this (except Exchange) and some guidelines on how this can be done? =Thanks.
> > I cannot use Exchange for this as I have Outlook 2003 installed and it =is
> not supported on the same server where Exchange 2003 is installed. I =only
> have the one Server Windows 2000 SP3.
> > -- > George Hester
> __________________________________
> >|||I have to echo Tibor's suggestion, and consider the free, much-less-hassle
xp_smtp_sendmail. If you have any doubts about it, consider that it was
written by a Microsoft employee who knows his ____ and, in addition, my
company is using it in production and swears by it (because we used to swear
*at* SQL Mail).
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"George Hester" <hesterloli@.hotmail.com> wrote in message
news:eKwgUVuwDHA.1736@.TK2MSFTNGP09.phx.gbl...
No I didn't have to reboot. I just had to shut down the services
mssqlserver and sqlserveragent. Then Outllook 2003 fired up and I restarted
the services. Another bug? Looks like it. With Outlook 2003 installed
along side of SQL 2000 SP3 using xp_sendmail causes Outlook 2003 to fail if
it is closed and restarted after using the above extended stored procedure
in Windows 2000 Server SP3.|||I plan to. No issue with whatever works. But the bug still exists. =Too bad it is not published or at least something akin to it. I am =pretty sure I know what it is. The SQL Mail using ExtendedMAPI is not =releasing (signing off) correctly. I have seen this type of thing =before using a dll made by a MVP whose is a messaging expert. It is =called Redemption. His dll has the same type of issue. He says it is =an issue with Outlook itself. It may be. But his dll and this SQLMail =both exhibit the same destructive quality towards Outlook.
-- George Hester
__________________________________
"Aaron Bertrand [MVP]" <aaron@.TRASHaspfaq.com> wrote in message =news:uipC3NwwDHA.3216@.TK2MSFTNGP11.phx.gbl...
> I have to echo Tibor's suggestion, and consider the free, =much-less-hassle
> xp_smtp_sendmail. If you have any doubts about it, consider that it =was
> written by a Microsoft employee who knows his ____ and, in addition, =my
> company is using it in production and swears by it (because we used to =swear
> *at* SQL Mail).
> > -- > Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
> > > > > "George Hester" <hesterloli@.hotmail.com> wrote in message
> news:eKwgUVuwDHA.1736@.TK2MSFTNGP09.phx.gbl...
> No I didn't have to reboot. I just had to shut down the services
> mssqlserver and sqlserveragent. Then Outllook 2003 fired up and I =restarted
> the services. Another bug? Looks like it. With Outlook 2003 =installed
> along side of SQL 2000 SP3 using xp_sendmail causes Outlook 2003 to =fail if
> it is closed and restarted after using the above extended stored =procedure
> in Windows 2000 Server SP3.
> >|||Tibor for this stored procedure to work I have to use my ISP's SMTP =server. They are blocking my port 25. Can I use that in this case and =if so how? Thanks.
-- George Hester
__________________________________
"Tibor Karaszi" =<tibor.please_reply_to_public_forum.karaszi@.cornerstone.se> wrote in =message news:#uVbGVuwDHA.1512@.TK2MSFTNGP10.phx.gbl...
> I know that XP gets annoyed if I have two mail users at the same time =on one machine (one is SQL
> Server, the other is me, as interactive user), where W2K was OK with =it. It seems "reasonable" that
> W2KS is based on XP and exposes the same behavior. Did you consider =using xp_smtp_sendmail instead?
> > -- > Tibor Karaszi, SQL Server MVP
> Archive at: =http://groups.google.com/groups?oi=3Ddjq&as_ugroup=3Dmicrosoft.public.sql=
server
> > > "George Hester" <hesterloli@.hotmail.com> wrote in message
> news:ONOZbMuwDHA.3116@.tk2msftngp13.phx.gbl...
> Hi Aaron:
> > Can you believe it? I got the SQL Mail setup and it seems to be =working. Using my ISPs SMTP
> server. I did the test and it connected to the MAPI profile =successfully. Anyway I proceeded to
> use the extended stored procedure xp_sendmail in Query Analyzer:
> > xp_sendmail @.recipients =3D 'hesterloli@.hotmail.com',
> @.message =3D 'Hello',
> @.subject =3D 'From SQL Server 2000'
> > Actually I sent one to that address and one to my POP3 account. Both =successfully as reported by
> Query Analyzer.
> > But I forgot to have Outlook 2003 open before I did that. So to see =if I got the mail I went to
> open Outlook 2003. Know what happened? Outlook 2003 could not open. =I use MAPI profiles and when
> I tried to start Outlook 2003 the Error message I got was, "The =service could not be started." No
> offer to start in safe mode. Just the error message box. I post it =next time if I can replicate
> the issue again.
> > All I know is that it sounds like some dll went belly-up. I rebooted =and Outlook 2003 was fine and
> there were the two e-mails from SQL in Outlook 2003 and Outlook =Express which handles my Hotmail
> account.
> > Now I don't know what to do. I could try the xp_sendmail again with =Outlook 2003 open and see if
> that avoids the issue. But I just don't know. Ever heard of this =before?
> > -- > George Hester
> __________________________________
> "Aaron Bertrand [MVP]" <aaron@.TRASHaspfaq.com> wrote in message
> news:Ok8Io0rwDHA.1512@.TK2MSFTNGP10.phx.gbl...
> > Assuming you are using a stored procedure to generate the password, =you can
> > send an e-mail from the stored procedure (I really don't recommend =doing
> > this in a trigger). You can see some information about sending =e-mail from
> > SQL Server at http://www.aspfaq.com/2403
> >
> > -- > > Aaron Bertrand
> > SQL Server MVP
> > http://www.aspfaq.com/
> >
> >
> >
> >
> > "George Hester" <hesterloli@.hotmail.com> wrote in message
> > news:ugKtPGrwDHA.1764@.TK2MSFTNGP10.phx.gbl...
> > I was following this article:
> >
> > =http://support.microsoft.com/default.aspx?scid=3Dkb;en-us;247931&Product=3D=
sql
> >
> > and got it working nicely. I would like to elaborate on this. =Rather then
> > sending a succeed registration page to the client I would like to =send them
> > a page telling them an email has been sent to their e-mail address. =That
> > part of it I can do. My trouble is once I generate a password for =the
> > client I need to let SQL 2000 SP3 know it's time to send them an =e-mail. Is
> > this a trigger? Can anyone suggest what applications I might need =to do
> > this (except Exchange) and some guidelines on how this can be done? =Thanks.
> >
> > I cannot use Exchange for this as I have Outlook 2003 installed and =it is
> > not supported on the same server where Exchange 2003 is installed. =I only
> > have the one Server Windows 2000 SP3.
> >
> > -- > > George Hester
> > __________________________________
> >
> >
> >|||Yes, you need an SMTP server, which IMO is the very strength of the solution. No MAPI etc. MAPI was
never designed as a multi-user app (say you have SQL Server and an interactive user at the same
time), nor was it designed to be used but by interactive users. That is why you have soo many KB
articles on the subject so there's a KB article which serves as just an index to all the other KB
articles.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"George Hester" <hesterloli@.hotmail.com> wrote in message
news:OIZhP81wDHA.1576@.TK2MSFTNGP11.phx.gbl...
Tibor for this stored procedure to work I have to use my ISP's SMTP server. They are blocking my
port 25. Can I use that in this case and if so how? Thanks.
--
George Hester
__________________________________
"Tibor Karaszi" <tibor.please_reply_to_public_forum.karaszi@.cornerstone.se> wrote in message
news:#uVbGVuwDHA.1512@.TK2MSFTNGP10.phx.gbl...
> I know that XP gets annoyed if I have two mail users at the same time on one machine (one is SQL
> Server, the other is me, as interactive user), where W2K was OK with it. It seems "reasonable"
that
> W2KS is based on XP and exposes the same behavior. Did you consider using xp_smtp_sendmail
instead?
> --
> Tibor Karaszi, SQL Server MVP
> Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
>
> "George Hester" <hesterloli@.hotmail.com> wrote in message
> news:ONOZbMuwDHA.3116@.tk2msftngp13.phx.gbl...
> Hi Aaron:
> Can you believe it? I got the SQL Mail setup and it seems to be working. Using my ISPs SMTP
> server. I did the test and it connected to the MAPI profile successfully. Anyway I proceeded to
> use the extended stored procedure xp_sendmail in Query Analyzer:
> xp_sendmail @.recipients = 'hesterloli@.hotmail.com',
> @.message = 'Hello',
> @.subject = 'From SQL Server 2000'
> Actually I sent one to that address and one to my POP3 account. Both successfully as reported by
> Query Analyzer.
> But I forgot to have Outlook 2003 open before I did that. So to see if I got the mail I went to
> open Outlook 2003. Know what happened? Outlook 2003 could not open. I use MAPI profiles and
when
> I tried to start Outlook 2003 the Error message I got was, "The service could not be started." No
> offer to start in safe mode. Just the error message box. I post it next time if I can replicate
> the issue again.
> All I know is that it sounds like some dll went belly-up. I rebooted and Outlook 2003 was fine
and
> there were the two e-mails from SQL in Outlook 2003 and Outlook Express which handles my Hotmail
> account.
> Now I don't know what to do. I could try the xp_sendmail again with Outlook 2003 open and see if
> that avoids the issue. But I just don't know. Ever heard of this before?
> --
> George Hester
> __________________________________
> "Aaron Bertrand [MVP]" <aaron@.TRASHaspfaq.com> wrote in message
> news:Ok8Io0rwDHA.1512@.TK2MSFTNGP10.phx.gbl...
> > Assuming you are using a stored procedure to generate the password, you can
> > send an e-mail from the stored procedure (I really don't recommend doing
> > this in a trigger). You can see some information about sending e-mail from
> > SQL Server at http://www.aspfaq.com/2403
> >
> > --
> > Aaron Bertrand
> > SQL Server MVP
> > http://www.aspfaq.com/
> >
> >
> >
> >
> > "George Hester" <hesterloli@.hotmail.com> wrote in message
> > news:ugKtPGrwDHA.1764@.TK2MSFTNGP10.phx.gbl...
> > I was following this article:
> >
> > http://support.microsoft.com/default.aspx?scid=kb;en-us;247931&Product=sql
> >
> > and got it working nicely. I would like to elaborate on this. Rather then
> > sending a succeed registration page to the client I would like to send them
> > a page telling them an email has been sent to their e-mail address. That
> > part of it I can do. My trouble is once I generate a password for the
> > client I need to let SQL 2000 SP3 know it's time to send them an e-mail. Is
> > this a trigger? Can anyone suggest what applications I might need to do
> > this (except Exchange) and some guidelines on how this can be done? Thanks.
> >
> > I cannot use Exchange for this as I have Outlook 2003 installed and it is
> > not supported on the same server where Exchange 2003 is installed. I only
> > have the one Server Windows 2000 SP3.
> >
> > --
> > George Hester
> > __________________________________
> >
> >
>|||> But the bug still exists.
Have you submitted it as a bug? Do you have a bug number?
From your description, sounds like a configuration issue, not a bug.
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/|||> Tibor for this stored procedure to work I have to use my ISP's SMTP
server.
Are you running this out of your house? If your ISP is your only path to
the Internet, how do you plan to send mail using any solution?
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/|||Could be who knows. It's been known to happen. But honestly I wonder =how much of a configuration I can do to make a MAPI profile in the =Control Panel. Have Outlook work with it without issue. Have SQL Mail =see all three profiles. And run the xp-sendmail extended stored =procedure. And then get the error I showed you after shutting down and =restarting Outlook 2002. If it's a configuration issue then the =defaults are error prone. Becuase I did nothing else then follow the =GUI's.
-- George Hester
__________________________________
"Aaron Bertrand - MVP" <aaron@.TRASHaspfaq.com> wrote in message =news:e26eDN#wDHA.2448@.TK2MSFTNGP12.phx.gbl...
> > But the bug still exists.
> > Have you submitted it as a bug? Do you have a bug number?
> > From your description, sounds like a configuration issue, not a bug.
> > -- > Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
> >|||Well there is nothing I can do about it Tibor. My ISP is not going to =open my port 25. I could send them a Christmas present they ain't going =to do it. I could change the port to say 2525. But that won't help as =the stored procedure says it is explicitly desgined for SMTP on port 25. = Mine works fine it just cannot talk to the outside world.
-- George Hester
__________________________________
"Tibor Karaszi" =<tibor.please_reply_to_public_forum.karaszi@.cornerstone.se> wrote in =message news:#ygbjd6wDHA.3216@.TK2MSFTNGP11.phx.gbl...
> Yes, you need an SMTP server, which IMO is the very strength of the =solution. No MAPI etc. MAPI was
> never designed as a multi-user app (say you have SQL Server and an =interactive user at the same
> time), nor was it designed to be used but by interactive users. That =is why you have soo many KB
> articles on the subject so there's a KB article which serves as just =an index to all the other KB
> articles.
> > -- > Tibor Karaszi, SQL Server MVP
> Archive at: =http://groups.google.com/groups?oi=3Ddjq&as_ugroup=3Dmicrosoft.public.sql=
server
> > > "George Hester" <hesterloli@.hotmail.com> wrote in message
> news:OIZhP81wDHA.1576@.TK2MSFTNGP11.phx.gbl...
> Tibor for this stored procedure to work I have to use my ISP's SMTP =server. They are blocking my
> port 25. Can I use that in this case and if so how? Thanks.
> > -- > George Hester
> __________________________________
> "Tibor Karaszi" =<tibor.please_reply_to_public_forum.karaszi@.cornerstone.se> wrote in =message
> news:#uVbGVuwDHA.1512@.TK2MSFTNGP10.phx.gbl...
> > I know that XP gets annoyed if I have two mail users at the same =time on one machine (one is SQL
> > Server, the other is me, as interactive user), where W2K was OK with =it. It seems "reasonable"
> that
> > W2KS is based on XP and exposes the same behavior. Did you consider =using xp_smtp_sendmail
> instead?
> >
> > -- > > Tibor Karaszi, SQL Server MVP
> > Archive at: =http://groups.google.com/groups?oi=3Ddjq&as_ugroup=3Dmicrosoft.public.sql=
server
> >
> >
> > "George Hester" <hesterloli@.hotmail.com> wrote in message
> > news:ONOZbMuwDHA.3116@.tk2msftngp13.phx.gbl...
> > Hi Aaron:
> >
> > Can you believe it? I got the SQL Mail setup and it seems to be =working. Using my ISPs SMTP
> > server. I did the test and it connected to the MAPI profile =successfully. Anyway I proceeded to
> > use the extended stored procedure xp_sendmail in Query Analyzer:
> >
> > xp_sendmail @.recipients =3D 'hesterloli@.hotmail.com',
> > @.message =3D 'Hello',
> > @.subject =3D 'From SQL Server 2000'
> >
> > Actually I sent one to that address and one to my POP3 account. =Both successfully as reported by
> > Query Analyzer.
> >
> > But I forgot to have Outlook 2003 open before I did that. So to see =if I got the mail I went to
> > open Outlook 2003. Know what happened? Outlook 2003 could not =open. I use MAPI profiles and
> when
> > I tried to start Outlook 2003 the Error message I got was, "The =service could not be started." No
> > offer to start in safe mode. Just the error message box. I post it =next time if I can replicate
> > the issue again.
> >
> > All I know is that it sounds like some dll went belly-up. I =rebooted and Outlook 2003 was fine
> and
> > there were the two e-mails from SQL in Outlook 2003 and Outlook =Express which handles my Hotmail
> > account.
> >
> > Now I don't know what to do. I could try the xp_sendmail again with =Outlook 2003 open and see if
> > that avoids the issue. But I just don't know. Ever heard of this =before?
> >
> > -- > > George Hester
> > __________________________________
> > "Aaron Bertrand [MVP]" <aaron@.TRASHaspfaq.com> wrote in message
> > news:Ok8Io0rwDHA.1512@.TK2MSFTNGP10.phx.gbl...
> > > Assuming you are using a stored procedure to generate the =password, you can
> > > send an e-mail from the stored procedure (I really don't recommend =doing
> > > this in a trigger). You can see some information about sending =e-mail from
> > > SQL Server at http://www.aspfaq.com/2403
> > >
> > > -- > > > Aaron Bertrand
> > > SQL Server MVP
> > > http://www.aspfaq.com/
> > >
> > >
> > >
> > >
> > > "George Hester" <hesterloli@.hotmail.com> wrote in message
> > > news:ugKtPGrwDHA.1764@.TK2MSFTNGP10.phx.gbl...
> > > I was following this article:
> > >
> > > =http://support.microsoft.com/default.aspx?scid=3Dkb;en-us;247931&Product=3D=
sql
> > >
> > > and got it working nicely. I would like to elaborate on this. =Rather then
> > > sending a succeed registration page to the client I would like to =send them
> > > a page telling them an email has been sent to their e-mail =address. That
> > > part of it I can do. My trouble is once I generate a password for =the
> > > client I need to let SQL 2000 SP3 know it's time to send them an =e-mail. Is
> > > this a trigger? Can anyone suggest what applications I might need =to do
> > > this (except Exchange) and some guidelines on how this can be =done? Thanks.
> > >
> > > I cannot use Exchange for this as I have Outlook 2003 installed =and it is
> > > not supported on the same server where Exchange 2003 is installed. = I only
> > > have the one Server Windows 2000 SP3.
> > >
> > > -- > > > George Hester
> > > __________________________________
> > >
> > >
> >
> >
> >|||Yes. Yes. Oh it works fine using xp-sendmail. No problem except for =the crashing Outlook 2002. That is not my ISP's fault. I can also use =CDO. But this is a little different and I would be happy with =xp-sendmail if I could just get SQL to release the call to MAPI after it =finishes the stored procedure. The one you recommend won't work because =my ISP has blocked my port 25. Unless I can get the stored procedure to =expect my SMTP server on port 2525 say. Then it will work.
-- George Hester
__________________________________
"Aaron Bertrand - MVP" <aaron@.TRASHaspfaq.com> wrote in message =news:#sEzMO#wDHA.4060@.TK2MSFTNGP11.phx.gbl...
> > Tibor for this stored procedure to work I have to use my ISP's SMTP
> server.
> > Are you running this out of your house? If your ISP is your only path =to
> the Internet, how do you plan to send mail using any solution?
> > -- > Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
> >|||> My ISP is not going to open my port 25.
Do they really have the ability to block a port OUTBOUND? In my experience,
the port blocking has been inbound...
In any case,
> the stored procedure says it is explicitly desgined for SMTP on port 25.
Did you actually *read* the docs on xp_smtp_sendmail? From
http://www.sqldev.net/xp/xpsmtp.htm:
@.port INT 25 Optional Valid socket port number Port number
for SMTP service, default port 25
--
Aaron Bertrand
SQL Server MVP|||See my other reply.
--
Aaron Bertrand
SQL Server MVP
"George Hester" <hesterloli@.hotmail.com> wrote in message
news:uvs8ycCxDHA.2708@.TK2MSFTNGP09.phx.gbl...
Yes. Yes. Oh it works fine using xp-sendmail. No problem except for the
crashing Outlook 2002. That is not my ISP's fault. I can also use CDO.
But this is a little different and I would be happy with xp-sendmail if I
could just get SQL to release the call to MAPI after it finishes the stored
procedure. The one you recommend won't work because my ISP has blocked my
port 25. Unless I can get the stored procedure to expect my SMTP server on
port 2525 say. Then it will work.|||Um thanks Aaron. Yes I read as much as I could understand. We all know =the word Oui in French. But I bet if you looked at a book from Marcel =Proust in the original you may have trouble finding that word.
-- George Hester
__________________________________
"Aaron Bertrand - MVP" <aaron@.TRASHaspfaq.com> wrote in message =news:OELpqlCxDHA.2156@.TK2MSFTNGP09.phx.gbl...
> > My ISP is not going to open my port 25.
> > Do they really have the ability to block a port OUTBOUND? In my =experience,
> the port blocking has been inbound...
> > In any case,
> > > the stored procedure says it is explicitly desgined for SMTP on port =25.
> > Did you actually *read* the docs on xp_smtp_sendmail? From
> http://www.sqldev.net/xp/xpsmtp.htm:
> > @.port INT 25 Optional Valid socket port number Port =number
> for SMTP service, default port 25
> > -- > Aaron Bertrand
> SQL Server MVP
> >|||A configuration issue was not it. It was how I called the extended =stored procedure xp_sendmail. See there is a statment in the BOL or at =Microsoft not sure which that when xp_sendmail is called we must first =call xp_startmail. It's true that this is not necessary but I believe =it is best to do all the procedures and determine if my issue still =occurs.
So this time I made a batch that looks like this:
DECLARE @.hc int
EXEC @.hc =3D xp_startmail @.user =3D 'My MAPI Profile',
@.password =3D NULL
If @.hc =3D 0
EXEC @.hc =3D xp_sendmail @.recipients =3D 'hesterloli@.hotmail.com',
@.message =3D 'Hello',
@.subject =3D 'From SQL Server 2000 SQL Mail'
If @.hc =3D 0
EXEC xp_stopmail
and put this in Query Analyzer. I ran it. All worked well there. The =SQL Mail started, the Mail was sent, and the SQL Mail stopped. And sure =enough I got the mail.
I then quit Outlook 2003 and tried to start it up again to see if I =avoided the error I posted a bit ago. No error.
If you think there is a better way to write this batch I'd appreciate =it. I just tried whatever I could get to not give me an error in Query =analyzer when I checked the statements.
-- George Hester
__________________________________
"Aaron Bertrand - MVP" <aaron@.TRASHaspfaq.com> wrote in message =news:e26eDN#wDHA.2448@.TK2MSFTNGP12.phx.gbl...
> > But the bug still exists.
> > Have you submitted it as a bug? Do you have a bug number?
> > From your description, sounds like a configuration issue, not a bug.
> > -- > Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
> >|||Hi Tibor. I got it to work. Thanks for that right now it seems the =ticket. And you too Aaron.
-- George Hester
__________________________________
"Tibor Karaszi" =<tibor.please_reply_to_public_forum.karaszi@.cornerstone.se> wrote in =message news:#ygbjd6wDHA.3216@.TK2MSFTNGP11.phx.gbl...
> Yes, you need an SMTP server, which IMO is the very strength of the =solution. No MAPI etc. MAPI was
> never designed as a multi-user app (say you have SQL Server and an =interactive user at the same
> time), nor was it designed to be used but by interactive users. That =is why you have soo many KB
> articles on the subject so there's a KB article which serves as just =an index to all the other KB
> articles.
> > -- > Tibor Karaszi, SQL Server MVP
> Archive at: =http://groups.google.com/groups?oi=3Ddjq&as_ugroup=3Dmicrosoft.public.sql=
server
> > > "George Hester" <hesterloli@.hotmail.com> wrote in message
> news:OIZhP81wDHA.1576@.TK2MSFTNGP11.phx.gbl...
> Tibor for this stored procedure to work I have to use my ISP's SMTP =server. They are blocking my
> port 25. Can I use that in this case and if so how? Thanks.
> > -- > George Hester
> __________________________________
> "Tibor Karaszi" =<tibor.please_reply_to_public_forum.karaszi@.cornerstone.se> wrote in =message
> news:#uVbGVuwDHA.1512@.TK2MSFTNGP10.phx.gbl...
> > I know that XP gets annoyed if I have two mail users at the same =time on one machine (one is SQL
> > Server, the other is me, as interactive user), where W2K was OK with =it. It seems "reasonable"
> that
> > W2KS is based on XP and exposes the same behavior. Did you consider =using xp_smtp_sendmail
> instead?
> >
> > -- > > Tibor Karaszi, SQL Server MVP
> > Archive at: =http://groups.google.com/groups?oi=3Ddjq&as_ugroup=3Dmicrosoft.public.sql=
server
> >
> >
> > "George Hester" <hesterloli@.hotmail.com> wrote in message
> > news:ONOZbMuwDHA.3116@.tk2msftngp13.phx.gbl...
> > Hi Aaron:
> >
> > Can you believe it? I got the SQL Mail setup and it seems to be =working. Using my ISPs SMTP
> > server. I did the test and it connected to the MAPI profile =successfully. Anyway I proceeded to
> > use the extended stored procedure xp_sendmail in Query Analyzer:
> >
> > xp_sendmail @.recipients =3D 'hesterloli@.hotmail.com',
> > @.message =3D 'Hello',
> > @.subject =3D 'From SQL Server 2000'
> >
> > Actually I sent one to that address and one to my POP3 account. =Both successfully as reported by
> > Query Analyzer.
> >
> > But I forgot to have Outlook 2003 open before I did that. So to see =if I got the mail I went to
> > open Outlook 2003. Know what happened? Outlook 2003 could not =open. I use MAPI profiles and
> when
> > I tried to start Outlook 2003 the Error message I got was, "The =service could not be started." No
> > offer to start in safe mode. Just the error message box. I post it =next time if I can replicate
> > the issue again.
> >
> > All I know is that it sounds like some dll went belly-up. I =rebooted and Outlook 2003 was fine
> and
> > there were the two e-mails from SQL in Outlook 2003 and Outlook =Express which handles my Hotmail
> > account.
> >
> > Now I don't know what to do. I could try the xp_sendmail again with =Outlook 2003 open and see if
> > that avoids the issue. But I just don't know. Ever heard of this =before?
> >
> > -- > > George Hester
> > __________________________________
> > "Aaron Bertrand [MVP]" <aaron@.TRASHaspfaq.com> wrote in message
> > news:Ok8Io0rwDHA.1512@.TK2MSFTNGP10.phx.gbl...
> > > Assuming you are using a stored procedure to generate the =password, you can
> > > send an e-mail from the stored procedure (I really don't recommend =doing
> > > this in a trigger). You can see some information about sending =e-mail from
> > > SQL Server at http://www.aspfaq.com/2403
> > >
> > > -- > > > Aaron Bertrand
> > > SQL Server MVP
> > > http://www.aspfaq.com/
> > >
> > >
> > >
> > >
> > > "George Hester" <hesterloli@.hotmail.com> wrote in message
> > > news:ugKtPGrwDHA.1764@.TK2MSFTNGP10.phx.gbl...
> > > I was following this article:
> > >
> > > =http://support.microsoft.com/default.aspx?scid=3Dkb;en-us;247931&Product=3D=
sql
> > >
> > > and got it working nicely. I would like to elaborate on this. =Rather then
> > > sending a succeed registration page to the client I would like to =send them
> > > a page telling them an email has been sent to their e-mail =address. That
> > > part of it I can do. My trouble is once I generate a password for =the
> > > client I need to let SQL 2000 SP3 know it's time to send them an =e-mail. Is
> > > this a trigger? Can anyone suggest what applications I might need =to do
> > > this (except Exchange) and some guidelines on how this can be =done? Thanks.
> > >
> > > I cannot use Exchange for this as I have Outlook 2003 installed =and it is
> > > not supported on the same server where Exchange 2003 is installed. = I only
> > > have the one Server Windows 2000 SP3.
> > >
> > > -- > > > George Hester
> > > __________________________________
> > >
> > >
> >
> >
> >

Wednesday, March 21, 2012

Is this default behavior?

Hello all,
I'm having difficulties understanding why something is not going the way I
want it (sounds familiar?). I'm testing SQL injection on my own PC, based on
the article at http://aspalliance.com/articleViewer...Id=385&pId=-1.
when I enter only my credentials in the user field, like
administrator';use master exec xp_cmdshell 'dir c:\*.*'--
I get the resultant string
SELECT strusername, strpassword FROM tUser WHERE strusername = 'beheerder';
use master exec xp_cmdshell 'dir c:\*.*' --' AND strpassword = ''
Now the output of "Response.write objrso.Fields.count" is 2. A closer look
gives me 'administrator' and 'password'. Not the C:\ drive listing, which
does show up in SQL Query Analyzer! Is this by any means possible with the
code
Set objConn = Server.CreateObject("ADODB.Connection")
Set objrso = Server.CreateObject("ADODB.Recordset")
sql = "SELECT strusername, strpassword FROM tUser WHERE strusername = '" +
username & _
"' AND strpassword = '" + password & _
"'"
objConn.Open cn
objrso.open sql, cn
If not, how should I change this code? Any hints would be highly welcome.
Best regards,
Carl.
Hi Carl,
Since you have two different SQL statements, separated by semicolon, then
provider executes them separately and returns two resultsets (recordsets).
When you open objrso recordset, then it points to the first one. To be able
to get information from the subsequent recordsets, you need to call
NextRecordset method of the opened recordset
Set objrso=objrso.NextRecordset
If provider returns another resultset, then you will see it after this call
Val Mazur
Microsoft MVP
"Carl Matthews" <ecvaneersel@.nospam.hotmail.com> wrote in message
news:ecJmrkjIEHA.1140@.tk2msftngp13.phx.gbl...
> Hello all,
> I'm having difficulties understanding why something is not going the way I
> want it (sounds familiar?). I'm testing SQL injection on my own PC, based
> on
> the article at http://aspalliance.com/articleViewer...Id=385&pId=-1.
> when I enter only my credentials in the user field, like
> administrator';use master exec xp_cmdshell 'dir c:\*.*'--
> I get the resultant string
> SELECT strusername, strpassword FROM tUser WHERE strusername =
> 'beheerder';
> use master exec xp_cmdshell 'dir c:\*.*' --' AND strpassword = ''
>
> Now the output of "Response.write objrso.Fields.count" is 2. A closer look
> gives me 'administrator' and 'password'. Not the C:\ drive listing, which
> does show up in SQL Query Analyzer! Is this by any means possible with the
> code
> Set objConn = Server.CreateObject("ADODB.Connection")
> Set objrso = Server.CreateObject("ADODB.Recordset")
> sql = "SELECT strusername, strpassword FROM tUser WHERE strusername = '" +
> username & _
> "' AND strpassword = '" + password & _
> "'"
> objConn.Open cn
> objrso.open sql, cn
> If not, how should I change this code? Any hints would be highly welcome.
> Best regards,
> Carl.
>

Is this default behavior?

Hello all,
I'm having difficulties understanding why something is not going the way I
want it (sounds familiar?). I'm testing SQL injection on my own PC, based on
the article at http://aspalliance.com/articleViewe...aId=385&pId=-1.
when I enter only my credentials in the user field, like
administrator';use master exec xp_cmdshell 'dir c:\*.*'--
I get the resultant string
SELECT strusername, strpassword FROM tUser WHERE strusername = 'beheerder';
use master exec xp_cmdshell 'dir c:\*.*' --' AND strpassword = ''
Now the output of "Response.write objrso.Fields.count" is 2. A closer look
gives me 'administrator' and 'password'. Not the C:\ drive listing, which
does show up in SQL Query Analyzer! Is this by any means possible with the
code
Set objConn = Server.CreateObject("ADODB.Connection")
Set objrso = Server.CreateObject("ADODB.Recordset")
sql = "SELECT strusername, strpassword FROM tUser WHERE strusername = '" +
username & _
"' AND strpassword = '" + password & _
"'"
objConn.Open cn
objrso.open sql, cn
If not, how should I change this code? Any hints would be highly welcome.
Best regards,
Carl.Hi Carl,
Since you have two different SQL statements, separated by semicolon, then
provider executes them separately and returns two resultsets (recordsets).
When you open objrso recordset, then it points to the first one. To be able
to get information from the subsequent recordsets, you need to call
NextRecordset method of the opened recordset
Set objrso=objrso.NextRecordset
If provider returns another resultset, then you will see it after this call
Val Mazur
Microsoft MVP
"Carl Matthews" <ecvaneersel@.nospam.hotmail.com> wrote in message
news:ecJmrkjIEHA.1140@.tk2msftngp13.phx.gbl...
> Hello all,
> I'm having difficulties understanding why something is not going the way I
> want it (sounds familiar?). I'm testing SQL injection on my own PC, based
> on
> the article at http://aspalliance.com/articleViewe...aId=385&pId=-1.
> when I enter only my credentials in the user field, like
> administrator';use master exec xp_cmdshell 'dir c:\*.*'--
> I get the resultant string
> SELECT strusername, strpassword FROM tUser WHERE strusername =
> 'beheerder';
> use master exec xp_cmdshell 'dir c:\*.*' --' AND strpassword = ''
>
> Now the output of "Response.write objrso.Fields.count" is 2. A closer look
> gives me 'administrator' and 'password'. Not the C:\ drive listing, which
> does show up in SQL Query Analyzer! Is this by any means possible with the
> code
> Set objConn = Server.CreateObject("ADODB.Connection")
> Set objrso = Server.CreateObject("ADODB.Recordset")
> sql = "SELECT strusername, strpassword FROM tUser WHERE strusername = '" +
> username & _
> "' AND strpassword = '" + password & _
> "'"
> objConn.Open cn
> objrso.open sql, cn
> If not, how should I change this code? Any hints would be highly welcome.
> Best regards,
> Carl.
>sql

Monday, March 19, 2012

Is This a Correct Method ?

Hi All,
While inserting date value I wish to take only date part So I tried
this
Create Table JTrial
(
XYZ int,
d datetime default convert(varchar,getdate(),112)
)
insert into JTrial(XYZ) values(1)
insert into JTrial(XYZ) values(2)
insert into JTrial(XYZ) values(3)
insert into JTrial(XYZ) values(4)
select * from JTrial
Is there any better alternative. Check constraint like this
check ( d = convert(varchar,d,112) )
Will not allow me to insert row
insert into JTrial(XYZ,d) values(5,getdate()) -- Because here date has
time part
Is writing A trigger better alternative ?
Please guide me on this ?
With warm regards
Jatinder SinghYes, that is the method that I prefer (although I always specify a length fo
r varchar, see your
convert function). I also like to have a check constraint instead of a trigg
er. I have elaborated a
bit on this topic in http://www.karaszi.com/SQLServer/info_datetime.asp.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"jsfromynr" <jatinder.singh@.clovertechnologies.com> wrote in message
news:1124441020.097121.43310@.f14g2000cwb.googlegroups.com...
> Hi All,
> While inserting date value I wish to take only date part So I tried
> this
> Create Table JTrial
> (
> XYZ int,
> d datetime default convert(varchar,getdate(),112)
> )
> insert into JTrial(XYZ) values(1)
> insert into JTrial(XYZ) values(2)
> insert into JTrial(XYZ) values(3)
> insert into JTrial(XYZ) values(4)
> select * from JTrial
> Is there any better alternative. Check constraint like this
> check ( d = convert(varchar,d,112) )
> Will not allow me to insert row
> insert into JTrial(XYZ,d) values(5,getdate()) -- Because here date has
> time part
> Is writing A trigger better alternative ?
> Please guide me on this ?
> With warm regards
> Jatinder Singh
>|||Hi Tibor,
The default constraint work with a value (fix sort of/ not entered by
user) of date and Check constraint does not let it pass if it has any
time other than (00:00:00), Both in what your article suggest and what
I tried.
Thanks for giving valuable advice , I purposed Trigger because I
would storage there.
Create Table JTrial
(
XYZ int,
d datetime default convert(varchar,getdate(),112)
)
Go
Create trigger trg1 on JTrial for Insert
as
Begin
Update JTrial set d=convert(varchar,d,112)
-- I should have take a cross join with the Inserted table
End
Declare @.aDate datetime
select getdate()
set @.aDate = '2005-08-19 18:17:09.607'
insert into JTrial(XYZ,d) values(1,getdate())
insert into JTrial(XYZ,d) values(2,@.aDate) -- User entered value
insert into JTrial(XYZ) values(3) -- Default will be stored
insert into JTrial(XYZ) values(4)
select * from JTrial
Drop table JTrial
With warm regards
Jatinder Singh
Tibor Karaszi wrote:
> Yes, that is the method that I prefer (although I always specify a length
for varchar, see your
> convert function). I also like to have a check constraint instead of a tri
gger. I have elaborated a
> bit on this topic in http://www.karaszi.com/SQLServer/info_datetime.asp.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "jsfromynr" <jatinder.singh@.clovertechnologies.com> wrote in message
> news:1124441020.097121.43310@.f14g2000cwb.googlegroups.com...|||Jatinder,
If I understand you correctly, you are saying that a trigger has the possibl
e advantage of changing
the datetime value that the user entered so that it always has 00:00:00 as t
he time portion. Where a
check constraint will produce an error.
Yes, that is a correct observation. You can't say that one approach is alway
s correct. I prefer the
check constraint, as you will catch where applications is sending an invalid
datetime value and fix
the application. IMO, that is a better approach to just changing the value w
ithout the user or
client application programmer knowing you have changed it.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"jsfromynr" <jatinder.singh@.clovertechnologies.com> wrote in message
news:1124455793.019933.100900@.g43g2000cwa.googlegroups.com...
> Hi Tibor,
> The default constraint work with a value (fix sort of/ not entered by
> user) of date and Check constraint does not let it pass if it has any
> time other than (00:00:00), Both in what your article suggest and what
> I tried.
> Thanks for giving valuable advice , I purposed Trigger because I
> would storage there.
> Create Table JTrial
> (
> XYZ int,
> d datetime default convert(varchar,getdate(),112)
> )
> Go
> Create trigger trg1 on JTrial for Insert
> as
> Begin
> Update JTrial set d=convert(varchar,d,112)
> -- I should have take a cross join with the Inserted table
> End
> Declare @.aDate datetime
> select getdate()
> set @.aDate = '2005-08-19 18:17:09.607'
> insert into JTrial(XYZ,d) values(1,getdate())
> insert into JTrial(XYZ,d) values(2,@.aDate) -- User entered value
> insert into JTrial(XYZ) values(3) -- Default will be stored
> insert into JTrial(XYZ) values(4)
> select * from JTrial
> Drop table JTrial
> With warm regards
> Jatinder Singh
> Tibor Karaszi wrote:
>|||Sorry Typo
inner join in trigger
With warm regards
Jatinder Singh|||Tibor,
Thanks for giving your time. Is speed /performance an issue
here means using trigger v/s Conversions at client side.
With warm regards
Jatinder Singh|||Yes, passing in the correct data to begin with will give better performance
compared to having a
trigger which goes back to the modified rows and alter the value to the desi
red value.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"jsfromynr" <jatinder.singh@.clovertechnologies.com> wrote in message
news:1124457867.638474.309950@.g14g2000cwa.googlegroups.com...
> Tibor,
> Thanks for giving your time. Is speed /performance an issue
> here means using trigger v/s Conversions at client side.
> With warm regards
> Jatinder Singh
>

Friday, March 9, 2012

Is there any way to track LOGIN ID which stops the SQL Service?

Hello All,

I am running SQL Server 2000 Standard Edition on Windows 2000 Server... I believe Windows 2000 does not have an audit enabled by default like the one in Windows 2003 servers to capture the login ID's that is stopping the SQL Server...

I am getting N/A in user column in SQL Service Stop Event in Application Log... We need to track this event badly.. Is there any way to do this? Your Help on this is highly appreciated...

--Rajesh

What about

http://techrepublic.com.com/5208-11184-0.html?forumID=39&threadID=170891

HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

Monday, February 20, 2012

Is there any advantage for creating a default instance vs. a named

Hello, DBA outthere.
I understand that SQL Server 2000 allows 1 default instance and up to 15
named instances per server. I believe the default instance needs to be
created first.
Is there any reason to have more than 1 instance per server? Does having
more than one instance affect the overall SQL server performance? SQL
2000 server also allows server alias if users to have different server
naming.
I usually create named instance for new installation instead of letting
the SQL setup create the default instance. I had some run-ins with using
named instance. Some not-so-well-prepared application setups looks into
the registry for default instance
(HKL\Software\Microsoft\MSSQLServer\MSSQLServer). If whatever they looks
for is not there, the application will fail. Developers need to take
into account that as SQL Server allows DBA to create either default or
named instance or both.
In any event, give share your thoughts on using default or named instance.
Thanks.
JJ.Hi
Having multiple instances will stretch your resources more. You may want to
create multiple instances if you have a packaged application that require
specific settings or maybe because of issues of security.
I don't think you have to create the default instance first although I have
never tried doing otherwise!
John
"John Joe" <yukondba@.hotmail-lessspam.com> wrote in message
news:%234L5alHiEHA.592@.TK2MSFTNGP11.phx.gbl...
> Hello, DBA outthere.
> I understand that SQL Server 2000 allows 1 default instance and up to 15
> named instances per server. I believe the default instance needs to be
> created first.
> Is there any reason to have more than 1 instance per server? Does having
> more than one instance affect the overall SQL server performance? SQL
> 2000 server also allows server alias if users to have different server
> naming.
> I usually create named instance for new installation instead of letting
> the SQL setup create the default instance. I had some run-ins with using
> named instance. Some not-so-well-prepared application setups looks into
> the registry for default instance
> (HKL\Software\Microsoft\MSSQLServer\MSSQLServer). If whatever they looks
> for is not there, the application will fail. Developers need to take
> into account that as SQL Server allows DBA to create either default or
> named instance or both.
> In any event, give share your thoughts on using default or named instance.
> Thanks.
> JJ.

Is there an option of adding style sheet for the report

Can I set the default style of my report like we do thecss in web development
I don't want to edit the style of the report manager .What I want is to edit
the report style. [mean the rendering style of the actual report]
Suppose I have to set borderwidth of table =.25pt
bordercolor of table,all of it's cell to silver.
Borderstyle to be windowsinset.
Backgroundcolor of the full layout to be black
How Can I do that ?All these settings can be done using the properties of table, page etc.. from
your VS itself.
Amarnath, MCTS
"Kamii47" wrote:
> Can I set the default style of my report like we do thecss in web development
> I don't want to edit the style of the report manager .What I want is to edit
> the report style. [mean the rendering style of the actual report]
> Suppose I have to set borderwidth of table =.25pt
> bordercolor of table,all of it's cell to silver.
> Borderstyle to be windowsinset.
> Backgroundcolor of the full layout to be black
> How Can I do that ?|||Thanks Amar
What I want's is to set some of my default style which will remain same in
all the report of my project {like we do css in our web project}
"Amarnath" wrote:
> All these settings can be done using the properties of table, page etc.. from
> your VS itself.
> Amarnath, MCTS
>
> "Kamii47" wrote:
> > Can I set the default style of my report like we do thecss in web development
> > I don't want to edit the style of the report manager .What I want is to edit
> > the report style. [mean the rendering style of the actual report]
> >
> > Suppose I have to set borderwidth of table =.25pt
> >
> > bordercolor of table,all of it's cell to silver.
> >
> > Borderstyle to be windowsinset.
> >
> > Backgroundcolor of the full layout to be black
> >
> > How Can I do that ?|||In SSRS what your need to do is create a standard report template and save it
on the template folder, so whenever you go for creating a new report you can
select this to make it standard. This is the way you can achieve your
standardization.
Amarnath, MCTS
"Kamii47" wrote:
> Thanks Amar
> What I want's is to set some of my default style which will remain same in
> all the report of my project {like we do css in our web project}
> "Amarnath" wrote:
> > All these settings can be done using the properties of table, page etc.. from
> > your VS itself.
> >
> > Amarnath, MCTS
> >
> >
> > "Kamii47" wrote:
> >
> > > Can I set the default style of my report like we do thecss in web development
> > > I don't want to edit the style of the report manager .What I want is to edit
> > > the report style. [mean the rendering style of the actual report]
> > >
> > > Suppose I have to set borderwidth of table =.25pt
> > >
> > > bordercolor of table,all of it's cell to silver.
> > >
> > > Borderstyle to be windowsinset.
> > >
> > > Backgroundcolor of the full layout to be black
> > >
> > > How Can I do that ?|||There was no native support for CSS in standard RS 2000.
But according to this blog post, there's a hotfix available to make use of
style sheets:
http://blogs.msdn.com/ketaanhs/archive/2005/09/05/461050.aspx
-Not sure if this also applies to RS 2005, but you can probably check if the
syntax that the post author describes can be used in RS 2005.
I haven't tried this method, I've just created a template and worked
manually from there. Hopefully it will help you, though. :)
Kaisa M. Lindahl Lervik
"Kamii47" <Kamii47@.discussions.microsoft.com> wrote in message
news:B87D1605-7DFB-45D0-ADB1-BE74194D9D22@.microsoft.com...
> Can I set the default style of my report like we do thecss in web
> development
> I don't want to edit the style of the report manager .What I want is to
> edit
> the report style. [mean the rendering style of the actual report]
> Suppose I have to set borderwidth of table =.25pt
> bordercolor of table,all of it's cell to silver.
> Borderstyle to be windowsinset.
> Backgroundcolor of the full layout to be black
> How Can I do that ?