Dear Surajits,
Thanks for teach me the method of sending query result via SQL mail. But I
want to ask that if I want today date on the Subject, how can I perform this
?
i.e. @.Subject = 'Summary for the date of ' + GetDate() <= Can I write like
this ?
Thanks for concern.
You can't call the GETDATE() function in the proc execution. Bus you can declare a variable and
construct the subject into that variable (including today's date) and then pass that variable as a
parameter for subject in the xp_sendmail call.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Devil Garfield" <DevilGarfield@.discussions.microsoft.com> wrote in message
news:6F8F593F-C69B-467E-9BFF-276096853050@.microsoft.com...
> Dear Surajits,
> Thanks for teach me the method of sending query result via SQL mail. But I
> want to ask that if I want today date on the Subject, how can I perform this
> ?
> i.e. @.Subject = 'Summary for the date of ' + GetDate() <= Can I write like
> this ?
> Thanks for concern.
sql
Showing posts with label sending. Show all posts
Showing posts with label sending. Show all posts
Monday, March 26, 2012
More About SQL Mail
Dear Surajits,
Thanks for teach me the method of sending query result via SQL mail. But I
want to ask that if I want today date on the Subject, how can I perform this
?
i.e. @.Subject = 'Summary for the date of ' + GetDate() <= Can I write like
this '
Thanks for concern.You can't call the GETDATE() function in the proc execution. Bus you can dec
lare a variable and
construct the subject into that variable (including today's date) and then p
XXX that variable as a
parameter for subject in the xp_sendmail call.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Devil Garfield" <DevilGarfield@.discussions.microsoft.com> wrote in message
news:6F8F593F-C69B-467E-9BFF-276096853050@.microsoft.com...
> Dear Surajits,
> Thanks for teach me the method of sending query result via SQL mail. But I
> want to ask that if I want today date on the Subject, how can I perform th
is
> ?
> i.e. @.Subject = 'Summary for the date of ' + GetDate() <= Can I write like
> this '
> Thanks for concern.
Thanks for teach me the method of sending query result via SQL mail. But I
want to ask that if I want today date on the Subject, how can I perform this
?
i.e. @.Subject = 'Summary for the date of ' + GetDate() <= Can I write like
this '
Thanks for concern.You can't call the GETDATE() function in the proc execution. Bus you can dec
lare a variable and
construct the subject into that variable (including today's date) and then p
XXX that variable as a
parameter for subject in the xp_sendmail call.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Devil Garfield" <DevilGarfield@.discussions.microsoft.com> wrote in message
news:6F8F593F-C69B-467E-9BFF-276096853050@.microsoft.com...
> Dear Surajits,
> Thanks for teach me the method of sending query result via SQL mail. But I
> want to ask that if I want today date on the Subject, how can I perform th
is
> ?
> i.e. @.Subject = 'Summary for the date of ' + GetDate() <= Can I write like
> this '
> Thanks for concern.
More About SQL Mail
Dear Surajits,
Thanks for teach me the method of sending query result via SQL mail. But I
want to ask that if I want today date on the Subject, how can I perform this
?
i.e. @.Subject = 'Summary for the date of ' + GetDate() <= Can I write like
this '
Thanks for concern.You can't call the GETDATE() function in the proc execution. Bus you can declare a variable and
construct the subject into that variable (including today's date) and then pass that variable as a
parameter for subject in the xp_sendmail call.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Devil Garfield" <DevilGarfield@.discussions.microsoft.com> wrote in message
news:6F8F593F-C69B-467E-9BFF-276096853050@.microsoft.com...
> Dear Surajits,
> Thanks for teach me the method of sending query result via SQL mail. But I
> want to ask that if I want today date on the Subject, how can I perform this
> ?
> i.e. @.Subject = 'Summary for the date of ' + GetDate() <= Can I write like
> this '
> Thanks for concern.
Thanks for teach me the method of sending query result via SQL mail. But I
want to ask that if I want today date on the Subject, how can I perform this
?
i.e. @.Subject = 'Summary for the date of ' + GetDate() <= Can I write like
this '
Thanks for concern.You can't call the GETDATE() function in the proc execution. Bus you can declare a variable and
construct the subject into that variable (including today's date) and then pass that variable as a
parameter for subject in the xp_sendmail call.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Devil Garfield" <DevilGarfield@.discussions.microsoft.com> wrote in message
news:6F8F593F-C69B-467E-9BFF-276096853050@.microsoft.com...
> Dear Surajits,
> Thanks for teach me the method of sending query result via SQL mail. But I
> want to ask that if I want today date on the Subject, how can I perform this
> ?
> i.e. @.Subject = 'Summary for the date of ' + GetDate() <= Can I write like
> this '
> Thanks for concern.
Wednesday, March 7, 2012
Monitor SQL commands
I need to monitor who is sending what SQL commands when. Is there any way
to do this?
Usarian Skiff
SQL Profiler.
comes with sql server...of course it depends on how they are connecting
to the database (if everyone connects as the same user, which i have
seen, then it is going to be more difficult to track down).
In enterprise manager > Tools > SQL Profiler
File > New > Trace
connect to server of your choice
choose one of the templates.
go to the events tab and select anything else you want to know (there
is a TSQL section and security audit section, both of which you will
need to answer your questions)
you can then set up any filters that you think apply.
then run it.
you might need to dink around with it a bit to get the hang of it, but
it is a very powerful tool and is a must for maintaining production
environments.
hth,
hans nelsen
|||Thanks Much.
Unfortunately, our control software does in fact use a single db login for
every workstation, so it will be a pain indeed, but, as you pointed out, a
necessary pain. Thanks again!
Usarian M. Skiff
"Hans Nelsen" <hnelsen@.owh.com> wrote in message
news:1110585962.109808.283360@.o13g2000cwo.googlegr oups.com...
> SQL Profiler.
> comes with sql server...of course it depends on how they are connecting
> to the database (if everyone connects as the same user, which i have
> seen, then it is going to be more difficult to track down).
> In enterprise manager > Tools > SQL Profiler
> File > New > Trace
> connect to server of your choice
> choose one of the templates.
> go to the events tab and select anything else you want to know (there
> is a TSQL section and security audit section, both of which you will
> need to answer your questions)
> you can then set up any filters that you think apply.
> then run it.
> you might need to dink around with it a bit to get the hang of it, but
> it is a very powerful tool and is a must for maintaining production
> environments.
> hth,
> hans nelsen
>
to do this?
Usarian Skiff
SQL Profiler.
comes with sql server...of course it depends on how they are connecting
to the database (if everyone connects as the same user, which i have
seen, then it is going to be more difficult to track down).
In enterprise manager > Tools > SQL Profiler
File > New > Trace
connect to server of your choice
choose one of the templates.
go to the events tab and select anything else you want to know (there
is a TSQL section and security audit section, both of which you will
need to answer your questions)
you can then set up any filters that you think apply.
then run it.
you might need to dink around with it a bit to get the hang of it, but
it is a very powerful tool and is a must for maintaining production
environments.
hth,
hans nelsen
|||Thanks Much.
Unfortunately, our control software does in fact use a single db login for
every workstation, so it will be a pain indeed, but, as you pointed out, a
necessary pain. Thanks again!
Usarian M. Skiff
"Hans Nelsen" <hnelsen@.owh.com> wrote in message
news:1110585962.109808.283360@.o13g2000cwo.googlegr oups.com...
> SQL Profiler.
> comes with sql server...of course it depends on how they are connecting
> to the database (if everyone connects as the same user, which i have
> seen, then it is going to be more difficult to track down).
> In enterprise manager > Tools > SQL Profiler
> File > New > Trace
> connect to server of your choice
> choose one of the templates.
> go to the events tab and select anything else you want to know (there
> is a TSQL section and security audit section, both of which you will
> need to answer your questions)
> you can then set up any filters that you think apply.
> then run it.
> you might need to dink around with it a bit to get the hang of it, but
> it is a very powerful tool and is a must for maintaining production
> environments.
> hth,
> hans nelsen
>
Monitor SQL commands
I need to monitor who is sending what SQL commands when. Is there any way
to do this?
Usarian SkiffSQL Profiler.
comes with sql server...of course it depends on how they are connecting
to the database (if everyone connects as the same user, which i have
seen, then it is going to be more difficult to track down).
In enterprise manager > Tools > SQL Profiler
File > New > Trace
connect to server of your choice
choose one of the templates.
go to the events tab and select anything else you want to know (there
is a TSQL section and security audit section, both of which you will
need to answer your questions)
you can then set up any filters that you think apply.
then run it.
you might need to dink around with it a bit to get the hang of it, but
it is a very powerful tool and is a must for maintaining production
environments.
hth,
hans nelsen|||Thanks Much.
Unfortunately, our control software does in fact use a single db login for
every workstation, so it will be a pain indeed, but, as you pointed out, a
necessary pain. Thanks again!
Usarian M. Skiff
"Hans Nelsen" <hnelsen@.owh.com> wrote in message
news:1110585962.109808.283360@.o13g2000cwo.googlegroups.com...
> SQL Profiler.
> comes with sql server...of course it depends on how they are connecting
> to the database (if everyone connects as the same user, which i have
> seen, then it is going to be more difficult to track down).
> In enterprise manager > Tools > SQL Profiler
> File > New > Trace
> connect to server of your choice
> choose one of the templates.
> go to the events tab and select anything else you want to know (there
> is a TSQL section and security audit section, both of which you will
> need to answer your questions)
> you can then set up any filters that you think apply.
> then run it.
> you might need to dink around with it a bit to get the hang of it, but
> it is a very powerful tool and is a must for maintaining production
> environments.
> hth,
> hans nelsen
>
to do this?
Usarian SkiffSQL Profiler.
comes with sql server...of course it depends on how they are connecting
to the database (if everyone connects as the same user, which i have
seen, then it is going to be more difficult to track down).
In enterprise manager > Tools > SQL Profiler
File > New > Trace
connect to server of your choice
choose one of the templates.
go to the events tab and select anything else you want to know (there
is a TSQL section and security audit section, both of which you will
need to answer your questions)
you can then set up any filters that you think apply.
then run it.
you might need to dink around with it a bit to get the hang of it, but
it is a very powerful tool and is a must for maintaining production
environments.
hth,
hans nelsen|||Thanks Much.
Unfortunately, our control software does in fact use a single db login for
every workstation, so it will be a pain indeed, but, as you pointed out, a
necessary pain. Thanks again!
Usarian M. Skiff
"Hans Nelsen" <hnelsen@.owh.com> wrote in message
news:1110585962.109808.283360@.o13g2000cwo.googlegroups.com...
> SQL Profiler.
> comes with sql server...of course it depends on how they are connecting
> to the database (if everyone connects as the same user, which i have
> seen, then it is going to be more difficult to track down).
> In enterprise manager > Tools > SQL Profiler
> File > New > Trace
> connect to server of your choice
> choose one of the templates.
> go to the events tab and select anything else you want to know (there
> is a TSQL section and security audit section, both of which you will
> need to answer your questions)
> you can then set up any filters that you think apply.
> then run it.
> you might need to dink around with it a bit to get the hang of it, but
> it is a very powerful tool and is a must for maintaining production
> environments.
> hth,
> hans nelsen
>
Monitor SQL commands
I need to monitor who is sending what SQL commands when. Is there any way
to do this?
Usarian SkiffSQL Profiler.
comes with sql server...of course it depends on how they are connecting
to the database (if everyone connects as the same user, which i have
seen, then it is going to be more difficult to track down).
In enterprise manager > Tools > SQL Profiler
File > New > Trace
connect to server of your choice
choose one of the templates.
go to the events tab and select anything else you want to know (there
is a TSQL section and security audit section, both of which you will
need to answer your questions)
you can then set up any filters that you think apply.
then run it.
you might need to dink around with it a bit to get the hang of it, but
it is a very powerful tool and is a must for maintaining production
environments.
hth,
hans nelsen|||Thanks Much.
Unfortunately, our control software does in fact use a single db login for
every workstation, so it will be a pain indeed, but, as you pointed out, a
necessary pain. Thanks again!
Usarian M. Skiff
"Hans Nelsen" <hnelsen@.owh.com> wrote in message
news:1110585962.109808.283360@.o13g2000cwo.googlegroups.com...
> SQL Profiler.
> comes with sql server...of course it depends on how they are connecting
> to the database (if everyone connects as the same user, which i have
> seen, then it is going to be more difficult to track down).
> In enterprise manager > Tools > SQL Profiler
> File > New > Trace
> connect to server of your choice
> choose one of the templates.
> go to the events tab and select anything else you want to know (there
> is a TSQL section and security audit section, both of which you will
> need to answer your questions)
> you can then set up any filters that you think apply.
> then run it.
> you might need to dink around with it a bit to get the hang of it, but
> it is a very powerful tool and is a must for maintaining production
> environments.
> hth,
> hans nelsen
>
to do this?
Usarian SkiffSQL Profiler.
comes with sql server...of course it depends on how they are connecting
to the database (if everyone connects as the same user, which i have
seen, then it is going to be more difficult to track down).
In enterprise manager > Tools > SQL Profiler
File > New > Trace
connect to server of your choice
choose one of the templates.
go to the events tab and select anything else you want to know (there
is a TSQL section and security audit section, both of which you will
need to answer your questions)
you can then set up any filters that you think apply.
then run it.
you might need to dink around with it a bit to get the hang of it, but
it is a very powerful tool and is a must for maintaining production
environments.
hth,
hans nelsen|||Thanks Much.
Unfortunately, our control software does in fact use a single db login for
every workstation, so it will be a pain indeed, but, as you pointed out, a
necessary pain. Thanks again!
Usarian M. Skiff
"Hans Nelsen" <hnelsen@.owh.com> wrote in message
news:1110585962.109808.283360@.o13g2000cwo.googlegroups.com...
> SQL Profiler.
> comes with sql server...of course it depends on how they are connecting
> to the database (if everyone connects as the same user, which i have
> seen, then it is going to be more difficult to track down).
> In enterprise manager > Tools > SQL Profiler
> File > New > Trace
> connect to server of your choice
> choose one of the templates.
> go to the events tab and select anything else you want to know (there
> is a TSQL section and security audit section, both of which you will
> need to answer your questions)
> you can then set up any filters that you think apply.
> then run it.
> you might need to dink around with it a bit to get the hang of it, but
> it is a very powerful tool and is a must for maintaining production
> environments.
> hth,
> hans nelsen
>
Subscribe to:
Posts (Atom)