Thursday, March 29, 2012
Can't stop page breaks on my grouped list
I've created a list and defined a group for monthly period. In the
list, I include several controls that show each month's summary values.
Unfortunately, each month's set of controls is appearing on separate
pages. The sections are small enough to fit two or three per page.
I've verified that the two page break properties are both set to False.
I've set the Keep Together property to False. What else am I missing?
Are their layout issues concerning margins or anything like that? This
is the first time I've tried to use grouped lists so I don't know what
to think.
I created the report with the report wizards and then modified it from
there. Maybe that will help.
Thanks,
DavidIt's me...the originator of this message.
I apparently have not found the list control's property that made it
serve as the Page field container that I chose in the New Report Wizard
(Matrix report). I would have thought the New Page After property.
Nevertheless, I created a new list control and copied my controls into
it. After defining my group, all worked as expected.
So if you're reading this and have a guess why the list control
mysteriously ejected pages, please respond. I'm interested.
David|||What was the property ? I am having a similar problem with the
occasional page in my report (200 pages) breaking about half way down
the page.
davidb@.mercurydata.com wrote:
> It's me...the originator of this message.
> I apparently have not found the list control's property that made it
> serve as the Page field container that I chose in the New Report Wizard
> (Matrix report). I would have thought the New Page After property.
> Nevertheless, I created a new list control and copied my controls into
> it. After defining my group, all worked as expected.
> So if you're reading this and have a guess why the list control
> mysteriously ejected pages, please respond. I'm interested.
> David
cant start Trace
able to start it. I call sp_trace_setstatus 1,1 and it says completed
successfully. It then creates the file it writes too but never writes to it
when I generate activity. Any ideas why?
TIA, ChrisR
sql2k sp3a
Hi Chris
With server side traces, SQL Server writes to the file in 128K chunks, so
you won't see anything written until you have 128K worth of activity.
Look at fn_trace_getinfo( ) to check that your trace really is running.
Then try stopping and closing the trace:
sp_trace_setstatus 1, 0 -- stop the trace
sp_trace_setstatus 1, 2 -- close the trace
You must stop before closing or the close won't do anything. Only after
closing SQL Server write to the file.
Or, you can stop the SQL Server services, and that will also flush the
collected trace events to the file.
HTH
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"ChrisR" <noemail@.bla.com> wrote in message
news:u0nrZLfOFHA.904@.tk2msftngp13.phx.gbl...
>I just created a server side Trace with no filters for testing but Im not
>able to start it. I call sp_trace_setstatus 1,1 and it says completed
>successfully. It then creates the file it writes too but never writes to it
>when I generate activity. Any ideas why?
> TIA, ChrisR
> sql2k sp3a
>
|||Kalen I know this will sound odd, but it almost seems as though nothing gets
written ubtil the box is rebooted. It stays at 0kb until I reboot, at which
time there is a larger size.
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:OUzjYPfOFHA.2728@.TK2MSFTNGP15.phx.gbl...
> Hi Chris
> With server side traces, SQL Server writes to the file in 128K chunks, so
> you won't see anything written until you have 128K worth of activity.
> Look at fn_trace_getinfo( ) to check that your trace really is running.
> Then try stopping and closing the trace:
> sp_trace_setstatus 1, 0 -- stop the trace
> sp_trace_setstatus 1, 2 -- close the trace
> You must stop before closing or the close won't do anything. Only after
> closing SQL Server write to the file.
> Or, you can stop the SQL Server services, and that will also flush the
> collected trace events to the file.
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "ChrisR" <noemail@.bla.com> wrote in message
> news:u0nrZLfOFHA.904@.tk2msftngp13.phx.gbl...
>
|||Are you saying you have stopped and closed the trace, and still nothing gets
written?
If so, can you show the output of fn_trace_getinfo and then exact commands
you are running to stop and close the trace?
HTH
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"ChrisR" <noemail@.bla.com> wrote in message
news:uOTRg8iOFHA.2568@.TK2MSFTNGP14.phx.gbl...
> Kalen I know this will sound odd, but it almost seems as though nothing
> gets written ubtil the box is rebooted. It stays at 0kb until I reboot, at
> which time there is a larger size.
>
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:OUzjYPfOFHA.2728@.TK2MSFTNGP15.phx.gbl...
>
|||--Status before stopping
traceid property value
-- -- ----------
1 1 0
1 2 c:\JobTrace
1 3 5
1 4 NULL
1 5 1
--stopping trace
sp_trace_setstatus 1,0
--status after stopping
traceid property value
-- -- ----------
1 1 0
1 2 c:\JobTrace
1 3 5
1 4 NULL
1 5 0
I dont see a command to close the Trace, Im just closing Query Anyalyzer.
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:eatZvLjOFHA.1396@.TK2MSFTNGP10.phx.gbl...
> Are you saying you have stopped and closed the trace, and still nothing
> gets written?
> If so, can you show the output of fn_trace_getinfo and then exact
> commands you are running to stop and close the trace?
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "ChrisR" <noemail@.bla.com> wrote in message
> news:uOTRg8iOFHA.2568@.TK2MSFTNGP14.phx.gbl...
>
|||Closing Qa will not stop or close the trace and the file size may not update
that often while it is running. If you look at sp_trace_setstatus in BOL
you will see hope to stop and close the trace.
Andrew J. Kelly SQL MVP
"ChrisR" <noemail@.bla.com> wrote in message
news:u$QxpVjOFHA.1396@.TK2MSFTNGP10.phx.gbl...
> --Status before stopping
> traceid property value
> -- -- ----------
--
> 1 1 0
> 1 2 c:\JobTrace
> 1 3 5
> 1 4 NULL
> 1 5 1
> --stopping trace
> sp_trace_setstatus 1,0
> --status after stopping
> traceid property value
> -- -- ----------
--
> 1 1 0
> 1 2 c:\JobTrace
> 1 3 5
> 1 4 NULL
> 1 5 0
> I dont see a command to close the Trace, Im just closing Query Anyalyzer.
>
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:eatZvLjOFHA.1396@.TK2MSFTNGP10.phx.gbl...
>
|||As noted earlier I did this:
--stopping trace
sp_trace_setstatus 1,0
Was I supposed to do this:
--stopping trace
sp_trace_setstatus 1,2
I was hoping to avoid that because BOL say it will delete the definition
from the server. I was hoping to be able to reuse it. Will info not be
written until closed/ deleted?
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:ui3XxrjOFHA.2788@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> Closing Qa will not stop or close the trace and the file size may not
> update that often while it is running. If you look at sp_trace_setstatus
> in BOL you will see hope to stop and close the trace.
> --
> Andrew J. Kelly SQL MVP
>
> "ChrisR" <noemail@.bla.com> wrote in message
> news:u$QxpVjOFHA.1396@.TK2MSFTNGP10.phx.gbl...
--[vbcol=seagreen]
--
>
|||This is what I said in my first reply to you. Nothing will be written to the
file until the trace is CLOSED.
Please read my first reply again. You must first stop (set status to 0) and
then close (set status to 2).
If you want to save the trace definition, save the SQL commands that you
used to start it, and write them to a file that you can load up again.
HTH
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"ChrisR" <noemail@.bla.com> wrote in message
news:uZ8STvjOFHA.3512@.TK2MSFTNGP15.phx.gbl...[vbcol=seagreen]
> As noted earlier I did this:
> --stopping trace
> sp_trace_setstatus 1,0
> Was I supposed to do this:
> --stopping trace
> sp_trace_setstatus 1,2
> I was hoping to avoid that because BOL say it will delete the definition
> from the server. I was hoping to be able to reuse it. Will info not be
> written until closed/ deleted?
>
> "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
> news:ui3XxrjOFHA.2788@.TK2MSFTNGP09.phx.gbl...
--[vbcol=seagreen]
--
>
|||Woops! Thanks Kalen.
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:ursw1NkOFHA.3292@.TK2MSFTNGP12.phx.gbl...[vbcol=seagreen]
> This is what I said in my first reply to you. Nothing will be written to
> the file until the trace is CLOSED.
> Please read my first reply again. You must first stop (set status to 0)
> and then close (set status to 2).
> If you want to save the trace definition, save the SQL commands that you
> used to start it, and write them to a file that you can load up again.
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "ChrisR" <noemail@.bla.com> wrote in message
> news:uZ8STvjOFHA.3512@.TK2MSFTNGP15.phx.gbl...
--[vbcol=seagreen]
--
>
cant start Trace
able to start it. I call sp_trace_setstatus 1,1 and it says completed
successfully. It then creates the file it writes too but never writes to it
when I generate activity. Any ideas why?
TIA, ChrisR
sql2k sp3aHi Chris
With server side traces, SQL Server writes to the file in 128K chunks, so
you won't see anything written until you have 128K worth of activity.
Look at fn_trace_getinfo( ) to check that your trace really is running.
Then try stopping and closing the trace:
sp_trace_setstatus 1, 0 -- stop the trace
sp_trace_setstatus 1, 2 -- close the trace
You must stop before closing or the close won't do anything. Only after
closing SQL Server write to the file.
Or, you can stop the SQL Server services, and that will also flush the
collected trace events to the file.
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"ChrisR" <noemail@.bla.com> wrote in message
news:u0nrZLfOFHA.904@.tk2msftngp13.phx.gbl...
>I just created a server side Trace with no filters for testing but Im not
>able to start it. I call sp_trace_setstatus 1,1 and it says completed
>successfully. It then creates the file it writes too but never writes to it
>when I generate activity. Any ideas why?
> TIA, ChrisR
> sql2k sp3a
>|||Kalen I know this will sound odd, but it almost seems as though nothing gets
written ubtil the box is rebooted. It stays at 0kb until I reboot, at which
time there is a larger size.
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:OUzjYPfOFHA.2728@.TK2MSFTNGP15.phx.gbl...
> Hi Chris
> With server side traces, SQL Server writes to the file in 128K chunks, so
> you won't see anything written until you have 128K worth of activity.
> Look at fn_trace_getinfo( ) to check that your trace really is running.
> Then try stopping and closing the trace:
> sp_trace_setstatus 1, 0 -- stop the trace
> sp_trace_setstatus 1, 2 -- close the trace
> You must stop before closing or the close won't do anything. Only after
> closing SQL Server write to the file.
> Or, you can stop the SQL Server services, and that will also flush the
> collected trace events to the file.
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "ChrisR" <noemail@.bla.com> wrote in message
> news:u0nrZLfOFHA.904@.tk2msftngp13.phx.gbl...
>|||Are you saying you have stopped and closed the trace, and still nothing gets
written?
If so, can you show the output of fn_trace_getinfo and then exact commands
you are running to stop and close the trace?
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"ChrisR" <noemail@.bla.com> wrote in message
news:uOTRg8iOFHA.2568@.TK2MSFTNGP14.phx.gbl...
> Kalen I know this will sound odd, but it almost seems as though nothing
> gets written ubtil the box is rebooted. It stays at 0kb until I reboot, at
> which time there is a larger size.
>
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:OUzjYPfOFHA.2728@.TK2MSFTNGP15.phx.gbl...
>|||--Status before stopping
traceid property value
-- -- ----
----
----
--
--
1 1 0
1 2 c:\JobTrace
1 3 5
1 4 NULL
1 5 1
--stopping trace
sp_trace_setstatus 1,0
--status after stopping
traceid property value
-- -- ----
----
----
--
--
1 1 0
1 2 c:\JobTrace
1 3 5
1 4 NULL
1 5 0
I dont see a command to close the Trace, Im just closing Query Anyalyzer.
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:eatZvLjOFHA.1396@.TK2MSFTNGP10.phx.gbl...
> Are you saying you have stopped and closed the trace, and still nothing
> gets written?
> If so, can you show the output of fn_trace_getinfo and then exact
> commands you are running to stop and close the trace?
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "ChrisR" <noemail@.bla.com> wrote in message
> news:uOTRg8iOFHA.2568@.TK2MSFTNGP14.phx.gbl...
>|||Closing Qa will not stop or close the trace and the file size may not update
that often while it is running. If you look at sp_trace_setstatus in BOL
you will see hope to stop and close the trace.
Andrew J. Kelly SQL MVP
"ChrisR" <noemail@.bla.com> wrote in message
news:u$QxpVjOFHA.1396@.TK2MSFTNGP10.phx.gbl...
> --Status before stopping
> traceid property value
> -- -- ----
----
----
--
--
> 1 1 0
> 1 2 c:\JobTrace
> 1 3 5
> 1 4 NULL
> 1 5 1
> --stopping trace
> sp_trace_setstatus 1,0
> --status after stopping
> traceid property value
> -- -- ----
----
----
--
--
> 1 1 0
> 1 2 c:\JobTrace
> 1 3 5
> 1 4 NULL
> 1 5 0
> I dont see a command to close the Trace, Im just closing Query Anyalyzer.
>
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:eatZvLjOFHA.1396@.TK2MSFTNGP10.phx.gbl...
>|||As noted earlier I did this:
--stopping trace
sp_trace_setstatus 1,0
Was I supposed to do this:
--stopping trace
sp_trace_setstatus 1,2
I was hoping to avoid that because BOL say it will delete the definition
from the server. I was hoping to be able to reuse it. Will info not be
written until closed/ deleted?
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:ui3XxrjOFHA.2788@.TK2MSFTNGP09.phx.gbl...
> Closing Qa will not stop or close the trace and the file size may not
> update that often while it is running. If you look at sp_trace_setstatus
> in BOL you will see hope to stop and close the trace.
> --
> Andrew J. Kelly SQL MVP
>
> "ChrisR" <noemail@.bla.com> wrote in message
> news:u$QxpVjOFHA.1396@.TK2MSFTNGP10.phx.gbl...
--[vbcol=seagreen]
--[vbcol=seagreen]
>|||This is what I said in my first reply to you. Nothing will be written to the
file until the trace is CLOSED.
Please read my first reply again. You must first stop (set status to 0) and
then close (set status to 2).
If you want to save the trace definition, save the SQL commands that you
used to start it, and write them to a file that you can load up again.
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"ChrisR" <noemail@.bla.com> wrote in message
news:uZ8STvjOFHA.3512@.TK2MSFTNGP15.phx.gbl...
> As noted earlier I did this:
> --stopping trace
> sp_trace_setstatus 1,0
> Was I supposed to do this:
> --stopping trace
> sp_trace_setstatus 1,2
> I was hoping to avoid that because BOL say it will delete the definition
> from the server. I was hoping to be able to reuse it. Will info not be
> written until closed/ deleted?
>
> "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
> news:ui3XxrjOFHA.2788@.TK2MSFTNGP09.phx.gbl...
--[vbcol=seagreen]
--[vbcol=seagreen]
>|||Woops! Thanks Kalen.
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:ursw1NkOFHA.3292@.TK2MSFTNGP12.phx.gbl...
> This is what I said in my first reply to you. Nothing will be written to
> the file until the trace is CLOSED.
> Please read my first reply again. You must first stop (set status to 0)
> and then close (set status to 2).
> If you want to save the trace definition, save the SQL commands that you
> used to start it, and write them to a file that you can load up again.
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "ChrisR" <noemail@.bla.com> wrote in message
> news:uZ8STvjOFHA.3512@.TK2MSFTNGP15.phx.gbl...
--[vbcol=seagreen]
--[vbcol=seagreen]
>sql
cant start Trace
able to start it. I call sp_trace_setstatus 1,1 and it says completed
successfully. It then creates the file it writes too but never writes to it
when I generate activity. Any ideas why?
TIA, ChrisR
sql2k sp3aHi Chris
With server side traces, SQL Server writes to the file in 128K chunks, so
you won't see anything written until you have 128K worth of activity.
Look at fn_trace_getinfo( ) to check that your trace really is running.
Then try stopping and closing the trace:
sp_trace_setstatus 1, 0 -- stop the trace
sp_trace_setstatus 1, 2 -- close the trace
You must stop before closing or the close won't do anything. Only after
closing SQL Server write to the file.
Or, you can stop the SQL Server services, and that will also flush the
collected trace events to the file.
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"ChrisR" <noemail@.bla.com> wrote in message
news:u0nrZLfOFHA.904@.tk2msftngp13.phx.gbl...
>I just created a server side Trace with no filters for testing but Im not
>able to start it. I call sp_trace_setstatus 1,1 and it says completed
>successfully. It then creates the file it writes too but never writes to it
>when I generate activity. Any ideas why?
> TIA, ChrisR
> sql2k sp3a
>|||Kalen I know this will sound odd, but it almost seems as though nothing gets
written ubtil the box is rebooted. It stays at 0kb until I reboot, at which
time there is a larger size.
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:OUzjYPfOFHA.2728@.TK2MSFTNGP15.phx.gbl...
> Hi Chris
> With server side traces, SQL Server writes to the file in 128K chunks, so
> you won't see anything written until you have 128K worth of activity.
> Look at fn_trace_getinfo( ) to check that your trace really is running.
> Then try stopping and closing the trace:
> sp_trace_setstatus 1, 0 -- stop the trace
> sp_trace_setstatus 1, 2 -- close the trace
> You must stop before closing or the close won't do anything. Only after
> closing SQL Server write to the file.
> Or, you can stop the SQL Server services, and that will also flush the
> collected trace events to the file.
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "ChrisR" <noemail@.bla.com> wrote in message
> news:u0nrZLfOFHA.904@.tk2msftngp13.phx.gbl...
>>I just created a server side Trace with no filters for testing but Im not
>>able to start it. I call sp_trace_setstatus 1,1 and it says completed
>>successfully. It then creates the file it writes too but never writes to
>>it when I generate activity. Any ideas why?
>> TIA, ChrisR
>> sql2k sp3a
>|||Are you saying you have stopped and closed the trace, and still nothing gets
written?
If so, can you show the output of fn_trace_getinfo and then exact commands
you are running to stop and close the trace?
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"ChrisR" <noemail@.bla.com> wrote in message
news:uOTRg8iOFHA.2568@.TK2MSFTNGP14.phx.gbl...
> Kalen I know this will sound odd, but it almost seems as though nothing
> gets written ubtil the box is rebooted. It stays at 0kb until I reboot, at
> which time there is a larger size.
>
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:OUzjYPfOFHA.2728@.TK2MSFTNGP15.phx.gbl...
>> Hi Chris
>> With server side traces, SQL Server writes to the file in 128K chunks, so
>> you won't see anything written until you have 128K worth of activity.
>> Look at fn_trace_getinfo( ) to check that your trace really is running.
>> Then try stopping and closing the trace:
>> sp_trace_setstatus 1, 0 -- stop the trace
>> sp_trace_setstatus 1, 2 -- close the trace
>> You must stop before closing or the close won't do anything. Only after
>> closing SQL Server write to the file.
>> Or, you can stop the SQL Server services, and that will also flush the
>> collected trace events to the file.
>> --
>> HTH
>> --
>> Kalen Delaney
>> SQL Server MVP
>> www.SolidQualityLearning.com
>>
>> "ChrisR" <noemail@.bla.com> wrote in message
>> news:u0nrZLfOFHA.904@.tk2msftngp13.phx.gbl...
>>I just created a server side Trace with no filters for testing but Im not
>>able to start it. I call sp_trace_setstatus 1,1 and it says completed
>>successfully. It then creates the file it writes too but never writes to
>>it when I generate activity. Any ideas why?
>> TIA, ChrisR
>> sql2k sp3a
>>
>|||--Status before stopping
traceid property value
-- -- -----------
1 1 0
1 2 c:\JobTrace
1 3 5
1 4 NULL
1 5 1
--stopping trace
sp_trace_setstatus 1,0
--status after stopping
traceid property value
-- -- -----------
1 1 0
1 2 c:\JobTrace
1 3 5
1 4 NULL
1 5 0
I dont see a command to close the Trace, Im just closing Query Anyalyzer.
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:eatZvLjOFHA.1396@.TK2MSFTNGP10.phx.gbl...
> Are you saying you have stopped and closed the trace, and still nothing
> gets written?
> If so, can you show the output of fn_trace_getinfo and then exact
> commands you are running to stop and close the trace?
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "ChrisR" <noemail@.bla.com> wrote in message
> news:uOTRg8iOFHA.2568@.TK2MSFTNGP14.phx.gbl...
>> Kalen I know this will sound odd, but it almost seems as though nothing
>> gets written ubtil the box is rebooted. It stays at 0kb until I reboot,
>> at which time there is a larger size.
>>
>> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
>> news:OUzjYPfOFHA.2728@.TK2MSFTNGP15.phx.gbl...
>> Hi Chris
>> With server side traces, SQL Server writes to the file in 128K chunks,
>> so you won't see anything written until you have 128K worth of activity.
>> Look at fn_trace_getinfo( ) to check that your trace really is running.
>> Then try stopping and closing the trace:
>> sp_trace_setstatus 1, 0 -- stop the trace
>> sp_trace_setstatus 1, 2 -- close the trace
>> You must stop before closing or the close won't do anything. Only after
>> closing SQL Server write to the file.
>> Or, you can stop the SQL Server services, and that will also flush the
>> collected trace events to the file.
>> --
>> HTH
>> --
>> Kalen Delaney
>> SQL Server MVP
>> www.SolidQualityLearning.com
>>
>> "ChrisR" <noemail@.bla.com> wrote in message
>> news:u0nrZLfOFHA.904@.tk2msftngp13.phx.gbl...
>>I just created a server side Trace with no filters for testing but Im
>>not able to start it. I call sp_trace_setstatus 1,1 and it says
>>completed successfully. It then creates the file it writes too but never
>>writes to it when I generate activity. Any ideas why?
>> TIA, ChrisR
>> sql2k sp3a
>>
>>
>|||Closing Qa will not stop or close the trace and the file size may not update
that often while it is running. If you look at sp_trace_setstatus in BOL
you will see hope to stop and close the trace.
--
Andrew J. Kelly SQL MVP
"ChrisR" <noemail@.bla.com> wrote in message
news:u$QxpVjOFHA.1396@.TK2MSFTNGP10.phx.gbl...
> --Status before stopping
> traceid property value
> -- -- -----------
> 1 1 0
> 1 2 c:\JobTrace
> 1 3 5
> 1 4 NULL
> 1 5 1
> --stopping trace
> sp_trace_setstatus 1,0
> --status after stopping
> traceid property value
> -- -- -----------
> 1 1 0
> 1 2 c:\JobTrace
> 1 3 5
> 1 4 NULL
> 1 5 0
> I dont see a command to close the Trace, Im just closing Query Anyalyzer.
>
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:eatZvLjOFHA.1396@.TK2MSFTNGP10.phx.gbl...
>> Are you saying you have stopped and closed the trace, and still nothing
>> gets written?
>> If so, can you show the output of fn_trace_getinfo and then exact
>> commands you are running to stop and close the trace?
>> --
>> HTH
>> --
>> Kalen Delaney
>> SQL Server MVP
>> www.SolidQualityLearning.com
>>
>> "ChrisR" <noemail@.bla.com> wrote in message
>> news:uOTRg8iOFHA.2568@.TK2MSFTNGP14.phx.gbl...
>> Kalen I know this will sound odd, but it almost seems as though nothing
>> gets written ubtil the box is rebooted. It stays at 0kb until I reboot,
>> at which time there is a larger size.
>>
>> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
>> news:OUzjYPfOFHA.2728@.TK2MSFTNGP15.phx.gbl...
>> Hi Chris
>> With server side traces, SQL Server writes to the file in 128K chunks,
>> so you won't see anything written until you have 128K worth of
>> activity.
>> Look at fn_trace_getinfo( ) to check that your trace really is running.
>> Then try stopping and closing the trace:
>> sp_trace_setstatus 1, 0 -- stop the trace
>> sp_trace_setstatus 1, 2 -- close the trace
>> You must stop before closing or the close won't do anything. Only after
>> closing SQL Server write to the file.
>> Or, you can stop the SQL Server services, and that will also flush the
>> collected trace events to the file.
>> --
>> HTH
>> --
>> Kalen Delaney
>> SQL Server MVP
>> www.SolidQualityLearning.com
>>
>> "ChrisR" <noemail@.bla.com> wrote in message
>> news:u0nrZLfOFHA.904@.tk2msftngp13.phx.gbl...
>>I just created a server side Trace with no filters for testing but Im
>>not able to start it. I call sp_trace_setstatus 1,1 and it says
>>completed successfully. It then creates the file it writes too but
>>never writes to it when I generate activity. Any ideas why?
>> TIA, ChrisR
>> sql2k sp3a
>>
>>
>>
>|||As noted earlier I did this:
--stopping trace
sp_trace_setstatus 1,0
Was I supposed to do this:
--stopping trace
sp_trace_setstatus 1,2
I was hoping to avoid that because BOL say it will delete the definition
from the server. I was hoping to be able to reuse it. Will info not be
written until closed/ deleted?
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:ui3XxrjOFHA.2788@.TK2MSFTNGP09.phx.gbl...
> Closing Qa will not stop or close the trace and the file size may not
> update that often while it is running. If you look at sp_trace_setstatus
> in BOL you will see hope to stop and close the trace.
> --
> Andrew J. Kelly SQL MVP
>
> "ChrisR" <noemail@.bla.com> wrote in message
> news:u$QxpVjOFHA.1396@.TK2MSFTNGP10.phx.gbl...
>> --Status before stopping
>> traceid property value
>> -- -- -----------
>> 1 1 0
>> 1 2 c:\JobTrace
>> 1 3 5
>> 1 4 NULL
>> 1 5 1
>> --stopping trace
>> sp_trace_setstatus 1,0
>> --status after stopping
>> traceid property value
>> -- -- -----------
>> 1 1 0
>> 1 2 c:\JobTrace
>> 1 3 5
>> 1 4 NULL
>> 1 5 0
>> I dont see a command to close the Trace, Im just closing Query Anyalyzer.
>>
>> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
>> news:eatZvLjOFHA.1396@.TK2MSFTNGP10.phx.gbl...
>> Are you saying you have stopped and closed the trace, and still nothing
>> gets written?
>> If so, can you show the output of fn_trace_getinfo and then exact
>> commands you are running to stop and close the trace?
>> --
>> HTH
>> --
>> Kalen Delaney
>> SQL Server MVP
>> www.SolidQualityLearning.com
>>
>> "ChrisR" <noemail@.bla.com> wrote in message
>> news:uOTRg8iOFHA.2568@.TK2MSFTNGP14.phx.gbl...
>> Kalen I know this will sound odd, but it almost seems as though nothing
>> gets written ubtil the box is rebooted. It stays at 0kb until I reboot,
>> at which time there is a larger size.
>>
>> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
>> news:OUzjYPfOFHA.2728@.TK2MSFTNGP15.phx.gbl...
>> Hi Chris
>> With server side traces, SQL Server writes to the file in 128K chunks,
>> so you won't see anything written until you have 128K worth of
>> activity.
>> Look at fn_trace_getinfo( ) to check that your trace really is
>> running.
>> Then try stopping and closing the trace:
>> sp_trace_setstatus 1, 0 -- stop the trace
>> sp_trace_setstatus 1, 2 -- close the trace
>> You must stop before closing or the close won't do anything. Only
>> after closing SQL Server write to the file.
>> Or, you can stop the SQL Server services, and that will also flush the
>> collected trace events to the file.
>> --
>> HTH
>> --
>> Kalen Delaney
>> SQL Server MVP
>> www.SolidQualityLearning.com
>>
>> "ChrisR" <noemail@.bla.com> wrote in message
>> news:u0nrZLfOFHA.904@.tk2msftngp13.phx.gbl...
>>I just created a server side Trace with no filters for testing but Im
>>not able to start it. I call sp_trace_setstatus 1,1 and it says
>>completed successfully. It then creates the file it writes too but
>>never writes to it when I generate activity. Any ideas why?
>> TIA, ChrisR
>> sql2k sp3a
>>
>>
>>
>>
>|||This is what I said in my first reply to you. Nothing will be written to the
file until the trace is CLOSED.
Please read my first reply again. You must first stop (set status to 0) and
then close (set status to 2).
If you want to save the trace definition, save the SQL commands that you
used to start it, and write them to a file that you can load up again.
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"ChrisR" <noemail@.bla.com> wrote in message
news:uZ8STvjOFHA.3512@.TK2MSFTNGP15.phx.gbl...
> As noted earlier I did this:
> --stopping trace
> sp_trace_setstatus 1,0
> Was I supposed to do this:
> --stopping trace
> sp_trace_setstatus 1,2
> I was hoping to avoid that because BOL say it will delete the definition
> from the server. I was hoping to be able to reuse it. Will info not be
> written until closed/ deleted?
>
> "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
> news:ui3XxrjOFHA.2788@.TK2MSFTNGP09.phx.gbl...
>> Closing Qa will not stop or close the trace and the file size may not
>> update that often while it is running. If you look at sp_trace_setstatus
>> in BOL you will see hope to stop and close the trace.
>> --
>> Andrew J. Kelly SQL MVP
>>
>> "ChrisR" <noemail@.bla.com> wrote in message
>> news:u$QxpVjOFHA.1396@.TK2MSFTNGP10.phx.gbl...
>> --Status before stopping
>> traceid property value
>> -- -- -----------
>> 1 1 0
>> 1 2 c:\JobTrace
>> 1 3 5
>> 1 4 NULL
>> 1 5 1
>> --stopping trace
>> sp_trace_setstatus 1,0
>> --status after stopping
>> traceid property value
>> -- -- -----------
>> 1 1 0
>> 1 2 c:\JobTrace
>> 1 3 5
>> 1 4 NULL
>> 1 5 0
>> I dont see a command to close the Trace, Im just closing Query
>> Anyalyzer.
>>
>> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
>> news:eatZvLjOFHA.1396@.TK2MSFTNGP10.phx.gbl...
>> Are you saying you have stopped and closed the trace, and still nothing
>> gets written?
>> If so, can you show the output of fn_trace_getinfo and then exact
>> commands you are running to stop and close the trace?
>> --
>> HTH
>> --
>> Kalen Delaney
>> SQL Server MVP
>> www.SolidQualityLearning.com
>>
>> "ChrisR" <noemail@.bla.com> wrote in message
>> news:uOTRg8iOFHA.2568@.TK2MSFTNGP14.phx.gbl...
>> Kalen I know this will sound odd, but it almost seems as though
>> nothing gets written ubtil the box is rebooted. It stays at 0kb until
>> I reboot, at which time there is a larger size.
>>
>> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
>> news:OUzjYPfOFHA.2728@.TK2MSFTNGP15.phx.gbl...
>> Hi Chris
>> With server side traces, SQL Server writes to the file in 128K
>> chunks, so you won't see anything written until you have 128K worth
>> of activity.
>> Look at fn_trace_getinfo( ) to check that your trace really is
>> running.
>> Then try stopping and closing the trace:
>> sp_trace_setstatus 1, 0 -- stop the trace
>> sp_trace_setstatus 1, 2 -- close the trace
>> You must stop before closing or the close won't do anything. Only
>> after closing SQL Server write to the file.
>> Or, you can stop the SQL Server services, and that will also flush
>> the collected trace events to the file.
>> --
>> HTH
>> --
>> Kalen Delaney
>> SQL Server MVP
>> www.SolidQualityLearning.com
>>
>> "ChrisR" <noemail@.bla.com> wrote in message
>> news:u0nrZLfOFHA.904@.tk2msftngp13.phx.gbl...
>>>I just created a server side Trace with no filters for testing but Im
>>>not able to start it. I call sp_trace_setstatus 1,1 and it says
>>>completed successfully. It then creates the file it writes too but
>>>never writes to it when I generate activity. Any ideas why?
>>>
>>> TIA, ChrisR
>>>
>>> sql2k sp3a
>>>
>>
>>
>>
>>
>>
>|||Woops! Thanks Kalen.
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:ursw1NkOFHA.3292@.TK2MSFTNGP12.phx.gbl...
> This is what I said in my first reply to you. Nothing will be written to
> the file until the trace is CLOSED.
> Please read my first reply again. You must first stop (set status to 0)
> and then close (set status to 2).
> If you want to save the trace definition, save the SQL commands that you
> used to start it, and write them to a file that you can load up again.
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "ChrisR" <noemail@.bla.com> wrote in message
> news:uZ8STvjOFHA.3512@.TK2MSFTNGP15.phx.gbl...
>> As noted earlier I did this:
>> --stopping trace
>> sp_trace_setstatus 1,0
>> Was I supposed to do this:
>> --stopping trace
>> sp_trace_setstatus 1,2
>> I was hoping to avoid that because BOL say it will delete the definition
>> from the server. I was hoping to be able to reuse it. Will info not be
>> written until closed/ deleted?
>>
>> "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
>> news:ui3XxrjOFHA.2788@.TK2MSFTNGP09.phx.gbl...
>> Closing Qa will not stop or close the trace and the file size may not
>> update that often while it is running. If you look at
>> sp_trace_setstatus in BOL you will see hope to stop and close the trace.
>> --
>> Andrew J. Kelly SQL MVP
>>
>> "ChrisR" <noemail@.bla.com> wrote in message
>> news:u$QxpVjOFHA.1396@.TK2MSFTNGP10.phx.gbl...
>> --Status before stopping
>> traceid property value
>> -- -- -----------
>> 1 1 0
>> 1 2 c:\JobTrace
>> 1 3 5
>> 1 4 NULL
>> 1 5 1
>> --stopping trace
>> sp_trace_setstatus 1,0
>> --status after stopping
>> traceid property value
>> -- -- -----------
>> 1 1 0
>> 1 2 c:\JobTrace
>> 1 3 5
>> 1 4 NULL
>> 1 5 0
>> I dont see a command to close the Trace, Im just closing Query
>> Anyalyzer.
>>
>> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
>> news:eatZvLjOFHA.1396@.TK2MSFTNGP10.phx.gbl...
>> Are you saying you have stopped and closed the trace, and still
>> nothing gets written?
>> If so, can you show the output of fn_trace_getinfo and then exact
>> commands you are running to stop and close the trace?
>> --
>> HTH
>> --
>> Kalen Delaney
>> SQL Server MVP
>> www.SolidQualityLearning.com
>>
>> "ChrisR" <noemail@.bla.com> wrote in message
>> news:uOTRg8iOFHA.2568@.TK2MSFTNGP14.phx.gbl...
>> Kalen I know this will sound odd, but it almost seems as though
>> nothing gets written ubtil the box is rebooted. It stays at 0kb until
>> I reboot, at which time there is a larger size.
>>
>> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
>> news:OUzjYPfOFHA.2728@.TK2MSFTNGP15.phx.gbl...
>>> Hi Chris
>>>
>>> With server side traces, SQL Server writes to the file in 128K
>>> chunks, so you won't see anything written until you have 128K worth
>>> of activity.
>>>
>>> Look at fn_trace_getinfo( ) to check that your trace really is
>>> running.
>>>
>>> Then try stopping and closing the trace:
>>> sp_trace_setstatus 1, 0 -- stop the trace
>>> sp_trace_setstatus 1, 2 -- close the trace
>>>
>>> You must stop before closing or the close won't do anything. Only
>>> after closing SQL Server write to the file.
>>> Or, you can stop the SQL Server services, and that will also flush
>>> the collected trace events to the file.
>>> --
>>> HTH
>>> --
>>> Kalen Delaney
>>> SQL Server MVP
>>> www.SolidQualityLearning.com
>>>
>>>
>>> "ChrisR" <noemail@.bla.com> wrote in message
>>> news:u0nrZLfOFHA.904@.tk2msftngp13.phx.gbl...
>>>I just created a server side Trace with no filters for testing but
>>>Im not able to start it. I call sp_trace_setstatus 1,1 and it says
>>>completed successfully. It then creates the file it writes too but
>>>never writes to it when I generate activity. Any ideas why?
>>>
>>> TIA, ChrisR
>>>
>>> sql2k sp3a
>>>
>>>
>>>
>>
>>
>>
>>
>>
>
Sunday, March 25, 2012
Can't start a job that was created by user A from user B
I have a job I created with user A, but I need user B to be able to execute
this job programatically. I've given user B permission to EXECUTE the
"msdb.dbo.sp_start_job" sproc and the user is able to execute it but with an
error thrown. The following is the error I get when I run it with user B.
This error does not appear when I run it with user A.
The specified @.job_name ('MyJobName') does not exist.
After doing some research by looking at the system sprocs, I found that the
error is thrown from a call made to 'msdb.dbo.sp_verify_job_identifiers'. I
researched that sproc and then found the system code that is throwing the
error, listed below.
-- Check if the job name is ambiguous
IF ((SELECT COUNT(*)
FROM msdb.dbo.sysjobs_view
WHERE (name = @.job_name)) > 1)
BEGIN
RAISERROR(14293, -1, -1, @.job_name, @.name_of_id_parameter,
@.name_of_name_parameter)
RETURN(1) -- Failure
END
I performed a SELECT * query to the sysjobs_view view with user B and 0 rows
were returned. So it appears that the view is filtering the results by user
and the job is not found which is causing the error.
Do you guys know of a way I can make this work? I would appreciate any help.
Thanks!
Johnny
Hi Johnny,
Only members of the sysadmin fixed role or the jobowner can start a job.
HTH
Adam
Adam J Warne, MCDBA
"Johnny" wrote:
> Hello all,
> I have a job I created with user A, but I need user B to be able to execute
> this job programatically. I've given user B permission to EXECUTE the
> "msdb.dbo.sp_start_job" sproc and the user is able to execute it but with an
> error thrown. The following is the error I get when I run it with user B.
> This error does not appear when I run it with user A.
> The specified @.job_name ('MyJobName') does not exist.
> After doing some research by looking at the system sprocs, I found that the
> error is thrown from a call made to 'msdb.dbo.sp_verify_job_identifiers'. I
> researched that sproc and then found the system code that is throwing the
> error, listed below.
> -- Check if the job name is ambiguous
> IF ((SELECT COUNT(*)
> FROM msdb.dbo.sysjobs_view
> WHERE (name = @.job_name)) > 1)
> BEGIN
> RAISERROR(14293, -1, -1, @.job_name, @.name_of_id_parameter,
> @.name_of_name_parameter)
> RETURN(1) -- Failure
> END
>
> I performed a SELECT * query to the sysjobs_view view with user B and 0 rows
> were returned. So it appears that the view is filtering the results by user
> and the job is not found which is causing the error.
> Do you guys know of a way I can make this work? I would appreciate any help.
> Thanks!
> Johnny
>
|||Thanks. I didnt want to do that but I guess I have no choice.
Johnny
"Adam Warne" wrote:
[vbcol=seagreen]
> Hi Johnny,
> Only members of the sysadmin fixed role or the jobowner can start a job.
> HTH
> Adam
> --
> Adam J Warne, MCDBA
>
> "Johnny" wrote:
Can't start a job that was created by user A from user B
I have a job I created with user A, but I need user B to be able to execute
this job programatically. I've given user B permission to EXECUTE the
"msdb.dbo.sp_start_job" sproc and the user is able to execute it but with an
error thrown. The following is the error I get when I run it with user B.
This error does not appear when I run it with user A.
The specified @.job_name ('MyJobName') does not exist.
After doing some research by looking at the system sprocs, I found that the
error is thrown from a call made to 'msdb.dbo.sp_verify_job_identifiers'. I
researched that sproc and then found the system code that is throwing the
error, listed below.
-- Check if the job name is ambiguous
IF ((SELECT COUNT(*)
FROM msdb.dbo.sysjobs_view
WHERE (name = @.job_name)) > 1)
BEGIN
RAISERROR(14293, -1, -1, @.job_name, @.name_of_id_parameter,
@.name_of_name_parameter)
RETURN(1) -- Failure
END
I performed a SELECT * query to the sysjobs_view view with user B and 0 rows
were returned. So it appears that the view is filtering the results by user
and the job is not found which is causing the error.
Do you guys know of a way I can make this work? I would appreciate any help.
Thanks!
JohnnyHi Johnny,
Only members of the sysadmin fixed role or the jobowner can start a job.
HTH
Adam
--
Adam J Warne, MCDBA
"Johnny" wrote:
> Hello all,
> I have a job I created with user A, but I need user B to be able to execut
e
> this job programatically. I've given user B permission to EXECUTE the
> "msdb.dbo.sp_start_job" sproc and the user is able to execute it but with
an
> error thrown. The following is the error I get when I run it with user B.
> This error does not appear when I run it with user A.
> The specified @.job_name ('MyJobName') does not exist.
> After doing some research by looking at the system sprocs, I found that th
e
> error is thrown from a call made to 'msdb.dbo.sp_verify_job_identifiers'.
I
> researched that sproc and then found the system code that is throwing the
> error, listed below.
> -- Check if the job name is ambiguous
> IF ((SELECT COUNT(*)
> FROM msdb.dbo.sysjobs_view
> WHERE (name = @.job_name)) > 1)
> BEGIN
> RAISERROR(14293, -1, -1, @.job_name, @.name_of_id_parameter,
> @.name_of_name_parameter)
> RETURN(1) -- Failure
> END
>
> I performed a SELECT * query to the sysjobs_view view with user B and 0 ro
ws
> were returned. So it appears that the view is filtering the results by use
r
> and the job is not found which is causing the error.
> Do you guys know of a way I can make this work? I would appreciate any hel
p.
> Thanks!
> Johnny
>|||Thanks. I didnt want to do that but I guess I have no choice.
Johnny
"Adam Warne" wrote:
[vbcol=seagreen]
> Hi Johnny,
> Only members of the sysadmin fixed role or the jobowner can start a job.
> HTH
> Adam
> --
> Adam J Warne, MCDBA
>
> "Johnny" wrote:
>
Can't start a job that was created by user A from user B
I have a job I created with user A, but I need user B to be able to execute
this job programatically. I've given user B permission to EXECUTE the
"msdb.dbo.sp_start_job" sproc and the user is able to execute it but with an
error thrown. The following is the error I get when I run it with user B.
This error does not appear when I run it with user A.
The specified @.job_name ('MyJobName') does not exist.
After doing some research by looking at the system sprocs, I found that the
error is thrown from a call made to 'msdb.dbo.sp_verify_job_identifiers'. I
researched that sproc and then found the system code that is throwing the
error, listed below.
-- Check if the job name is ambiguous
IF ((SELECT COUNT(*)
FROM msdb.dbo.sysjobs_view
WHERE (name = @.job_name)) > 1)
BEGIN
RAISERROR(14293, -1, -1, @.job_name, @.name_of_id_parameter,
@.name_of_name_parameter)
RETURN(1) -- Failure
END
I performed a SELECT * query to the sysjobs_view view with user B and 0 rows
were returned. So it appears that the view is filtering the results by user
and the job is not found which is causing the error.
Do you guys know of a way I can make this work? I would appreciate any help.
Thanks!
JohnnyHi Johnny,
Only members of the sysadmin fixed role or the jobowner can start a job.
HTH
Adam
--
Adam J Warne, MCDBA
"Johnny" wrote:
> Hello all,
> I have a job I created with user A, but I need user B to be able to execute
> this job programatically. I've given user B permission to EXECUTE the
> "msdb.dbo.sp_start_job" sproc and the user is able to execute it but with an
> error thrown. The following is the error I get when I run it with user B.
> This error does not appear when I run it with user A.
> The specified @.job_name ('MyJobName') does not exist.
> After doing some research by looking at the system sprocs, I found that the
> error is thrown from a call made to 'msdb.dbo.sp_verify_job_identifiers'. I
> researched that sproc and then found the system code that is throwing the
> error, listed below.
> -- Check if the job name is ambiguous
> IF ((SELECT COUNT(*)
> FROM msdb.dbo.sysjobs_view
> WHERE (name = @.job_name)) > 1)
> BEGIN
> RAISERROR(14293, -1, -1, @.job_name, @.name_of_id_parameter,
> @.name_of_name_parameter)
> RETURN(1) -- Failure
> END
>
> I performed a SELECT * query to the sysjobs_view view with user B and 0 rows
> were returned. So it appears that the view is filtering the results by user
> and the job is not found which is causing the error.
> Do you guys know of a way I can make this work? I would appreciate any help.
> Thanks!
> Johnny
>|||Thanks. I didnt want to do that but I guess I have no choice.
Johnny
"Adam Warne" wrote:
> Hi Johnny,
> Only members of the sysadmin fixed role or the jobowner can start a job.
> HTH
> Adam
> --
> Adam J Warne, MCDBA
>
> "Johnny" wrote:
> > Hello all,
> >
> > I have a job I created with user A, but I need user B to be able to execute
> > this job programatically. I've given user B permission to EXECUTE the
> > "msdb.dbo.sp_start_job" sproc and the user is able to execute it but with an
> > error thrown. The following is the error I get when I run it with user B.
> > This error does not appear when I run it with user A.
> >
> > The specified @.job_name ('MyJobName') does not exist.
> >
> > After doing some research by looking at the system sprocs, I found that the
> > error is thrown from a call made to 'msdb.dbo.sp_verify_job_identifiers'. I
> > researched that sproc and then found the system code that is throwing the
> > error, listed below.
> >
> > -- Check if the job name is ambiguous
> > IF ((SELECT COUNT(*)
> > FROM msdb.dbo.sysjobs_view
> > WHERE (name = @.job_name)) > 1)
> > BEGIN
> > RAISERROR(14293, -1, -1, @.job_name, @.name_of_id_parameter,
> > @.name_of_name_parameter)
> > RETURN(1) -- Failure
> > END
> >
> >
> > I performed a SELECT * query to the sysjobs_view view with user B and 0 rows
> > were returned. So it appears that the view is filtering the results by user
> > and the job is not found which is causing the error.
> >
> > Do you guys know of a way I can make this work? I would appreciate any help.
> > Thanks!
> >
> > Johnny
> >sql
Thursday, March 22, 2012
Can't send out mail if Outlook not open ?
In my server, I have created a scheduled task that use SENDMAIL to send some
reports to my boss email ... but I find that if the mail cannot send out if
the OUTLOOK in the server was closed ... everytime I need to open the OUTLOOK
and press SEND/RECEIVE to send those mail out. (It will be a big trouble if
we have a few days holiday) ...
So can anyone know why the SENDMAIL function cannot operate when the OUTLOOK
is closed ? if so, can someone tell me how to solve this problem (except
ALWAYS OPEN THE OUTLOOK), thanks very much for all of your concern & helping
!!!
Some versions of Outlook require keeping Outlook open for
SQL Mail to work correctly. You may also want to refer to
the following articles:
INF: How to Configure SQL Mail
http://support.microsoft.com/?id=263556
INF: Common SQL Mail Problems
http://support.microsoft.com/?id=315886
One way around this is to not use Outlook, MAPI for mail and
just use smtp. You can download an extended stored procedure
to send mail using SMTP. You can find the download and more
information at:
http://www.sqldev.net/xp/xpsmtp.htm
-Sue
On Sun, 3 Oct 2004 19:31:09 -0700, "Devil Garfield"
<DevilGarfield@.discussions.microsoft.com> wrote:
>Dear experts,
>In my server, I have created a scheduled task that use SENDMAIL to send some
>reports to my boss email ... but I find that if the mail cannot send out if
>the OUTLOOK in the server was closed ... everytime I need to open the OUTLOOK
>and press SEND/RECEIVE to send those mail out. (It will be a big trouble if
>we have a few days holiday) ...
>So can anyone know why the SENDMAIL function cannot operate when the OUTLOOK
>is closed ? if so, can someone tell me how to solve this problem (except
>ALWAYS OPEN THE OUTLOOK), thanks very much for all of your concern & helping
>!!!
Can't send out mail if Outlook not open ?
In my server, I have created a scheduled task that use SENDMAIL to send some
reports to my boss email ... but I find that if the mail cannot send out if
the OUTLOOK in the server was closed ... everytime I need to open the OUTLOOK
and press SEND/RECEIVE to send those mail out. (It will be a big trouble if
we have a few days holiday) ...
So can anyone know why the SENDMAIL function cannot operate when the OUTLOOK
is closed ' if so, can someone tell me how to solve this problem (except
ALWAYS OPEN THE OUTLOOK), thanks very much for all of your concern & helping
!!!Some versions of Outlook require keeping Outlook open for
SQL Mail to work correctly. You may also want to refer to
the following articles:
INF: How to Configure SQL Mail
http://support.microsoft.com/?id=263556
INF: Common SQL Mail Problems
http://support.microsoft.com/?id=315886
One way around this is to not use Outlook, MAPI for mail and
just use smtp. You can download an extended stored procedure
to send mail using SMTP. You can find the download and more
information at:
http://www.sqldev.net/xp/xpsmtp.htm
-Sue
On Sun, 3 Oct 2004 19:31:09 -0700, "Devil Garfield"
<DevilGarfield@.discussions.microsoft.com> wrote:
>Dear experts,
>In my server, I have created a scheduled task that use SENDMAIL to send some
>reports to my boss email ... but I find that if the mail cannot send out if
>the OUTLOOK in the server was closed ... everytime I need to open the OUTLOOK
>and press SEND/RECEIVE to send those mail out. (It will be a big trouble if
>we have a few days holiday) ...
>So can anyone know why the SENDMAIL function cannot operate when the OUTLOOK
>is closed ' if so, can someone tell me how to solve this problem (except
>ALWAYS OPEN THE OUTLOOK), thanks very much for all of your concern & helping
>!!!
Can't seem to get the newly created entry's identity field :(
I have a stored procedure that executes a transaction which updates/inserts into a table on a remote server and should then use that new entry's autogenerated primary key to update another table.
I try to store that key into a variable called @.NewlyCreatedPastelDClinkNumber but to no avail
I have used the @.@.Identity approach and now try to manually get that key to from other information but still no go..My thinking is: since i am using transactions, maybe the entry cant be found until the transaction has been committed...but surely it should find it after the commit statement? Here is my code: I have marked the interesting bit with blue for simplicity.
ALTER procedure [dbo].[inv_SynchronizeClientsWithPastel]
as
BEGIN
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
SET XACT_ABORT ON
DECLARE @.PastelDCLinkNumber int
DECLARE @.ClientID int
DECLARE @.Name varchar(25)
DECLARE @.Surname nvarchar(25)
DECLARE @.POBoxAddr1 varchar(40)
DECLARE @.POBoxAddr2 varchar(40)
DECLARE @.PostalCode varchar(5)
DECLARE @.ClientCreditCardNumber nvarchar(50)
DECLARE @.NewlyCreatedPastelDClinkNumber int
DECLARE PastelClientPortCursor CURSOR FOR
SELECT id, [Name], Surname, POBoxAddr1, POBoxAddr2, PostalCode, PastelDCLinkNumber ,CreditCardNumber
FROM inc_Client
WHERE HasSynchronizedWithPastel = 0
OPEN PastelClientPortCursor;
FETCH NEXT FROM PastelClientPortCursor
INTO @.ClientID,@.Name,@.Surname,@.POBoxAddr1,@.POBoxAddr2,@.PostalCode,@.PastelDCLinkNumber,@.ClientCreditCardNumber
WHILE @.@.FETCH_STATUS = 0
BEGIN
--Step2 insert/update the client information into the Synergy invoice and client table
BEGIN TRANSACTION T1
IF Exists(SELECT DCLink from [server].[Satra Corporate (Pty) Ltd].dbo.Client WHERE DCLink = @.PastelDCLinkNumber)
--Update the Pastel Client table
Begin
Update [server].[Satra Corporate (Pty) Ltd].dbo.Client SET
Name = (@.Name + ' ' + @.Surname),
Account = (@.Name + ' ' + @.Surname),
Post1 = @.POBoxAddr1,
Post2 = @.POBoxAddr2,
PostPC = @.PostalCode,
cAccDescription = 'Credit Card Number: ' + @.ClientCreditCardNumber
WHERE DCLink = @.PastelDCLinkNumber
End
ELSE
Begin
--Insert into the Pastel Client table
INSERT INTO [server].[Satra Corporate (Pty) Ltd].dbo.Client
(Account, Name, Post1, Post2, PostPC, AccountTerms, CT, Credit_Limit,
RepID, Interest_Rate, Discount, On_Hold, BFOpenType, BankLink,
AutoDisc,
DiscMtrxRow, CashDebtor, DCBalance, CheckTerms, UseEmail,
iCountryID, cAccDescription, iCurrencyID, bStatPrint,
bStatEmail, bForCurAcc,
fForeignBalance, bTaxPrompt, iARPriceListNameID)
VALUES
(
SUBSTRING(@.Name, 1,19), --Account
(@.Name + ' ' + @.Surname), --Name
@.POBoxAddr1, --Post1
@.POBoxAddr2, --Post2
@.PostalCode, --PostPC
0, --Account_Terms
1, --CT
0,--Credit_Limit
0, --Rep_ID
0, --interest_Rate
0, --Discount
0, --On_Hold
0, --BFOpenType
0, --BankLink
0, --AutoDisc
0, --DiscMatrix
0, --CashDebtor
0, --DCBalance
1, --CheckTerms
0, --UseEmail
0, --iCountryID
'Credit Card Number: ' + @.ClientCreditCardNumber,
0, --iCurrencyID
1, --StatPrint
0, --StatEmail
0, --bForCurAcc
0, --ForeignBal
1, --bTaxPrompt
1 --iARPriceListNameID
)
End
--If the rowcount is 0, an error has occured
IF @.@.ROWCOUNT <> 0
Begin
COMMIT TRANSACTION T1
execute sec_LogSQLTransaction 'inv_SynchronizeClientsWithPastel' ,'inc_Client_id',@.ClientID,'System'
-- Step 3Update the HasSynchronizedWithPastel Flag
Begin
SET @.NewlyCreatedPastelDClinkNumber = (SELECT DCLink From [server].[Satra Corporate (Pty) Ltd].dbo.Client
WHERE Name = (@.Name + ' ' + @.Surname)AND
Account = (@.Name + ' ' + @.Surname)AND
Post1 = @.POBoxAddr1 AND
Post2 = @.POBoxAddr2 AND
PostPC = @.PostalCode AND
cAccDescription = 'Credit Card Number: ' + @.ClientCreditCardNumber)
End
Begin
Update inc_Client SET
HasSynchronizedWithPastel = 1 ,
PastelDCLinkNumber = @.NewlyCreatedPastelDClinkNumber
WHERE id = @.ClientID
End
End
--Rollback transaction
IF @.@.TRANCOUNT > 0
Begin
ROLLBACK TRANSACTION T1
execute sec_LogSQLTransactionError 'inv_SynchronizeClientsWithPastel','inc_Client_id',@.ClientID,'System'
End
FETCH NEXT FROM PastelClientPortCursor
INTO @.ClientID,@.Name,@.Surname,@.POBoxAddr1,@.POBoxAddr2,@.PostalCode,@.PastelDCLinkNumber, @.ClientCreditCardNumber
END
CLOSE PastelClientPortCursor;
DEALLOCATE PastelClientPortCursor;
END
SET XACT_ABORT OFF
Go
Instead of:
COMMIT TRANSACTION T1
execute sec_LogSQLTransaction 'inv_SynchronizeClientsWithPastel' ,'inc_Client_id',@.ClientID,'System'
-- Step 3Update the HasSynchronizedWithPastel Flag
Begin
SET @.NewlyCreatedPastelDClinkNumber = (SELECT DCLink From [server].[Satra Corporate (Pty) Ltd].dbo.Client
WHERE Name = (@.Name + ' ' + @.Surname)AND
Account = (@.Name + ' ' + @.Surname)AND
Post1 = @.POBoxAddr1 AND
Post2 = @.POBoxAddr2 AND
PostPC = @.PostalCode AND
cAccDescription = 'Credit Card Number: ' + @.ClientCreditCardNumber)
End
Try:
COMMIT TRANSACTION T1
SET @.NewlyCreatedPastelDClinkNumber = scope_identity()
execute sec_LogSQLTransaction 'inv_SynchronizeClientsWithPastel' ,'inc_Client_id',@.ClientID,'System'
-- Step 3Update the HasSynchronizedWithPastel Flag
Problem 1)
IF Exists(SELECT DCLink from [server].[Satra Corporate (Pty) Ltd].dbo.Client WHERE DCLink = @.PastelDCLinkNumber)
--Update the Pastel Client table
Begin
Update [server].[Satra Corporate (Pty) Ltd].dbo.Client SET
Don't check for the data and then do the update. Simply DO the update first. If you update 0 rows, then you do the insert. This cuts exection in half when there is an update to be performed.
Problem 2)
IMMEDIATELY after the INSERT, put the @.@.ERROR and @.@.ROWCOUNT AND scope_identity() values into a variable. Then act on those three in appropriate order.
Problem 3)
You should use a remote sproc to do the update/insert stuff on the remote server. MUCH more efficient. Pass parameters in and then local stuff does work with a cached query plan and only one network trip.
|||Thanks for all your support. I'm going to give this a try|||Thank you for all your help. It worked.I looked at your suggestions in your steps(problems) and immediately saw the advantages of your suggestions.
I will now adapt future stored procedure's templates to include those good practices. Thanks once more.
Regards
Mike
Can't seem to get the newly created entry's identity field :(
I have a stored procedure that executes a transaction which updates/inserts into a table on a remote server and should then use that new entry's autogenerated primary key to update another table.
I try to store that key into a variable called @.NewlyCreatedPastelDClinkNumber but to no avail
I have used the @.@.Identity approach and now try to manually get that key to from other information but still no go..My thinking is: since i am using transactions, maybe the entry cant be found until the transaction has been committed...but surely it should find it after the commit statement? Here is my code: I have marked the interesting bit with blue for simplicity.
ALTER procedure [dbo].[inv_SynchronizeClientsWithPastel]
as
BEGIN
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
SET XACT_ABORT ON
DECLARE @.PastelDCLinkNumber int
DECLARE @.ClientID int
DECLARE @.Name varchar(25)
DECLARE @.Surname nvarchar(25)
DECLARE @.POBoxAddr1 varchar(40)
DECLARE @.POBoxAddr2 varchar(40)
DECLARE @.PostalCode varchar(5)
DECLARE @.ClientCreditCardNumber nvarchar(50)
DECLARE @.NewlyCreatedPastelDClinkNumber int
DECLARE PastelClientPortCursor CURSOR FOR
SELECT id, [Name], Surname, POBoxAddr1, POBoxAddr2, PostalCode, PastelDCLinkNumber ,CreditCardNumber
FROM inc_Client
WHERE HasSynchronizedWithPastel = 0
OPEN PastelClientPortCursor;
FETCH NEXT FROM PastelClientPortCursor
INTO @.ClientID,@.Name,@.Surname,@.POBoxAddr1,@.POBoxAddr2,@.PostalCode,@.PastelDCLinkNumber,@.ClientCreditCardNumber
WHILE @.@.FETCH_STATUS = 0
BEGIN
--Step2 insert/update the client information into the Synergy invoice and client table
BEGIN TRANSACTION T1
IF Exists(SELECT DCLink from [server].[Satra Corporate (Pty) Ltd].dbo.Client WHERE DCLink = @.PastelDCLinkNumber)
--Update the Pastel Client table
Begin
Update [server].[Satra Corporate (Pty) Ltd].dbo.Client SET
Name = (@.Name + ' ' + @.Surname),
Account = (@.Name + ' ' + @.Surname),
Post1 = @.POBoxAddr1,
Post2 = @.POBoxAddr2,
PostPC = @.PostalCode,
cAccDescription = 'Credit Card Number: ' + @.ClientCreditCardNumber
WHERE DCLink = @.PastelDCLinkNumber
End
ELSE
Begin
--Insert into the Pastel Client table
INSERT INTO [server].[Satra Corporate (Pty) Ltd].dbo.Client
(Account, Name, Post1, Post2, PostPC, AccountTerms, CT, Credit_Limit,
RepID, Interest_Rate, Discount, On_Hold, BFOpenType, BankLink,
AutoDisc,
DiscMtrxRow, CashDebtor, DCBalance, CheckTerms, UseEmail,
iCountryID, cAccDescription, iCurrencyID, bStatPrint,
bStatEmail, bForCurAcc,
fForeignBalance, bTaxPrompt, iARPriceListNameID)
VALUES
(
SUBSTRING(@.Name, 1,19), --Account
(@.Name + ' ' + @.Surname), --Name
@.POBoxAddr1, --Post1
@.POBoxAddr2, --Post2
@.PostalCode, --PostPC
0, --Account_Terms
1, --CT
0,--Credit_Limit
0, --Rep_ID
0, --interest_Rate
0, --Discount
0, --On_Hold
0, --BFOpenType
0, --BankLink
0, --AutoDisc
0, --DiscMatrix
0, --CashDebtor
0, --DCBalance
1, --CheckTerms
0, --UseEmail
0, --iCountryID
'Credit Card Number: ' + @.ClientCreditCardNumber,
0, --iCurrencyID
1, --StatPrint
0, --StatEmail
0, --bForCurAcc
0, --ForeignBal
1, --bTaxPrompt
1 --iARPriceListNameID
)
End
--If the rowcount is 0, an error has occured
IF @.@.ROWCOUNT <> 0
Begin
COMMIT TRANSACTION T1
execute sec_LogSQLTransaction 'inv_SynchronizeClientsWithPastel' ,'inc_Client_id',@.ClientID,'System'
-- Step 3Update the HasSynchronizedWithPastel Flag
Begin
SET @.NewlyCreatedPastelDClinkNumber = (SELECT DCLink From [server].[Satra Corporate (Pty) Ltd].dbo.Client
WHERE Name = (@.Name + ' ' + @.Surname)AND
Account = (@.Name + ' ' + @.Surname)AND
Post1 = @.POBoxAddr1 AND
Post2 = @.POBoxAddr2 AND
PostPC = @.PostalCode AND
cAccDescription = 'Credit Card Number: ' + @.ClientCreditCardNumber)
End
Begin
Update inc_Client SET
HasSynchronizedWithPastel = 1 ,
PastelDCLinkNumber = @.NewlyCreatedPastelDClinkNumber
WHERE id = @.ClientID
End
End
--Rollback transaction
IF @.@.TRANCOUNT > 0
Begin
ROLLBACK TRANSACTION T1
execute sec_LogSQLTransactionError 'inv_SynchronizeClientsWithPastel','inc_Client_id',@.ClientID,'System'
End
FETCH NEXT FROM PastelClientPortCursor
INTO @.ClientID,@.Name,@.Surname,@.POBoxAddr1,@.POBoxAddr2,@.PostalCode,@.PastelDCLinkNumber, @.ClientCreditCardNumber
END
CLOSE PastelClientPortCursor;
DEALLOCATE PastelClientPortCursor;
END
SET XACT_ABORT OFF
Go
Instead of:
COMMIT TRANSACTION T1
execute sec_LogSQLTransaction 'inv_SynchronizeClientsWithPastel' ,'inc_Client_id',@.ClientID,'System'
-- Step 3Update the HasSynchronizedWithPastel Flag
Begin
SET @.NewlyCreatedPastelDClinkNumber = (SELECT DCLink From [server].[Satra Corporate (Pty) Ltd].dbo.Client
WHERE Name = (@.Name + ' ' + @.Surname)AND
Account = (@.Name + ' ' + @.Surname)AND
Post1 = @.POBoxAddr1 AND
Post2 = @.POBoxAddr2 AND
PostPC = @.PostalCode AND
cAccDescription = 'Credit Card Number: ' + @.ClientCreditCardNumber)
End
Try:
COMMIT TRANSACTION T1
SET @.NewlyCreatedPastelDClinkNumber = scope_identity()
execute sec_LogSQLTransaction 'inv_SynchronizeClientsWithPastel' ,'inc_Client_id',@.ClientID,'System'
-- Step 3Update the HasSynchronizedWithPastel Flag
Problem 1)
IF Exists(SELECT DCLink from [server].[Satra Corporate (Pty) Ltd].dbo.Client WHERE DCLink = @.PastelDCLinkNumber)
--Update the Pastel Client table
Begin
Update [server].[Satra Corporate (Pty) Ltd].dbo.Client SET
Don't check for the data and then do the update. Simply DO the update first. If you update 0 rows, then you do the insert. This cuts exection in half when there is an update to be performed.
Problem 2)
IMMEDIATELY after the INSERT, put the @.@.ERROR and @.@.ROWCOUNT AND scope_identity() values into a variable. Then act on those three in appropriate order.
Problem 3)
You should use a remote sproc to do the update/insert stuff on the remote server. MUCH more efficient. Pass parameters in and then local stuff does work with a cached query plan and only one network trip.
|||Thanks for all your support. I'm going to give this a try|||Thank you for all your help. It worked.I looked at your suggestions in your steps(problems) and immediately saw the advantages of your suggestions.
I will now adapt future stored procedure's templates to include those good practices. Thanks once more.
Regards
Mikesql
Can''t seem to get the newly created entry''s identity field :(
I have a stored procedure that executes a transaction which updates/inserts into a table on a remote server and should then use that new entry's autogenerated primary key to update another table.
I try to store that key into a variable called @.NewlyCreatedPastelDClinkNumber but to no avail
I have used the @.@.Identity approach and now try to manually get that key to from other information but still no go..My thinking is: since i am using transactions, maybe the entry cant be found until the transaction has been committed...but surely it should find it after the commit statement? Here is my code: I have marked the interesting bit with blue for simplicity.
ALTER procedure [dbo].[inv_SynchronizeClientsWithPastel]
as
BEGIN
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
SET XACT_ABORT ON
DECLARE @.PastelDCLinkNumber int
DECLARE @.ClientID int
DECLARE @.Name varchar(25)
DECLARE @.Surname nvarchar(25)
DECLARE @.POBoxAddr1 varchar(40)
DECLARE @.POBoxAddr2 varchar(40)
DECLARE @.PostalCode varchar(5)
DECLARE @.ClientCreditCardNumber nvarchar(50)
DECLARE @.NewlyCreatedPastelDClinkNumber int
DECLARE PastelClientPortCursor CURSOR FOR
SELECT id, [Name], Surname, POBoxAddr1, POBoxAddr2, PostalCode, PastelDCLinkNumber ,CreditCardNumber
FROM inc_Client
WHERE HasSynchronizedWithPastel = 0
OPEN PastelClientPortCursor;
FETCH NEXT FROM PastelClientPortCursor
INTO @.ClientID,@.Name,@.Surname,@.POBoxAddr1,@.POBoxAddr2,@.PostalCode,@.PastelDCLinkNumber,@.ClientCreditCardNumber
WHILE @.@.FETCH_STATUS = 0
BEGIN
--Step2 insert/update the client information into the Synergy invoice and client table
BEGIN TRANSACTION T1
IF Exists(SELECT DCLink from [server].[Satra Corporate (Pty) Ltd].dbo.Client WHERE DCLink = @.PastelDCLinkNumber)
--Update the Pastel Client table
Begin
Update [server].[Satra Corporate (Pty) Ltd].dbo.Client SET
Name = (@.Name + ' ' + @.Surname),
Account = (@.Name + ' ' + @.Surname),
Post1 = @.POBoxAddr1,
Post2 = @.POBoxAddr2,
PostPC = @.PostalCode,
cAccDescription = 'Credit Card Number: ' + @.ClientCreditCardNumber
WHERE DCLink = @.PastelDCLinkNumber
End
ELSE
Begin
--Insert into the Pastel Client table
INSERT INTO [server].[Satra Corporate (Pty) Ltd].dbo.Client
(Account, Name, Post1, Post2, PostPC, AccountTerms, CT, Credit_Limit,
RepID, Interest_Rate, Discount, On_Hold, BFOpenType, BankLink,
AutoDisc,
DiscMtrxRow, CashDebtor, DCBalance, CheckTerms, UseEmail,
iCountryID, cAccDescription, iCurrencyID, bStatPrint,
bStatEmail, bForCurAcc,
fForeignBalance, bTaxPrompt, iARPriceListNameID)
VALUES
(
SUBSTRING(@.Name, 1,19), --Account
(@.Name + ' ' + @.Surname), --Name
@.POBoxAddr1, --Post1
@.POBoxAddr2, --Post2
@.PostalCode, --PostPC
0, --Account_Terms
1, --CT
0,--Credit_Limit
0, --Rep_ID
0, --interest_Rate
0, --Discount
0, --On_Hold
0, --BFOpenType
0, --BankLink
0, --AutoDisc
0, --DiscMatrix
0, --CashDebtor
0, --DCBalance
1, --CheckTerms
0, --UseEmail
0, --iCountryID
'Credit Card Number: ' + @.ClientCreditCardNumber,
0, --iCurrencyID
1, --StatPrint
0, --StatEmail
0, --bForCurAcc
0, --ForeignBal
1, --bTaxPrompt
1 --iARPriceListNameID
)
End
--If the rowcount is 0, an error has occured
IF @.@.ROWCOUNT <> 0
Begin
COMMIT TRANSACTION T1
execute sec_LogSQLTransaction 'inv_SynchronizeClientsWithPastel' ,'inc_Client_id',@.ClientID,'System'
-- Step 3Update the HasSynchronizedWithPastel Flag
Begin
SET @.NewlyCreatedPastelDClinkNumber = (SELECT DCLink From [server].[Satra Corporate (Pty) Ltd].dbo.Client
WHERE Name = (@.Name + ' ' + @.Surname)AND
Account = (@.Name + ' ' + @.Surname)AND
Post1 = @.POBoxAddr1 AND
Post2 = @.POBoxAddr2 AND
PostPC = @.PostalCode AND
cAccDescription = 'Credit Card Number: ' + @.ClientCreditCardNumber)
End
Begin
Update inc_Client SET
HasSynchronizedWithPastel = 1 ,
PastelDCLinkNumber = @.NewlyCreatedPastelDClinkNumber
WHERE id = @.ClientID
End
End
--Rollback transaction
IF @.@.TRANCOUNT > 0
Begin
ROLLBACK TRANSACTION T1
execute sec_LogSQLTransactionError 'inv_SynchronizeClientsWithPastel','inc_Client_id',@.ClientID,'System'
End
FETCH NEXT FROM PastelClientPortCursor
INTO @.ClientID,@.Name,@.Surname,@.POBoxAddr1,@.POBoxAddr2,@.PostalCode,@.PastelDCLinkNumber, @.ClientCreditCardNumber
END
CLOSE PastelClientPortCursor;
DEALLOCATE PastelClientPortCursor;
END
SET XACT_ABORT OFF
Go
Instead of:
COMMIT TRANSACTION T1
execute sec_LogSQLTransaction 'inv_SynchronizeClientsWithPastel' ,'inc_Client_id',@.ClientID,'System'
-- Step 3Update the HasSynchronizedWithPastel Flag
Begin
SET @.NewlyCreatedPastelDClinkNumber = (SELECT DCLink From [server].[Satra Corporate (Pty) Ltd].dbo.Client
WHERE Name = (@.Name + ' ' + @.Surname)AND
Account = (@.Name + ' ' + @.Surname)AND
Post1 = @.POBoxAddr1 AND
Post2 = @.POBoxAddr2 AND
PostPC = @.PostalCode AND
cAccDescription = 'Credit Card Number: ' + @.ClientCreditCardNumber)
End
Try:
COMMIT TRANSACTION T1
SET @.NewlyCreatedPastelDClinkNumber = scope_identity()
execute sec_LogSQLTransaction 'inv_SynchronizeClientsWithPastel' ,'inc_Client_id',@.ClientID,'System'
-- Step 3Update the HasSynchronizedWithPastel Flag
Problem 1)
IF Exists(SELECT DCLink from [server].[Satra Corporate (Pty) Ltd].dbo.Client WHERE DCLink = @.PastelDCLinkNumber)
--Update the Pastel Client table
Begin
Update [server].[Satra Corporate (Pty) Ltd].dbo.Client SET
Don't check for the data and then do the update. Simply DO the update first. If you update 0 rows, then you do the insert. This cuts exection in half when there is an update to be performed.
Problem 2)
IMMEDIATELY after the INSERT, put the @.@.ERROR and @.@.ROWCOUNT AND scope_identity() values into a variable. Then act on those three in appropriate order.
Problem 3)
You should use a remote sproc to do the update/insert stuff on the remote server. MUCH more efficient. Pass parameters in and then local stuff does work with a cached query plan and only one network trip.
|||Thanks for all your support. I'm going to give this a try|||Thank you for all your help. It worked.I looked at your suggestions in your steps(problems) and immediately saw the advantages of your suggestions.
I will now adapt future stored procedure's templates to include those good practices. Thanks once more.
Regards
Mike
Tuesday, March 20, 2012
Can't see the Report Manager page
Hi There,
I have installed the Sql Server 2005 reporting services and I see that two default directories being created in IIS (Report and ReportServer..). For some reason, if I type http://localhost/reports, I am unable to see the report manager homepage. Can anybody suggest me if I need to configure any more stuff to see the report manager?
I enabled the anonymous authentication and still cannot see....
I can see the webservice however by typing http://localhost/reportserver...
Any suggestions are greatly apprecaited...
Thanks.
Sam.
I got it. I had to set up the reportserver to be accessible anonymous along with Reports.
Thanks.
Cant see stored procedures
Hi,
Can anyone help me. I've created a stored procedure in sql server and I'm trying to run it from my asp.net page. On Database Explorer I can't see it, or any for that matter, however I can see tables in the same schema.
Also I can't see it when I build a table adapter either.
Can anybody help?
Thanks
Sam
My first suspicion is that you didn't succeed in creating the stored procedure as you think you have done. To allay that suspicion, can you see the proc in Sql Server Management Studio?
|||
Yes I can see it and execute it, it works fine through sql server
I'm thinking that it might be because I'm using the express versions of the software sql server studio and visual web developer. Do you think that might be limiting the functionality?
|||No. That wouldn't limit what you can see in the Database explorer. I've just attached Northwind to SqlExpress, and can see the procs, views etc in DataBase Explorer in VWD.
Try clicking the Refresh button at the top of the Database Explorer panel.
check you master database mybe you created it in default database which is usual master when you open New Query window.If it is true put line below on top of your proceureUSE [DATABASE NAME] GO
|||As JPazgier mentioned you probably created the proc in the default master db. If so, script out the proc, drop the proc from master db, re-create it in the actual db. If that is not the case and the proc is already in the right database, then check your connection string to see if your application is connecting to the right database.
Can't see new objects created in SQL Server from C#
We have just installed SQL and C# Express. We have lots of experience with SQL, but none with C#. With both the SQL and C# apps running; if we create a new table, view etc, we cannot see that new object from C# only the objects that existed when we opened the apps for the first time (each time).
If we close everything and re-open everything from scratch, the new objects show..!?!?
Thank you for any information on this difficult problem.
Hard to tell without knowing which technique youuse to display the objects and if there is eventually somehow a caching mechanism involved. Could you post some code which does the retrieval ?Jens K. Suessmeyer
http://www.sqlserver2005.de
Can''t see named sets in Excel 2007
I am not able to see the named sets in the PivotTable Field List in Excel 2007. I created e.g. the simple named set
CREATE SET CURRENTCUBE.[Austria]
AS [CUSTOMER].[COUNTRY].&[Austria] ;
Then I changed the display folder to 'Special Countries' in the mask 'Calculation properties' without selecting an 'Associated Measure Group'. After building the cube I can even see that display folder in the left-side tree of the 'Browse' window.
But after connecting to the cube with Excel 2007 the named set is not available for selection.
It seems that I am missing an important point.
Best wishes from Austria,
nedvin
I'm using Excel 2007 against the Adventure Works DW database and the Adventure Works cube. In the Account dimension, I see the [Summary P&L] named set. It has a Display folder of Sets and an Associated Measure Group of Financial Reporting.
You may want to compare what you have to what is in Adventure Works.
B.
|||Hi Bryan,it took some time to install the Adventure Works Cube (actually I have completely reinstalled my pc), sorry for the late reply.
But even with your example I am unable to find the named set in the PivotTable Field List in Excel 2007. There is simply no folder 'Sets' containing the named set [Summary P&L].
I do see the [Summary P&L] in the cube (in the specified folder) and it is well defined under the mask 'Calculation properties', but in Excel 2007 it is not listed.
Kind regards,
nedvin
|||
I can see [Summary P&L] under the Account dimension. I use the enterprise edition version of the Adventure Works cube project. Make sure that you see the whole cube and not only a perspective("Show related fields to" at the top of the dimension tool)
HTH
Thomas Ivarsson
|||Hi Thomas,
thank you for your reply.
I am using the Aventure Works cube project entreprise edition as well.In Excel 2007 the dropdown list 'Show fields related to' is set to the property 'All', so I think that I am not restricted to a perspective.
I can browse the cube in the SQL Server Management Studio(as well as in the BI Development Studio) and see the named sets as defined, but with Excel 2007 the named sets are not listed (neither the [Summary P&L] under the Account dimension nor the folder 'Sets' with 'Core Product Group', 'Long Lead Products',.... under the Product dimension).
By the way, I have Excel 2007 (12.0.6024.5000) MSO(12.0.6017.5000). Maybe I have a different version of Excel 2007?
Kind regards,
nedvin
Can''t see named sets in Excel 2007
I am not able to see the named sets in the PivotTable Field List in Excel 2007. I created e.g. the simple named set
CREATE SET CURRENTCUBE.[Austria]
AS [CUSTOMER].[COUNTRY].&[Austria] ;
Then I changed the display folder to 'Special Countries' in the mask 'Calculation properties' without selecting an 'Associated Measure Group'. After building the cube I can even see that display folder in the left-side tree of the 'Browse' window.
But after connecting to the cube with Excel 2007 the named set is not available for selection.
It seems that I am missing an important point.
Best wishes from Austria,
nedvin
I'm using Excel 2007 against the Adventure Works DW database and the Adventure Works cube. In the Account dimension, I see the [Summary P&L] named set. It has a Display folder of Sets and an Associated Measure Group of Financial Reporting.
You may want to compare what you have to what is in Adventure Works.
B.
|||Hi Bryan,it took some time to install the Adventure Works Cube (actually I have completely reinstalled my pc), sorry for the late reply.
But even with your example I am unable to find the named set in the PivotTable Field List in Excel 2007. There is simply no folder 'Sets' containing the named set [Summary P&L].
I do see the [Summary P&L] in the cube (in the specified folder) and it is well defined under the mask 'Calculation properties', but in Excel 2007 it is not listed.
Kind regards,
nedvin
|||
I can see [Summary P&L] under the Account dimension. I use the enterprise edition version of the Adventure Works cube project. Make sure that you see the whole cube and not only a perspective("Show related fields to" at the top of the dimension tool)
HTH
Thomas Ivarsson
|||Hi Thomas,
thank you for your reply.
I am using the Aventure Works cube project entreprise edition as well.In Excel 2007 the dropdown list 'Show fields related to' is set to the property 'All', so I think that I am not restricted to a perspective.
I can browse the cube in the SQL Server Management Studio(as well as in the BI Development Studio) and see the named sets as defined, but with Excel 2007 the named sets are not listed (neither the [Summary P&L] under the Account dimension nor the folder 'Sets' with 'Core Product Group', 'Long Lead Products',.... under the Product dimension).
By the way, I have Excel 2007 (12.0.6024.5000) MSO(12.0.6017.5000). Maybe I have a different version of Excel 2007?
Kind regards,
nedvin
Can''t see named sets in Excel 2007
I am not able to see the named sets in the PivotTable Field List in Excel 2007. I created e.g. the simple named set
CREATE SET CURRENTCUBE.[Austria]
AS [CUSTOMER].[COUNTRY].&[Austria] ;
Then I changed the display folder to 'Special Countries' in the mask 'Calculation properties' without selecting an 'Associated Measure Group'. After building the cube I can even see that display folder in the left-side tree of the 'Browse' window.
But after connecting to the cube with Excel 2007 the named set is not available for selection.
It seems that I am missing an important point.
Best wishes from Austria,
nedvin
I'm using Excel 2007 against the Adventure Works DW database and the Adventure Works cube. In the Account dimension, I see the [Summary P&L] named set. It has a Display folder of Sets and an Associated Measure Group of Financial Reporting.
You may want to compare what you have to what is in Adventure Works.
B.
|||Hi Bryan,it took some time to install the Adventure Works Cube (actually I have completely reinstalled my pc), sorry for the late reply.
But even with your example I am unable to find the named set in the PivotTable Field List in Excel 2007. There is simply no folder 'Sets' containing the named set [Summary P&L].
I do see the [Summary P&L] in the cube (in the specified folder) and it is well defined under the mask 'Calculation properties', but in Excel 2007 it is not listed.
Kind regards,
nedvin
|||
I can see [Summary P&L] under the Account dimension. I use the enterprise edition version of the Adventure Works cube project. Make sure that you see the whole cube and not only a perspective("Show related fields to" at the top of the dimension tool)
HTH
Thomas Ivarsson
|||Hi Thomas,
thank you for your reply.
I am using the Aventure Works cube project entreprise edition as well.In Excel 2007 the dropdown list 'Show fields related to' is set to the property 'All', so I think that I am not restricted to a perspective.
I can browse the cube in the SQL Server Management Studio(as well as in the BI Development Studio) and see the named sets as defined, but with Excel 2007 the named sets are not listed (neither the [Summary P&L] under the Account dimension nor the folder 'Sets' with 'Core Product Group', 'Long Lead Products',.... under the Product dimension).
By the way, I have Excel 2007 (12.0.6024.5000) MSO(12.0.6017.5000). Maybe I have a different version of Excel 2007?
Kind regards,
nedvin
sql
Can''t see named sets in Excel 2007
I am not able to see the named sets in the PivotTable Field List in Excel 2007. I created e.g. the simple named set
CREATE SET CURRENTCUBE.[Austria]
AS [CUSTOMER].[COUNTRY].&[Austria] ;
Then I changed the display folder to 'Special Countries' in the mask 'Calculation properties' without selecting an 'Associated Measure Group'. After building the cube I can even see that display folder in the left-side tree of the 'Browse' window.
But after connecting to the cube with Excel 2007 the named set is not available for selection.
It seems that I am missing an important point.
Best wishes from Austria,
nedvin
I'm using Excel 2007 against the Adventure Works DW database and the Adventure Works cube. In the Account dimension, I see the [Summary P&L] named set. It has a Display folder of Sets and an Associated Measure Group of Financial Reporting.
You may want to compare what you have to what is in Adventure Works.
B.
|||Hi Bryan,it took some time to install the Adventure Works Cube (actually I have completely reinstalled my pc), sorry for the late reply.
But even with your example I am unable to find the named set in the PivotTable Field List in Excel 2007. There is simply no folder 'Sets' containing the named set [Summary P&L].
I do see the [Summary P&L] in the cube (in the specified folder) and it is well defined under the mask 'Calculation properties', but in Excel 2007 it is not listed.
Kind regards,
nedvin
|||
I can see [Summary P&L] under the Account dimension. I use the enterprise edition version of the Adventure Works cube project. Make sure that you see the whole cube and not only a perspective("Show related fields to" at the top of the dimension tool)
HTH
Thomas Ivarsson
|||Hi Thomas,
thank you for your reply.
I am using the Aventure Works cube project entreprise edition as well.In Excel 2007 the dropdown list 'Show fields related to' is set to the property 'All', so I think that I am not restricted to a perspective.
I can browse the cube in the SQL Server Management Studio(as well as in the BI Development Studio) and see the named sets as defined, but with Excel 2007 the named sets are not listed (neither the [Summary P&L] under the Account dimension nor the folder 'Sets' with 'Core Product Group', 'Long Lead Products',.... under the Product dimension).
By the way, I have Excel 2007 (12.0.6024.5000) MSO(12.0.6017.5000). Maybe I have a different version of Excel 2007?
Kind regards,
nedvin
Can''t see named sets in Excel 2007
I am not able to see the named sets in the PivotTable Field List in Excel 2007. I created e.g. the simple named set
CREATE SET CURRENTCUBE.[Austria]
AS [CUSTOMER].[COUNTRY].&[Austria] ;
Then I changed the display folder to 'Special Countries' in the mask 'Calculation properties' without selecting an 'Associated Measure Group'. After building the cube I can even see that display folder in the left-side tree of the 'Browse' window.
But after connecting to the cube with Excel 2007 the named set is not available for selection.
It seems that I am missing an important point.
Best wishes from Austria,
nedvin
I'm using Excel 2007 against the Adventure Works DW database and the Adventure Works cube. In the Account dimension, I see the [Summary P&L] named set. It has a Display folder of Sets and an Associated Measure Group of Financial Reporting.
You may want to compare what you have to what is in Adventure Works.
B.
|||Hi Bryan,it took some time to install the Adventure Works Cube (actually I have completely reinstalled my pc), sorry for the late reply.
But even with your example I am unable to find the named set in the PivotTable Field List in Excel 2007. There is simply no folder 'Sets' containing the named set [Summary P&L].
I do see the [Summary P&L] in the cube (in the specified folder) and it is well defined under the mask 'Calculation properties', but in Excel 2007 it is not listed.
Kind regards,
nedvin
|||
I can see [Summary P&L] under the Account dimension. I use the enterprise edition version of the Adventure Works cube project. Make sure that you see the whole cube and not only a perspective("Show related fields to" at the top of the dimension tool)
HTH
Thomas Ivarsson
|||Hi Thomas,
thank you for your reply.
I am using the Aventure Works cube project entreprise edition as well.In Excel 2007 the dropdown list 'Show fields related to' is set to the property 'All', so I think that I am not restricted to a perspective.
I can browse the cube in the SQL Server Management Studio(as well as in the BI Development Studio) and see the named sets as defined, but with Excel 2007 the named sets are not listed (neither the [Summary P&L] under the Account dimension nor the folder 'Sets' with 'Core Product Group', 'Long Lead Products',.... under the Product dimension).
By the way, I have Excel 2007 (12.0.6024.5000) MSO(12.0.6017.5000). Maybe I have a different version of Excel 2007?
Kind regards,
nedvin