Friday, March 30, 2012
running and exporting report through code (C#)
I am new to the reporting services and my question maybe stupid .
I created some report and published it on the server.
Now my question is : does it possible at all to run this report from my
client (in C# )and to export the result to CSV format also from client
Is there any web service that I can use which is calling for my report ?
Please ,help me to understand this .
Thanks a lot.
SmugliyYes, Reporting Services provide a set of Web Services API that you can call
to generate report. Form your client app project (Win Form App), set web
reference to the reporting services and look into its Render() methods. You
can also learn more aboubt this from SQL Server2005 Book on Line.
"Smugliy" <Smugliy@.discussions.microsoft.com> wrote in message
news:184E2D63-E618-4C35-A0C5-5F3A647B3803@.microsoft.com...
> Hello ,All
> I am new to the reporting services and my question maybe stupid .
> I created some report and published it on the server.
> Now my question is : does it possible at all to run this report from my
> client (in C# )and to export the result to CSV format also from client
> Is there any web service that I can use which is calling for my report
> ?
> Please ,help me to understand this .
> Thanks a lot.
> Smugliy
>
>|||Thanks a lot ,Norman
"Norman Yuan" wrote:
> Yes, Reporting Services provide a set of Web Services API that you can call
> to generate report. Form your client app project (Win Form App), set web
> reference to the reporting services and look into its Render() methods. You
> can also learn more aboubt this from SQL Server2005 Book on Line.
>
> "Smugliy" <Smugliy@.discussions.microsoft.com> wrote in message
> news:184E2D63-E618-4C35-A0C5-5F3A647B3803@.microsoft.com...
> > Hello ,All
> > I am new to the reporting services and my question maybe stupid .
> >
> > I created some report and published it on the server.
> > Now my question is : does it possible at all to run this report from my
> > client (in C# )and to export the result to CSV format also from client
> > Is there any web service that I can use which is calling for my report
> > ?
> > Please ,help me to understand this .
> > Thanks a lot.
> > Smugliy
> >
> >
> >
>|||Your other option is URL integration. It too will work. It allows you to
pick the rendering format. One point with either URL or web services. By
default CSV is in unicode format, if you don't want this then you can also
tell Reporting Services that you want it in ASCII format.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Smugliy" <Smugliy@.discussions.microsoft.com> wrote in message
news:184E2D63-E618-4C35-A0C5-5F3A647B3803@.microsoft.com...
> Hello ,All
> I am new to the reporting services and my question maybe stupid .
> I created some report and published it on the server.
> Now my question is : does it possible at all to run this report from my
> client (in C# )and to export the result to CSV format also from client
> Is there any web service that I can use which is calling for my report
> ?
> Please ,help me to understand this .
> Thanks a lot.
> Smugliy
>
>sql
Running an IS package in SQL Server Agent
Hi,
I have created a package which gets data from SQL server Source to another SQL Server Database and I execute that using SQL Server Agent with the following command:
DTExec /f "C:\Package.dtsx"
According to my logs, I have an error:
SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "cdp1.MSCRM" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed.
From BIDS, it doesn't have any error. I only get this when running from SQL Agent.
The way I get the .dtsx file is that, I just BUILD the project from BIDS and use the .dtsx from \bin\Deployment folder to assign to SQL Job.
Have I done it the correct way? thanks a lot!
cherriesh
What type of connection is cdp1.MSCRM?
|||Hi,
This solves the problem:
http://support.microsoft.com/kb/912911
I just assigned a credential and proxy account and used that in the jobstep.
cherriesh
Running an IS package in SQL Server Agent
Hi,
I have created a package which gets data from SQL server Source to another SQL Server Database and I execute that using SQL Server Agent with the following command:
DTExec /f "C:\Package.dtsx"
According to my logs, I have an error:
SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "cdp1.MSCRM" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed.
From BIDS, it doesn't have any error. I only get this when running from SQL Agent.
The way I get the .dtsx file is that, I just BUILD the project from BIDS and use the .dtsx from \bin\Deployment folder to assign to SQL Job.
Have I done it the correct way? thanks a lot!
cherriesh
What type of connection is cdp1.MSCRM?
|||Hi,
This solves the problem:
http://support.microsoft.com/kb/912911
I just assigned a credential and proxy account and used that in the jobstep.
cherriesh
Wednesday, March 28, 2012
Running a SSRS report in a report viewer control in .net
The ReportViewer supports local mode where the report definition is distributed with the application and the application feeds the report with data. In local mode, the Report Server is not needed. More details here.sql
Running a SSRS report in a report viewer control in .net
The ReportViewer supports local mode where the report definition is distributed with the application and the application feeds the report with data. In local mode, the Report Server is not needed. More details here.
Running a program from a SQL job
I'm having a strange problem which puzzels me a little bit.
I have created a SQL job that can zip a file that has been generated from a
provious job. I've made a bat file that contains the string to run to zip
the file. When I run this bat file manually just by doubleclicking it, it
runs fine and do the job. When I set the SQL job to execute the same bat
file, it executes the bat file, but the bat file doesn't zip the file. It
reports that everything is ok, but the file isn't being created.
It seems like the zip program I've found that can be executed from a command
line (it's a program called 7-zip) will only do the job if it can "open" a
command prompt in the background which SQL apparently doesn't do.
My question is now if any of you know a way to let a SQL job "open" a
command prompt and then execute a program from there. It could also be as
simple as using a different zip program. 7-zip was just one I found that
could zip a file from a command line.
Regards
Steen
Hi,
Use XP_CMDSHELL to fire a OS command from command prompt.
Before commentng more, can you send out the script you are trying out.
Thanks
Hari
MCDBA
"Steen Persson" <SPE@.REMOVEdatea.dk> wrote in message
news:uKWljChUEHA.1764@.TK2MSFTNGP10.phx.gbl...
> Hi
> I'm having a strange problem which puzzels me a little bit.
> I have created a SQL job that can zip a file that has been generated from
a
> provious job. I've made a bat file that contains the string to run to zip
> the file. When I run this bat file manually just by doubleclicking it, it
> runs fine and do the job. When I set the SQL job to execute the same bat
> file, it executes the bat file, but the bat file doesn't zip the file. It
> reports that everything is ok, but the file isn't being created.
> It seems like the zip program I've found that can be executed from a
command
> line (it's a program called 7-zip) will only do the job if it can "open" a
> command prompt in the background which SQL apparently doesn't do.
> My question is now if any of you know a way to let a SQL job "open" a
> command prompt and then execute a program from there. It could also be as
> simple as using a different zip program. 7-zip was just one I found that
> could zip a file from a command line.
> Regards
> Steen
>
|||Hi Hari
Thanks for the advise. I've just tried it, but it seems like it has the same
problem as when I run it un a job.
The commandline I'm running is : "c:\program files\7-zip\7z" a -tzip
filename.zip filename.mdc
This works fine when running it either as a bat file or just in a cmd
window, but from within SQL it seems to fail. The output I get from running
it either as a job or with the XP_CmdShell is :
NULL
7-Zip 2.30 Beta 28 Copyright (c) 1999-2003 Igor Pavlov 2003-02-16
Scanning
NULL
Updating archive filename.zip
NULL
NULL
Everything is Ok
NULL
It reports that everything is ok, but it just don't create the zip file. It
might be that this 7-zip program just can't run properly without having an
open cmd prompt - which of course is a bit weird.
Regards
Steen
"Hari" <hari_prasad_k@.hotmail.com> skrev i en meddelelse
news:eCrlkGhUEHA.484@.TK2MSFTNGP10.phx.gbl...[vbcol=seagreen]
> Hi,
> Use XP_CMDSHELL to fire a OS command from command prompt.
> Before commentng more, can you send out the script you are trying out.
> --
> Thanks
> Hari
> MCDBA
> "Steen Persson" <SPE@.REMOVEdatea.dk> wrote in message
> news:uKWljChUEHA.1764@.TK2MSFTNGP10.phx.gbl...
from[vbcol=seagreen]
> a
zip[vbcol=seagreen]
it[vbcol=seagreen]
It[vbcol=seagreen]
> command
a[vbcol=seagreen]
as
>
|||Hi,
Login to SQL server from command prompt:-
OSQL -Usa -Ppassword -S SQl_server
This will allow you to go to a SQL prompt:-
1>
Here you execute the xp_cmdshell
1>master..xp_cmdsehll 'c:\program files\7-zip\7z a -tzip'
2>go
Note:
Please use the syntax clearly
Thanks
Hari
MCDBA
"Steen Persson" <SPE@.REMOVEdatea.dk> wrote in message
news:uPWCBNhUEHA.3988@.tk2msftngp13.phx.gbl...
> Hi Hari
> Thanks for the advise. I've just tried it, but it seems like it has the
same
> problem as when I run it un a job.
> The commandline I'm running is : "c:\program files\7-zip\7z" a -tzip
> filename.zip filename.mdc
> This works fine when running it either as a bat file or just in a cmd
> window, but from within SQL it seems to fail. The output I get from
running
> it either as a job or with the XP_CmdShell is :
> NULL
> 7-Zip 2.30 Beta 28 Copyright (c) 1999-2003 Igor Pavlov 2003-02-16
> Scanning
> NULL
> Updating archive filename.zip
> NULL
> NULL
> Everything is Ok
> NULL
> It reports that everything is ok, but it just don't create the zip file.
It[vbcol=seagreen]
> might be that this 7-zip program just can't run properly without having an
> open cmd prompt - which of course is a bit weird.
> Regards
> Steen
>
>
> "Hari" <hari_prasad_k@.hotmail.com> skrev i en meddelelse
> news:eCrlkGhUEHA.484@.TK2MSFTNGP10.phx.gbl...
> from
> zip
> it
bat[vbcol=seagreen]
> It
"open"[vbcol=seagreen]
> a
> as
that
>
|||Hi Hari
Thansk for your suggestions, but it simply won't do it. I get the same
result when running is with the Osql command. Apparently this zip program
only works when it's launched from it's "own" cmd prompt.
Steen
"Hari" <hari_prasad_k@.hotmail.com> skrev i en meddelelse
news:%23zI$HThUEHA.1020@.TK2MSFTNGP11.phx.gbl...[vbcol=seagreen]
> Hi,
> Login to SQL server from command prompt:-
> OSQL -Usa -Ppassword -S SQl_server
> This will allow you to go to a SQL prompt:-
> 1>
> Here you execute the xp_cmdshell
> 1>master..xp_cmdsehll 'c:\program files\7-zip\7z a -tzip'
> 2>go
> Note:
> Please use the syntax clearly
> --
> Thanks
> Hari
> MCDBA
> "Steen Persson" <SPE@.REMOVEdatea.dk> wrote in message
> news:uPWCBNhUEHA.3988@.tk2msftngp13.phx.gbl...
> same
> running
> It
an[vbcol=seagreen]
to[vbcol=seagreen]
it,[vbcol=seagreen]
> bat
file.[vbcol=seagreen]
> "open"
a[vbcol=seagreen]
be
> that
>
|||Did you qualify the path for both the input as well as output files?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Steen Persson" <SPE@.REMOVEdatea.dk> wrote in message news:uPWCBNhUEHA.3988@.tk2msftngp13.phx.gbl...
> Hi Hari
> Thanks for the advise. I've just tried it, but it seems like it has the same
> problem as when I run it un a job.
> The commandline I'm running is : "c:\program files\7-zip\7z" a -tzip
> filename.zip filename.mdc
> This works fine when running it either as a bat file or just in a cmd
> window, but from within SQL it seems to fail. The output I get from running
> it either as a job or with the XP_CmdShell is :
> NULL
> 7-Zip 2.30 Beta 28 Copyright (c) 1999-2003 Igor Pavlov 2003-02-16
> Scanning
> NULL
> Updating archive filename.zip
> NULL
> NULL
> Everything is Ok
> NULL
> It reports that everything is ok, but it just don't create the zip file. It
> might be that this 7-zip program just can't run properly without having an
> open cmd prompt - which of course is a bit weird.
> Regards
> Steen
>
>
> "Hari" <hari_prasad_k@.hotmail.com> skrev i en meddelelse
> news:eCrlkGhUEHA.484@.TK2MSFTNGP10.phx.gbl...
> from
> zip
> it
> It
> a
> as
>
|||Solved it.....
In my bat file I just changed to the directory where the files where
placed - that did the trick(..should have thought about that from the very
beginning...).
It might as well work if I specify the full path for both input and output
files as Tibor suggest, but I haven't tried it.
Thanks for all your suggestions.
Regards
Steen
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> skrev i
en meddelelse news:%23lkrJmhUEHA.2692@.TK2MSFTNGP09.phx.gbl...
> Did you qualify the path for both the input as well as output files?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Steen Persson" <SPE@.REMOVEdatea.dk> wrote in message
news:uPWCBNhUEHA.3988@.tk2msftngp13.phx.gbl...[vbcol=seagreen]
same[vbcol=seagreen]
running[vbcol=seagreen]
It[vbcol=seagreen]
an[vbcol=seagreen]
to[vbcol=seagreen]
it,[vbcol=seagreen]
bat[vbcol=seagreen]
file.[vbcol=seagreen]
"open"[vbcol=seagreen]
a[vbcol=seagreen]
be[vbcol=seagreen]
that
>
|||Make sure the sqlagent account has enough permission to zip. Also you might
try winzip 8.0 command line addon. It's working for me.
"Steen Persson" <SPE@.REMOVEdatea.dk> wrote in message
news:uKWljChUEHA.1764@.TK2MSFTNGP10.phx.gbl...
> Hi
> I'm having a strange problem which puzzels me a little bit.
> I have created a SQL job that can zip a file that has been generated from
a
> provious job. I've made a bat file that contains the string to run to zip
> the file. When I run this bat file manually just by doubleclicking it, it
> runs fine and do the job. When I set the SQL job to execute the same bat
> file, it executes the bat file, but the bat file doesn't zip the file. It
> reports that everything is ok, but the file isn't being created.
> It seems like the zip program I've found that can be executed from a
command
> line (it's a program called 7-zip) will only do the job if it can "open" a
> command prompt in the background which SQL apparently doesn't do.
> My question is now if any of you know a way to let a SQL job "open" a
> command prompt and then execute a program from there. It could also be as
> simple as using a different zip program. 7-zip was just one I found that
> could zip a file from a command line.
> Regards
> Steen
>
|||In article <uKWljChUEHA.1764@.TK2MSFTNGP10.phx.gbl>, "Steen Persson" <SPE@.REMOVEdatea.dk> wrote:
>Hi
>I'm having a strange problem which puzzels me a little bit.
>I have created a SQL job that can zip a file that has been generated from a
>provious job. I've made a bat file that contains the string to run to zip
>the file. When I run this bat file manually just by doubleclicking it, it
>runs fine and do the job. When I set the SQL job to execute the same bat
>file, it executes the bat file, but the bat file doesn't zip the file. It
>reports that everything is ok, but the file isn't being created.
>It seems like the zip program I've found that can be executed from a command
>line (it's a program called 7-zip) will only do the job if it can "open" a
>command prompt in the background which SQL apparently doesn't do.
>My question is now if any of you know a way to let a SQL job "open" a
>command prompt and then execute a program from there. It could also be as
>simple as using a different zip program. 7-zip was just one I found that
>could zip a file from a command line.
>Regards
>Steen
Use PKZip.
The original and best cmdline tool.
Running a program from a SQL job
I'm having a strange problem which puzzels me a little bit.
I have created a SQL job that can zip a file that has been generated from a
provious job. I've made a bat file that contains the string to run to zip
the file. When I run this bat file manually just by doubleclicking it, it
runs fine and do the job. When I set the SQL job to execute the same bat
file, it executes the bat file, but the bat file doesn't zip the file. It
reports that everything is ok, but the file isn't being created.
It seems like the zip program I've found that can be executed from a command
line (it's a program called 7-zip) will only do the job if it can "open" a
command prompt in the background which SQL apparently doesn't do.
My question is now if any of you know a way to let a SQL job "open" a
command prompt and then execute a program from there. It could also be as
simple as using a different zip program. 7-zip was just one I found that
could zip a file from a command line.
Regards
SteenHi,
Use XP_CMDSHELL to fire a OS command from command prompt.
Before commentng more, can you send out the script you are trying out.
Thanks
Hari
MCDBA
"Steen Persson" <SPE@.REMOVEdatea.dk> wrote in message
news:uKWljChUEHA.1764@.TK2MSFTNGP10.phx.gbl...
> Hi
> I'm having a strange problem which puzzels me a little bit.
> I have created a SQL job that can zip a file that has been generated from
a
> provious job. I've made a bat file that contains the string to run to zip
> the file. When I run this bat file manually just by doubleclicking it, it
> runs fine and do the job. When I set the SQL job to execute the same bat
> file, it executes the bat file, but the bat file doesn't zip the file. It
> reports that everything is ok, but the file isn't being created.
> It seems like the zip program I've found that can be executed from a
command
> line (it's a program called 7-zip) will only do the job if it can "open" a
> command prompt in the background which SQL apparently doesn't do.
> My question is now if any of you know a way to let a SQL job "open" a
> command prompt and then execute a program from there. It could also be as
> simple as using a different zip program. 7-zip was just one I found that
> could zip a file from a command line.
> Regards
> Steen
>|||Hi Hari
Thanks for the advise. I've just tried it, but it seems like it has the same
problem as when I run it un a job.
The commandline I'm running is : "c:\program files\7-zip\7z" a -tzip
filename.zip filename.mdc
This works fine when running it either as a bat file or just in a cmd
window, but from within SQL it seems to fail. The output I get from running
it either as a job or with the XP_CmdShell is :
NULL
7-Zip 2.30 Beta 28 Copyright (c) 1999-2003 Igor Pavlov 2003-02-16
Scanning
NULL
Updating archive filename.zip
NULL
NULL
Everything is Ok
NULL
It reports that everything is ok, but it just don't create the zip file. It
might be that this 7-zip program just can't run properly without having an
open cmd prompt - which of course is a bit weird.
Regards
Steen
"Hari" <hari_prasad_k@.hotmail.com> skrev i en meddelelse
news:eCrlkGhUEHA.484@.TK2MSFTNGP10.phx.gbl...
> Hi,
> Use XP_CMDSHELL to fire a OS command from command prompt.
> Before commentng more, can you send out the script you are trying out.
> --
> Thanks
> Hari
> MCDBA
> "Steen Persson" <SPE@.REMOVEdatea.dk> wrote in message
> news:uKWljChUEHA.1764@.TK2MSFTNGP10.phx.gbl...
from[vbcol=seagreen]
> a
zip[vbcol=seagreen]
it[vbcol=seagreen]
It[vbcol=seagreen]
> command
a[vbcol=seagreen]
as[vbcol=seagreen]
>|||Hi,
Login to SQL server from command prompt:-
OSQL -Usa -Ppassword -S SQl_server
This will allow you to go to a SQL prompt:-
1>
Here you execute the xp_cmdshell
1>master..xp_cmdsehll 'c:\program files\7-zip\7z a -tzip'
2>go
Note:
Please use the syntax clearly
Thanks
Hari
MCDBA
"Steen Persson" <SPE@.REMOVEdatea.dk> wrote in message
news:uPWCBNhUEHA.3988@.tk2msftngp13.phx.gbl...
> Hi Hari
> Thanks for the advise. I've just tried it, but it seems like it has the
same
> problem as when I run it un a job.
> The commandline I'm running is : "c:\program files\7-zip\7z" a -tzip
> filename.zip filename.mdc
> This works fine when running it either as a bat file or just in a cmd
> window, but from within SQL it seems to fail. The output I get from
running
> it either as a job or with the XP_CmdShell is :
> NULL
> 7-Zip 2.30 Beta 28 Copyright (c) 1999-2003 Igor Pavlov 2003-02-16
> Scanning
> NULL
> Updating archive filename.zip
> NULL
> NULL
> Everything is Ok
> NULL
> It reports that everything is ok, but it just don't create the zip file.
It
> might be that this 7-zip program just can't run properly without having an
> open cmd prompt - which of course is a bit weird.
> Regards
> Steen
>
>
> "Hari" <hari_prasad_k@.hotmail.com> skrev i en meddelelse
> news:eCrlkGhUEHA.484@.TK2MSFTNGP10.phx.gbl...
> from
> zip
> it
bat[vbcol=seagreen]
> It
"open"[vbcol=seagreen]
> a
> as
that[vbcol=seagreen]
>|||Hi Hari
Thansk for your suggestions, but it simply won't do it. I get the same
result when running is with the Osql command. Apparently this zip program
only works when it's launched from it's "own" cmd prompt.
Steen
"Hari" <hari_prasad_k@.hotmail.com> skrev i en meddelelse
news:%23zI$HThUEHA.1020@.TK2MSFTNGP11.phx.gbl...
> Hi,
> Login to SQL server from command prompt:-
> OSQL -Usa -Ppassword -S SQl_server
> This will allow you to go to a SQL prompt:-
> 1>
> Here you execute the xp_cmdshell
> 1>master..xp_cmdsehll 'c:\program files\7-zip\7z a -tzip'
> 2>go
> Note:
> Please use the syntax clearly
> --
> Thanks
> Hari
> MCDBA
> "Steen Persson" <SPE@.REMOVEdatea.dk> wrote in message
> news:uPWCBNhUEHA.3988@.tk2msftngp13.phx.gbl...
> same
> running
> It
an[vbcol=seagreen]
to[vbcol=seagreen]
it,[vbcol=seagreen]
> bat
file.[vbcol=seagreen]
> "open"
a[vbcol=seagreen]
be[vbcol=seagreen]
> that
>|||Did you qualify the path for both the input as well as output files?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Steen Persson" <SPE@.REMOVEdatea.dk> wrote in message news:uPWCBNhUEHA.3988@.tk2msftngp13.phx
.gbl...
> Hi Hari
> Thanks for the advise. I've just tried it, but it seems like it has the sa
me
> problem as when I run it un a job.
> The commandline I'm running is : "c:\program files\7-zip\7z" a -tzip
> filename.zip filename.mdc
> This works fine when running it either as a bat file or just in a cmd
> window, but from within SQL it seems to fail. The output I get from runnin
g
> it either as a job or with the XP_CmdShell is :
> NULL
> 7-Zip 2.30 Beta 28 Copyright (c) 1999-2003 Igor Pavlov 2003-02-16
> Scanning
> NULL
> Updating archive filename.zip
> NULL
> NULL
> Everything is Ok
> NULL
> It reports that everything is ok, but it just don't create the zip file. I
t
> might be that this 7-zip program just can't run properly without having an
> open cmd prompt - which of course is a bit weird.
> Regards
> Steen
>
>
> "Hari" <hari_prasad_k@.hotmail.com> skrev i en meddelelse
> news:eCrlkGhUEHA.484@.TK2MSFTNGP10.phx.gbl...
> from
> zip
> it
> It
> a
> as
>|||Solved it.....
In my bat file I just changed to the directory where the files where
placed - that did the trick(..should have thought about that from the very
beginning...).
It might as well work if I specify the full path for both input and output
files as Tibor suggest, but I haven't tried it.
Thanks for all your suggestions.
Regards
Steen
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> skrev i
en meddelelse news:%23lkrJmhUEHA.2692@.TK2MSFTNGP09.phx.gbl...
> Did you qualify the path for both the input as well as output files?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Steen Persson" <SPE@.REMOVEdatea.dk> wrote in message
news:uPWCBNhUEHA.3988@.tk2msftngp13.phx.gbl...
same[vbcol=seagreen]
running[vbcol=seagreen]
It[vbcol=seagreen]
an[vbcol=seagreen]
to[vbcol=seagreen]
it,[vbcol=seagreen]
bat[vbcol=seagreen]
file.[vbcol=seagreen]
"open"[vbcol=seagreen]
a[vbcol=seagreen]
be[vbcol=seagreen]
that[vbcol=seagreen]
>|||Make sure the sqlagent account has enough permission to zip. Also you might
try winzip 8.0 command line addon. It's working for me.
"Steen Persson" <SPE@.REMOVEdatea.dk> wrote in message
news:uKWljChUEHA.1764@.TK2MSFTNGP10.phx.gbl...
> Hi
> I'm having a strange problem which puzzels me a little bit.
> I have created a SQL job that can zip a file that has been generated from
a
> provious job. I've made a bat file that contains the string to run to zip
> the file. When I run this bat file manually just by doubleclicking it, it
> runs fine and do the job. When I set the SQL job to execute the same bat
> file, it executes the bat file, but the bat file doesn't zip the file. It
> reports that everything is ok, but the file isn't being created.
> It seems like the zip program I've found that can be executed from a
command
> line (it's a program called 7-zip) will only do the job if it can "open" a
> command prompt in the background which SQL apparently doesn't do.
> My question is now if any of you know a way to let a SQL job "open" a
> command prompt and then execute a program from there. It could also be as
> simple as using a different zip program. 7-zip was just one I found that
> could zip a file from a command line.
> Regards
> Steen
>|||In article <uKWljChUEHA.1764@.TK2MSFTNGP10.phx.gbl>, "Steen Persson" <SPE@.REMOVEdatea.dk> wro
te:
>Hi
>I'm having a strange problem which puzzels me a little bit.
>I have created a SQL job that can zip a file that has been generated from a
>provious job. I've made a bat file that contains the string to run to zip
>the file. When I run this bat file manually just by doubleclicking it, it
>runs fine and do the job. When I set the SQL job to execute the same bat
>file, it executes the bat file, but the bat file doesn't zip the file. It
>reports that everything is ok, but the file isn't being created.
>It seems like the zip program I've found that can be executed from a comman
d
>line (it's a program called 7-zip) will only do the job if it can "open" a
>command prompt in the background which SQL apparently doesn't do.
>My question is now if any of you know a way to let a SQL job "open" a
>command prompt and then execute a program from there. It could also be as
>simple as using a different zip program. 7-zip was just one I found that
>could zip a file from a command line.
>Regards
>Steen
Use PKZip.
The original and best cmdline tool.
Running a program from a SQL job
I'm having a strange problem which puzzels me a little bit.
I have created a SQL job that can zip a file that has been generated from a
provious job. I've made a bat file that contains the string to run to zip
the file. When I run this bat file manually just by doubleclicking it, it
runs fine and do the job. When I set the SQL job to execute the same bat
file, it executes the bat file, but the bat file doesn't zip the file. It
reports that everything is ok, but the file isn't being created.
It seems like the zip program I've found that can be executed from a command
line (it's a program called 7-zip) will only do the job if it can "open" a
command prompt in the background which SQL apparently doesn't do.
My question is now if any of you know a way to let a SQL job "open" a
command prompt and then execute a program from there. It could also be as
simple as using a different zip program. 7-zip was just one I found that
could zip a file from a command line.
Regards
SteenHi,
Use XP_CMDSHELL to fire a OS command from command prompt.
Before commentng more, can you send out the script you are trying out.
--
Thanks
Hari
MCDBA
"Steen Persson" <SPE@.REMOVEdatea.dk> wrote in message
news:uKWljChUEHA.1764@.TK2MSFTNGP10.phx.gbl...
> Hi
> I'm having a strange problem which puzzels me a little bit.
> I have created a SQL job that can zip a file that has been generated from
a
> provious job. I've made a bat file that contains the string to run to zip
> the file. When I run this bat file manually just by doubleclicking it, it
> runs fine and do the job. When I set the SQL job to execute the same bat
> file, it executes the bat file, but the bat file doesn't zip the file. It
> reports that everything is ok, but the file isn't being created.
> It seems like the zip program I've found that can be executed from a
command
> line (it's a program called 7-zip) will only do the job if it can "open" a
> command prompt in the background which SQL apparently doesn't do.
> My question is now if any of you know a way to let a SQL job "open" a
> command prompt and then execute a program from there. It could also be as
> simple as using a different zip program. 7-zip was just one I found that
> could zip a file from a command line.
> Regards
> Steen
>|||Hi Hari
Thanks for the advise. I've just tried it, but it seems like it has the same
problem as when I run it un a job.
The commandline I'm running is : "c:\program files\7-zip\7z" a -tzip
filename.zip filename.mdc
This works fine when running it either as a bat file or just in a cmd
window, but from within SQL it seems to fail. The output I get from running
it either as a job or with the XP_CmdShell is :
NULL
7-Zip 2.30 Beta 28 Copyright (c) 1999-2003 Igor Pavlov 2003-02-16
Scanning
NULL
Updating archive filename.zip
NULL
NULL
Everything is Ok
NULL
It reports that everything is ok, but it just don't create the zip file. It
might be that this 7-zip program just can't run properly without having an
open cmd prompt - which of course is a bit weird.
Regards
Steen
"Hari" <hari_prasad_k@.hotmail.com> skrev i en meddelelse
news:eCrlkGhUEHA.484@.TK2MSFTNGP10.phx.gbl...
> Hi,
> Use XP_CMDSHELL to fire a OS command from command prompt.
> Before commentng more, can you send out the script you are trying out.
> --
> Thanks
> Hari
> MCDBA
> "Steen Persson" <SPE@.REMOVEdatea.dk> wrote in message
> news:uKWljChUEHA.1764@.TK2MSFTNGP10.phx.gbl...
> > Hi
> >
> > I'm having a strange problem which puzzels me a little bit.
> > I have created a SQL job that can zip a file that has been generated
from
> a
> > provious job. I've made a bat file that contains the string to run to
zip
> > the file. When I run this bat file manually just by doubleclicking it,
it
> > runs fine and do the job. When I set the SQL job to execute the same bat
> > file, it executes the bat file, but the bat file doesn't zip the file.
It
> > reports that everything is ok, but the file isn't being created.
> >
> > It seems like the zip program I've found that can be executed from a
> command
> > line (it's a program called 7-zip) will only do the job if it can "open"
a
> > command prompt in the background which SQL apparently doesn't do.
> > My question is now if any of you know a way to let a SQL job "open" a
> > command prompt and then execute a program from there. It could also be
as
> > simple as using a different zip program. 7-zip was just one I found that
> > could zip a file from a command line.
> >
> > Regards
> > Steen
> >
> >
>|||Hi,
Login to SQL server from command prompt:-
OSQL -Usa -Ppassword -S SQl_server
This will allow you to go to a SQL prompt:-
1>
Here you execute the xp_cmdshell
1>master..xp_cmdsehll 'c:\program files\7-zip\7z a -tzip'
2>go
Note:
Please use the syntax clearly
--
Thanks
Hari
MCDBA
"Steen Persson" <SPE@.REMOVEdatea.dk> wrote in message
news:uPWCBNhUEHA.3988@.tk2msftngp13.phx.gbl...
> Hi Hari
> Thanks for the advise. I've just tried it, but it seems like it has the
same
> problem as when I run it un a job.
> The commandline I'm running is : "c:\program files\7-zip\7z" a -tzip
> filename.zip filename.mdc
> This works fine when running it either as a bat file or just in a cmd
> window, but from within SQL it seems to fail. The output I get from
running
> it either as a job or with the XP_CmdShell is :
> NULL
> 7-Zip 2.30 Beta 28 Copyright (c) 1999-2003 Igor Pavlov 2003-02-16
> Scanning
> NULL
> Updating archive filename.zip
> NULL
> NULL
> Everything is Ok
> NULL
> It reports that everything is ok, but it just don't create the zip file.
It
> might be that this 7-zip program just can't run properly without having an
> open cmd prompt - which of course is a bit weird.
> Regards
> Steen
>
>
> "Hari" <hari_prasad_k@.hotmail.com> skrev i en meddelelse
> news:eCrlkGhUEHA.484@.TK2MSFTNGP10.phx.gbl...
> > Hi,
> >
> > Use XP_CMDSHELL to fire a OS command from command prompt.
> >
> > Before commentng more, can you send out the script you are trying out.
> >
> > --
> > Thanks
> > Hari
> > MCDBA
> > "Steen Persson" <SPE@.REMOVEdatea.dk> wrote in message
> > news:uKWljChUEHA.1764@.TK2MSFTNGP10.phx.gbl...
> > > Hi
> > >
> > > I'm having a strange problem which puzzels me a little bit.
> > > I have created a SQL job that can zip a file that has been generated
> from
> > a
> > > provious job. I've made a bat file that contains the string to run to
> zip
> > > the file. When I run this bat file manually just by doubleclicking it,
> it
> > > runs fine and do the job. When I set the SQL job to execute the same
bat
> > > file, it executes the bat file, but the bat file doesn't zip the file.
> It
> > > reports that everything is ok, but the file isn't being created.
> > >
> > > It seems like the zip program I've found that can be executed from a
> > command
> > > line (it's a program called 7-zip) will only do the job if it can
"open"
> a
> > > command prompt in the background which SQL apparently doesn't do.
> > > My question is now if any of you know a way to let a SQL job "open" a
> > > command prompt and then execute a program from there. It could also be
> as
> > > simple as using a different zip program. 7-zip was just one I found
that
> > > could zip a file from a command line.
> > >
> > > Regards
> > > Steen
> > >
> > >
> >
> >
>|||Hi Hari
Thansk for your suggestions, but it simply won't do it. I get the same
result when running is with the Osql command. Apparently this zip program
only works when it's launched from it's "own" cmd prompt.
Steen
"Hari" <hari_prasad_k@.hotmail.com> skrev i en meddelelse
news:%23zI$HThUEHA.1020@.TK2MSFTNGP11.phx.gbl...
> Hi,
> Login to SQL server from command prompt:-
> OSQL -Usa -Ppassword -S SQl_server
> This will allow you to go to a SQL prompt:-
> 1>
> Here you execute the xp_cmdshell
> 1>master..xp_cmdsehll 'c:\program files\7-zip\7z a -tzip'
> 2>go
> Note:
> Please use the syntax clearly
> --
> Thanks
> Hari
> MCDBA
> "Steen Persson" <SPE@.REMOVEdatea.dk> wrote in message
> news:uPWCBNhUEHA.3988@.tk2msftngp13.phx.gbl...
> > Hi Hari
> >
> > Thanks for the advise. I've just tried it, but it seems like it has the
> same
> > problem as when I run it un a job.
> >
> > The commandline I'm running is : "c:\program files\7-zip\7z" a -tzip
> > filename.zip filename.mdc
> >
> > This works fine when running it either as a bat file or just in a cmd
> > window, but from within SQL it seems to fail. The output I get from
> running
> > it either as a job or with the XP_CmdShell is :
> >
> > NULL
> > 7-Zip 2.30 Beta 28 Copyright (c) 1999-2003 Igor Pavlov 2003-02-16
> > Scanning
> > NULL
> > Updating archive filename.zip
> > NULL
> > NULL
> > Everything is Ok
> > NULL
> >
> > It reports that everything is ok, but it just don't create the zip file.
> It
> > might be that this 7-zip program just can't run properly without having
an
> > open cmd prompt - which of course is a bit weird.
> >
> > Regards
> > Steen
> >
> >
> >
> >
> >
> > "Hari" <hari_prasad_k@.hotmail.com> skrev i en meddelelse
> > news:eCrlkGhUEHA.484@.TK2MSFTNGP10.phx.gbl...
> > > Hi,
> > >
> > > Use XP_CMDSHELL to fire a OS command from command prompt.
> > >
> > > Before commentng more, can you send out the script you are trying out.
> > >
> > > --
> > > Thanks
> > > Hari
> > > MCDBA
> > > "Steen Persson" <SPE@.REMOVEdatea.dk> wrote in message
> > > news:uKWljChUEHA.1764@.TK2MSFTNGP10.phx.gbl...
> > > > Hi
> > > >
> > > > I'm having a strange problem which puzzels me a little bit.
> > > > I have created a SQL job that can zip a file that has been generated
> > from
> > > a
> > > > provious job. I've made a bat file that contains the string to run
to
> > zip
> > > > the file. When I run this bat file manually just by doubleclicking
it,
> > it
> > > > runs fine and do the job. When I set the SQL job to execute the same
> bat
> > > > file, it executes the bat file, but the bat file doesn't zip the
file.
> > It
> > > > reports that everything is ok, but the file isn't being created.
> > > >
> > > > It seems like the zip program I've found that can be executed from a
> > > command
> > > > line (it's a program called 7-zip) will only do the job if it can
> "open"
> > a
> > > > command prompt in the background which SQL apparently doesn't do.
> > > > My question is now if any of you know a way to let a SQL job "open"
a
> > > > command prompt and then execute a program from there. It could also
be
> > as
> > > > simple as using a different zip program. 7-zip was just one I found
> that
> > > > could zip a file from a command line.
> > > >
> > > > Regards
> > > > Steen
> > > >
> > > >
> > >
> > >
> >
> >
>|||Did you qualify the path for both the input as well as output files?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Steen Persson" <SPE@.REMOVEdatea.dk> wrote in message news:uPWCBNhUEHA.3988@.tk2msftngp13.phx.gbl...
> Hi Hari
> Thanks for the advise. I've just tried it, but it seems like it has the same
> problem as when I run it un a job.
> The commandline I'm running is : "c:\program files\7-zip\7z" a -tzip
> filename.zip filename.mdc
> This works fine when running it either as a bat file or just in a cmd
> window, but from within SQL it seems to fail. The output I get from running
> it either as a job or with the XP_CmdShell is :
> NULL
> 7-Zip 2.30 Beta 28 Copyright (c) 1999-2003 Igor Pavlov 2003-02-16
> Scanning
> NULL
> Updating archive filename.zip
> NULL
> NULL
> Everything is Ok
> NULL
> It reports that everything is ok, but it just don't create the zip file. It
> might be that this 7-zip program just can't run properly without having an
> open cmd prompt - which of course is a bit weird.
> Regards
> Steen
>
>
> "Hari" <hari_prasad_k@.hotmail.com> skrev i en meddelelse
> news:eCrlkGhUEHA.484@.TK2MSFTNGP10.phx.gbl...
> > Hi,
> >
> > Use XP_CMDSHELL to fire a OS command from command prompt.
> >
> > Before commentng more, can you send out the script you are trying out.
> >
> > --
> > Thanks
> > Hari
> > MCDBA
> > "Steen Persson" <SPE@.REMOVEdatea.dk> wrote in message
> > news:uKWljChUEHA.1764@.TK2MSFTNGP10.phx.gbl...
> > > Hi
> > >
> > > I'm having a strange problem which puzzels me a little bit.
> > > I have created a SQL job that can zip a file that has been generated
> from
> > a
> > > provious job. I've made a bat file that contains the string to run to
> zip
> > > the file. When I run this bat file manually just by doubleclicking it,
> it
> > > runs fine and do the job. When I set the SQL job to execute the same bat
> > > file, it executes the bat file, but the bat file doesn't zip the file.
> It
> > > reports that everything is ok, but the file isn't being created.
> > >
> > > It seems like the zip program I've found that can be executed from a
> > command
> > > line (it's a program called 7-zip) will only do the job if it can "open"
> a
> > > command prompt in the background which SQL apparently doesn't do.
> > > My question is now if any of you know a way to let a SQL job "open" a
> > > command prompt and then execute a program from there. It could also be
> as
> > > simple as using a different zip program. 7-zip was just one I found that
> > > could zip a file from a command line.
> > >
> > > Regards
> > > Steen
> > >
> > >
> >
> >
>|||Solved it.....
In my bat file I just changed to the directory where the files where
placed - that did the trick(..should have thought about that from the very
beginning...).
It might as well work if I specify the full path for both input and output
files as Tibor suggest, but I haven't tried it.
Thanks for all your suggestions.
Regards
Steen
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> skrev i
en meddelelse news:%23lkrJmhUEHA.2692@.TK2MSFTNGP09.phx.gbl...
> Did you qualify the path for both the input as well as output files?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Steen Persson" <SPE@.REMOVEdatea.dk> wrote in message
news:uPWCBNhUEHA.3988@.tk2msftngp13.phx.gbl...
> > Hi Hari
> >
> > Thanks for the advise. I've just tried it, but it seems like it has the
same
> > problem as when I run it un a job.
> >
> > The commandline I'm running is : "c:\program files\7-zip\7z" a -tzip
> > filename.zip filename.mdc
> >
> > This works fine when running it either as a bat file or just in a cmd
> > window, but from within SQL it seems to fail. The output I get from
running
> > it either as a job or with the XP_CmdShell is :
> >
> > NULL
> > 7-Zip 2.30 Beta 28 Copyright (c) 1999-2003 Igor Pavlov 2003-02-16
> > Scanning
> > NULL
> > Updating archive filename.zip
> > NULL
> > NULL
> > Everything is Ok
> > NULL
> >
> > It reports that everything is ok, but it just don't create the zip file.
It
> > might be that this 7-zip program just can't run properly without having
an
> > open cmd prompt - which of course is a bit weird.
> >
> > Regards
> > Steen
> >
> >
> >
> >
> >
> > "Hari" <hari_prasad_k@.hotmail.com> skrev i en meddelelse
> > news:eCrlkGhUEHA.484@.TK2MSFTNGP10.phx.gbl...
> > > Hi,
> > >
> > > Use XP_CMDSHELL to fire a OS command from command prompt.
> > >
> > > Before commentng more, can you send out the script you are trying out.
> > >
> > > --
> > > Thanks
> > > Hari
> > > MCDBA
> > > "Steen Persson" <SPE@.REMOVEdatea.dk> wrote in message
> > > news:uKWljChUEHA.1764@.TK2MSFTNGP10.phx.gbl...
> > > > Hi
> > > >
> > > > I'm having a strange problem which puzzels me a little bit.
> > > > I have created a SQL job that can zip a file that has been generated
> > from
> > > a
> > > > provious job. I've made a bat file that contains the string to run
to
> > zip
> > > > the file. When I run this bat file manually just by doubleclicking
it,
> > it
> > > > runs fine and do the job. When I set the SQL job to execute the same
bat
> > > > file, it executes the bat file, but the bat file doesn't zip the
file.
> > It
> > > > reports that everything is ok, but the file isn't being created.
> > > >
> > > > It seems like the zip program I've found that can be executed from a
> > > command
> > > > line (it's a program called 7-zip) will only do the job if it can
"open"
> > a
> > > > command prompt in the background which SQL apparently doesn't do.
> > > > My question is now if any of you know a way to let a SQL job "open"
a
> > > > command prompt and then execute a program from there. It could also
be
> > as
> > > > simple as using a different zip program. 7-zip was just one I found
that
> > > > could zip a file from a command line.
> > > >
> > > > Regards
> > > > Steen
> > > >
> > > >
> > >
> > >
> >
> >
>|||Make sure the sqlagent account has enough permission to zip. Also you might
try winzip 8.0 command line addon. It's working for me.
"Steen Persson" <SPE@.REMOVEdatea.dk> wrote in message
news:uKWljChUEHA.1764@.TK2MSFTNGP10.phx.gbl...
> Hi
> I'm having a strange problem which puzzels me a little bit.
> I have created a SQL job that can zip a file that has been generated from
a
> provious job. I've made a bat file that contains the string to run to zip
> the file. When I run this bat file manually just by doubleclicking it, it
> runs fine and do the job. When I set the SQL job to execute the same bat
> file, it executes the bat file, but the bat file doesn't zip the file. It
> reports that everything is ok, but the file isn't being created.
> It seems like the zip program I've found that can be executed from a
command
> line (it's a program called 7-zip) will only do the job if it can "open" a
> command prompt in the background which SQL apparently doesn't do.
> My question is now if any of you know a way to let a SQL job "open" a
> command prompt and then execute a program from there. It could also be as
> simple as using a different zip program. 7-zip was just one I found that
> could zip a file from a command line.
> Regards
> Steen
>|||In article <uKWljChUEHA.1764@.TK2MSFTNGP10.phx.gbl>, "Steen Persson" <SPE@.REMOVEdatea.dk> wrote:
>Hi
>I'm having a strange problem which puzzels me a little bit.
>I have created a SQL job that can zip a file that has been generated from a
>provious job. I've made a bat file that contains the string to run to zip
>the file. When I run this bat file manually just by doubleclicking it, it
>runs fine and do the job. When I set the SQL job to execute the same bat
>file, it executes the bat file, but the bat file doesn't zip the file. It
>reports that everything is ok, but the file isn't being created.
>It seems like the zip program I've found that can be executed from a command
>line (it's a program called 7-zip) will only do the job if it can "open" a
>command prompt in the background which SQL apparently doesn't do.
>My question is now if any of you know a way to let a SQL job "open" a
>command prompt and then execute a program from there. It could also be as
>simple as using a different zip program. 7-zip was just one I found that
>could zip a file from a command line.
>Regards
>Steen
Use PKZip.
The original and best cmdline tool.
Monday, March 26, 2012
Running a .vbs script as a job
I have created a .vbs scripted that i've tested and works fine when i run it on it's own but when i try to run it as a job on my SQL 2005 i get this error:
Message
Executed as user: OESCCA\MKIMONOS-IT$. Error Code: 0 Error Source= Microsoft VBScript compilation error Error Description: Expected statement Error on Line 0. The step failed.
The Step Type is "ActiveX Script"
i have selected the VBScript Radio button and this is the command
"C:\ESG_COM\WorkFlowProcessorLogFileJanitor.vbs" " C:\ESG_COM\"
the " C:\ESG_COM\" is the directory path of the folder it should process.
Thanks
Marios
Marios,
You would put the code in the vbs file - the script code itself - in an ActiveX Script job.
If you want to execute a vbs script file, you would use a CmdExec job step - you'd execute the script with a command along the lines of:
CScript.exe /NOLOGO C:\YourPath\YourScript.vbs
-Sue
|||Hey Sue
i tried executing the script with CmdExec but it said this is not a valid 32 app
i didn't realized i had to first put CScript.exe /NOLOGO ... what does that do?
Thanks!!
Marios
|||Hi Marios,
Cscript.exe is just the command line based host for windows scripts. The /NOLOGO suppresses the banner that you get when you run a script through Cscript.
You can see the options for the exe by typing the following at the command prompt: cscript /?
-Sue
Wednesday, March 21, 2012
Run trace script
I really need help to fix this issue. Below is what I am trying to do.
I created a trace template and script it out to be a SQL script file. I
want to run this script when CPU utilizes at over 50 or 60 or higher. I
set up an System Moniter Alert to run this script when CPU runs meet
above threshold. However, when I manipulated data in Query Analyzer to
make CPU utilize at 100% but trace script never get kick off.
The ideal task is, I wanted to capture what is running on my box when
CPU runs at 50% or higher.
Please let me know and provide me any instructions on what I'm missing.
Thanks,
Silaphet,What's the interval for sampling the perofmance data, in your alert? Could
it be that when the alert is checking the CPU utilisation, the CPU was not
really running above the threshold?
How is the alert supposed to invoke the trace? Are you using a OSQL?
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Silaphet" <kmounkhaty@.cox.net> wrote in message
news:1108700587.482182.134100@.l41g2000cwc.googlegroups.com...
Hi All,
I really need help to fix this issue. Below is what I am trying to do.
I created a trace template and script it out to be a SQL script file. I
want to run this script when CPU utilizes at over 50 or 60 or higher. I
set up an System Moniter Alert to run this script when CPU runs meet
above threshold. However, when I manipulated data in Query Analyzer to
make CPU utilize at 100% but trace script never get kick off.
The ideal task is, I wanted to capture what is running on my box when
CPU runs at 50% or higher.
Please let me know and provide me any instructions on what I'm missing.
Thanks,
Silaphet,|||Hi Vyas,
The interval was 2 for sampling data and the unit was seconds. While
the alert was running, I manipulated data to insert into a table in
millions rows from Query Analyzer. At that time, I watched the CPU and
it was 100% for at least 5 seconds to complete. I though, when CPU ran
over the threshold the alert should kick off the trace script file to
capture the SQL statements that I inserted data into table as I
explained above.
In the alert, there is a tab called "ACTION" and has option check box
says 'run this program'. I checked this option with valid path where I
store my strace script file.
Do I need to convert my trace script SQL file to be cmd or executable
file before alert can kick it of?
Please let me know what do I have to do to remedy this issue.
Thanks,
Silaphet,|||You mean, you provided a path to your .sql file where your sql commands are
stored? Then it will not work. See OSQL in SQL Server Books Online. It can
take your script file and server details as parameters and run your script
against the specified server.
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Silaphet" <kmounkhaty@.cox.net> wrote in message
news:1108736989.524985.277180@.l41g2000cwc.googlegroups.com...
Hi Vyas,
The interval was 2 for sampling data and the unit was seconds. While
the alert was running, I manipulated data to insert into a table in
millions rows from Query Analyzer. At that time, I watched the CPU and
it was 100% for at least 5 seconds to complete. I though, when CPU ran
over the threshold the alert should kick off the trace script file to
capture the SQL statements that I inserted data into table as I
explained above.
In the alert, there is a tab called "ACTION" and has option check box
says 'run this program'. I checked this option with valid path where I
store my strace script file.
Do I need to convert my trace script SQL file to be cmd or executable
file before alert can kick it of?
Please let me know what do I have to do to remedy this issue.
Thanks,
Silaphet,|||Vyas,
Let me explain to you clearly now. I have 2 files name below:
1. RunOSQL.SQL
This file has this OSQL syntax below
"OSQL -Sserver\Instance -Usa -Ppassword -iInputfile
The RunOSQL.SQL file is the file I provide the with a valid path on
the Action tab of alert.
2. The input file is the file to create trace when CPU utilization hits
over threshold
Both these files are located in C drive.
But when I inserted millions rows into a temp table the CPU ran at 100%
and the script never get executed. I think, I have to make this SQL
script to be a cmd, exe or bat file before it can call another script
to get executed.
Please let me know what I am missing now.
Thanks,
Silaphet,|||Name the file containing the OSQL.EXE call as a .BAT file. For example,
RunScript.bat
--
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Silaphet" <kmounkhaty@.cox.net> wrote in message
news:1108751013.930610.13850@.c13g2000cwb.googlegroups.com...
> Vyas,
> Let me explain to you clearly now. I have 2 files name below:
> 1. RunOSQL.SQL
> This file has this OSQL syntax below
> "OSQL -Sserver\Instance -Usa -Ppassword -iInputfile
> The RunOSQL.SQL file is the file I provide the with a valid path on
> the Action tab of alert.
> 2. The input file is the file to create trace when CPU utilization hits
> over threshold
> Both these files are located in C drive.
> But when I inserted millions rows into a temp table the CPU ran at 100%
> and the script never get executed. I think, I have to make this SQL
> script to be a cmd, exe or bat file before it can call another script
> to get executed.
>
> Please let me know what I am missing now.
> Thanks,
> Silaphet,
>
Run trace script
I really need help to fix this issue. Below is what I am trying to do.
I created a trace template and script it out to be a SQL script file. I
want to run this script when CPU utilizes at over 50 or 60 or higher. I
set up an System Moniter Alert to run this script when CPU runs meet
above threshold. However, when I manipulated data in Query Analyzer to
make CPU utilize at 100% but trace script never get kick off.
The ideal task is, I wanted to capture what is running on my box when
CPU runs at 50% or higher.
Please let me know and provide me any instructions on what I'm missing.
Thanks,
Silaphet,
What's the interval for sampling the perofmance data, in your alert? Could
it be that when the alert is checking the CPU utilisation, the CPU was not
really running above the threshold?
How is the alert supposed to invoke the trace? Are you using a OSQL?
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Silaphet" <kmounkhaty@.cox.net> wrote in message
news:1108700587.482182.134100@.l41g2000cwc.googlegr oups.com...
Hi All,
I really need help to fix this issue. Below is what I am trying to do.
I created a trace template and script it out to be a SQL script file. I
want to run this script when CPU utilizes at over 50 or 60 or higher. I
set up an System Moniter Alert to run this script when CPU runs meet
above threshold. However, when I manipulated data in Query Analyzer to
make CPU utilize at 100% but trace script never get kick off.
The ideal task is, I wanted to capture what is running on my box when
CPU runs at 50% or higher.
Please let me know and provide me any instructions on what I'm missing.
Thanks,
Silaphet,
|||Hi Vyas,
The interval was 2 for sampling data and the unit was seconds. While
the alert was running, I manipulated data to insert into a table in
millions rows from Query Analyzer. At that time, I watched the CPU and
it was 100% for at least 5 seconds to complete. I though, when CPU ran
over the threshold the alert should kick off the trace script file to
capture the SQL statements that I inserted data into table as I
explained above.
In the alert, there is a tab called "ACTION" and has option check box
says 'run this program'. I checked this option with valid path where I
store my strace script file.
Do I need to convert my trace script SQL file to be cmd or executable
file before alert can kick it of?
Please let me know what do I have to do to remedy this issue.
Thanks,
Silaphet,
|||You mean, you provided a path to your .sql file where your sql commands are
stored? Then it will not work. See OSQL in SQL Server Books Online. It can
take your script file and server details as parameters and run your script
against the specified server.
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Silaphet" <kmounkhaty@.cox.net> wrote in message
news:1108736989.524985.277180@.l41g2000cwc.googlegr oups.com...
Hi Vyas,
The interval was 2 for sampling data and the unit was seconds. While
the alert was running, I manipulated data to insert into a table in
millions rows from Query Analyzer. At that time, I watched the CPU and
it was 100% for at least 5 seconds to complete. I though, when CPU ran
over the threshold the alert should kick off the trace script file to
capture the SQL statements that I inserted data into table as I
explained above.
In the alert, there is a tab called "ACTION" and has option check box
says 'run this program'. I checked this option with valid path where I
store my strace script file.
Do I need to convert my trace script SQL file to be cmd or executable
file before alert can kick it of?
Please let me know what do I have to do to remedy this issue.
Thanks,
Silaphet,
|||Vyas,
Let me explain to you clearly now. I have 2 files name below:
1. RunOSQL.SQL
This file has this OSQL syntax below
"OSQL -Sserver\Instance -Usa -Ppassword -iInputfile
The RunOSQL.SQL file is the file I provide the with a valid path on
the Action tab of alert.
2. The input file is the file to create trace when CPU utilization hits
over threshold
Both these files are located in C drive.
But when I inserted millions rows into a temp table the CPU ran at 100%
and the script never get executed. I think, I have to make this SQL
script to be a cmd, exe or bat file before it can call another script
to get executed.
Please let me know what I am missing now.
Thanks,
Silaphet,
|||Name the file containing the OSQL.EXE call as a .BAT file. For example,
RunScript.bat
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Silaphet" <kmounkhaty@.cox.net> wrote in message
news:1108751013.930610.13850@.c13g2000cwb.googlegro ups.com...
> Vyas,
> Let me explain to you clearly now. I have 2 files name below:
> 1. RunOSQL.SQL
> This file has this OSQL syntax below
> "OSQL -Sserver\Instance -Usa -Ppassword -iInputfile
> The RunOSQL.SQL file is the file I provide the with a valid path on
> the Action tab of alert.
> 2. The input file is the file to create trace when CPU utilization hits
> over threshold
> Both these files are located in C drive.
> But when I inserted millions rows into a temp table the CPU ran at 100%
> and the script never get executed. I think, I have to make this SQL
> script to be a cmd, exe or bat file before it can call another script
> to get executed.
>
> Please let me know what I am missing now.
> Thanks,
> Silaphet,
>
sql
Run trace script
I really need help to fix this issue. Below is what I am trying to do.
I created a trace template and script it out to be a SQL script file. I
want to run this script when CPU utilizes at over 50 or 60 or higher. I
set up an System Moniter Alert to run this script when CPU runs meet
above threshold. However, when I manipulated data in Query Analyzer to
make CPU utilize at 100% but trace script never get kick off.
The ideal task is, I wanted to capture what is running on my box when
CPU runs at 50% or higher.
Please let me know and provide me any instructions on what I'm missing.
Thanks,
Silaphet,What's the interval for sampling the perofmance data, in your alert? Could
it be that when the alert is checking the CPU utilisation, the CPU was not
really running above the threshold?
How is the alert supposed to invoke the trace? Are you using a OSQL?
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Silaphet" <kmounkhaty@.cox.net> wrote in message
news:1108700587.482182.134100@.l41g2000cwc.googlegroups.com...
Hi All,
I really need help to fix this issue. Below is what I am trying to do.
I created a trace template and script it out to be a SQL script file. I
want to run this script when CPU utilizes at over 50 or 60 or higher. I
set up an System Moniter Alert to run this script when CPU runs meet
above threshold. However, when I manipulated data in Query Analyzer to
make CPU utilize at 100% but trace script never get kick off.
The ideal task is, I wanted to capture what is running on my box when
CPU runs at 50% or higher.
Please let me know and provide me any instructions on what I'm missing.
Thanks,
Silaphet,|||Hi Vyas,
The interval was 2 for sampling data and the unit was seconds. While
the alert was running, I manipulated data to insert into a table in
millions rows from Query Analyzer. At that time, I watched the CPU and
it was 100% for at least 5 seconds to complete. I though, when CPU ran
over the threshold the alert should kick off the trace script file to
capture the SQL statements that I inserted data into table as I
explained above.
In the alert, there is a tab called "ACTION" and has option check box
says 'run this program'. I checked this option with valid path where I
store my strace script file.
Do I need to convert my trace script SQL file to be cmd or executable
file before alert can kick it of?
Please let me know what do I have to do to remedy this issue.
Thanks,
Silaphet,|||You mean, you provided a path to your .sql file where your sql commands are
stored? Then it will not work. See OSQL in SQL Server Books Online. It can
take your script file and server details as parameters and run your script
against the specified server.
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Silaphet" <kmounkhaty@.cox.net> wrote in message
news:1108736989.524985.277180@.l41g2000cwc.googlegroups.com...
Hi Vyas,
The interval was 2 for sampling data and the unit was seconds. While
the alert was running, I manipulated data to insert into a table in
millions rows from Query Analyzer. At that time, I watched the CPU and
it was 100% for at least 5 seconds to complete. I though, when CPU ran
over the threshold the alert should kick off the trace script file to
capture the SQL statements that I inserted data into table as I
explained above.
In the alert, there is a tab called "ACTION" and has option check box
says 'run this program'. I checked this option with valid path where I
store my strace script file.
Do I need to convert my trace script SQL file to be cmd or executable
file before alert can kick it of?
Please let me know what do I have to do to remedy this issue.
Thanks,
Silaphet,|||Vyas,
Let me explain to you clearly now. I have 2 files name below:
1. RunOSQL.SQL
This file has this OSQL syntax below
"OSQL -Sserver\Instance -Usa -Ppassword -iInputfile
The RunOSQL.SQL file is the file I provide the with a valid path on
the Action tab of alert.
2. The input file is the file to create trace when CPU utilization hits
over threshold
Both these files are located in C drive.
But when I inserted millions rows into a temp table the CPU ran at 100%
and the script never get executed. I think, I have to make this SQL
script to be a cmd, exe or bat file before it can call another script
to get executed.
Please let me know what I am missing now.
Thanks,
Silaphet,|||Name the file containing the OSQL.EXE call as a .BAT file. For example,
RunScript.bat
--
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Silaphet" <kmounkhaty@.cox.net> wrote in message
news:1108751013.930610.13850@.c13g2000cwb.googlegroups.com...
> Vyas,
> Let me explain to you clearly now. I have 2 files name below:
> 1. RunOSQL.SQL
> This file has this OSQL syntax below
> "OSQL -Sserver\Instance -Usa -Ppassword -iInputfile
> The RunOSQL.SQL file is the file I provide the with a valid path on
> the Action tab of alert.
> 2. The input file is the file to create trace when CPU utilization hits
> over threshold
> Both these files are located in C drive.
> But when I inserted millions rows into a temp table the CPU ran at 100%
> and the script never get executed. I think, I have to make this SQL
> script to be a cmd, exe or bat file before it can call another script
> to get executed.
>
> Please let me know what I am missing now.
> Thanks,
> Silaphet,
>
run times of SSIS package not making sense....HELP!
We have an SSIS package that was created to migrate data in from a few production databases. The steps for the package are as follows...
- backup databases on server 1 (prod database server) restore database to SSIS server (server 2) . truncate worker tables in SSIS server's (server 2) Main DB database. copy data from restored db tables to working db tables ( database to database) Start Multiple threads (15 ) and run steps from here in parrallel Combination of Data flow tasks and SQL scripts and Stored procedures used to flatten data out and combine data for reporting purposes.
The average run time is 8 hours.
the issue we are seeing is this, the package will fluctuate in run times from 4 hours to over 11 with no change in the data or the underlying SSIS package. We have looked for any changes or things that would effect this but have not found anything that changed...
Also, certain steps are running shorter while others double in time. there doesnt seem to be any rhyme or reason to this behaviour. The server is x64 12GB of RAM 2 dual core 3.2Ghz.
Please let me know if you need any more information or specifics...
the only thing I have seen so far that looks out of place is Tempdb has one of its files that is 20+GB.
Thanks,
Chris
Are you using "fast load" in your OLE DB Destination connections?|||yes we are using Fast load...
we have narrowed the actual longest running spot right now... it has been running for over 10 hours....
I had to change some of the names of Tables etc... but here is the rought outline of what the SQL task does:
|||Try asking this question in the Transact-SQL forum as it seems that's where your issue is. It doesn't look like this is an SSIS issue anymore.truncate table [Reporting].[dbo].[ReportTable]
INSERT INTO [Reporting].[dbo].[ReportTable] (pid)
SELECT DISTINCT [MainAPPDB].[dbo].[ReportTableHistory].[Client_ID]
FROM [MainAPPDB].[dbo].[ReportTableHistory]
LEFT OUTER JOIN [MainAPPDB].[dbo].[ReportTableStatus] ON [MainAPPDB].[dbo].[ReportTableStatus].[ReportTableStatusID] = [MainAPPDB].[dbo].[ReportTableHistory].[ReportTableStatusID]
LEFT OUTER JOIN [SecondAPPdb].[dbo].[tblBrokerContact] ON [SecondAPPdb].[dbo].[tblBrokerContact].[BrokerContact_ID] = [MainAPPDB].[dbo].[ReportTableHistory].[LastUpdatedBy]UPDATE [Reporting].[dbo].[ReportTable] SET rdata = X.rAsXML
FROM
(
SELECT
C.pid as 'primid',
(SELECT [MainAPPDB].[dbo].[ReportTableStatus].[Description] --varchar(25)
,CONVERT(CHAR(30),[MainAPPDB].[dbo].[ReportTableHistory].[LastUpdatedOn],100) AS [LastUpdatedOn] --varchar(30)
,[SecondAPPdb].[dbo].[tblContact].[Contact_FName] + ' ' + [SecondAPPdb].[dbo].[tblContact].[Contact_LName] AS [LastUpdatedBy] --varchar(50)
,[MainAPPDB].[dbo].[ReportTableHistory].[Reason] --varchar(300)
FROM [MainAPPDB].[dbo].[ReportTableHistory]
LEFT OUTER JOIN [MainAPPDB].[dbo].[ReportTableStatus] ON [MainAPPDB].[dbo].[ReportTableStatus].[ReportTableStatusID] = [MainAPPDB].[dbo].[ReportTableHistory].[ReportTableStatusID]
LEFT OUTER JOIN [SecondAPPdb].[dbo].[tblContact] ON [SecondAPPdb].[dbo].[tblContact].[Contact_ID] = [MainAPPDB].[dbo].[ReportTableHistory].[LastUpdatedBy]
WHERE [C_ID] = C.pid FOR XML RAW ('ReportTableHistory'), ROOT('ReportTableStatusHistories'), ELEMENTS XSINIL) as rAsXML
FROM [Reporting].[dbo].[ReportTable] C) X
WHERE X.primid = pidDECLARE @.inxml XML
DECLARE @.res XML
DECLARE @.pid INTDECLARE cur CURSOR fast_forward FOR
SELECT pid,rdata FROM [Reporting].[dbo].[ReportTable]
OPEN cur
FETCH next FROM cur INTO @.pid, @.inxml
WHILE @.@.fetch_status = 0
BEGIN
EXEC ExternFunctions_FormatReportTableHistory @.inxml, @.res OUT
UPDATE [Reporting].[dbo].[Client] SET ReportTableHistory = @.res
WHERE [Reporting].[dbo].[Client].[Client_ID] = @.pid
FETCH next FROM cur INTO @.pid,@.inxml
END
CLOSE cur
DEALLOCATE cur
http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=85&SiteID=1|||
ok I posted the question there as well..
Run time jobs
destination server. This job has the owner as windows authentication(user
account). This main job inturn creates sub jobs with owner as sa.
when i run the sub jobs from query analyser it works fine. But when ran from
sql server agent/jobs it is failing with the following error.
Msg 18456, Sev 14: Login failed for user 'CHNDomain\CHNSHL23456$'. [SQLS
TATE
28000]
Msg 7312, Sev 14: [SQLSTATE 01000].
[Note: CHNSHL23456$ is the destination system number]
when same job ran from query analyser that was logged using 'sa' account
fails with the following error.
Server: Msg 18456, Level 14, State 1, Line 1
Login failed for user 'sa'.
[OLE/DB provider returned message: Invalid connection string attribute]
The windows authenticated user ID exists in both source server/destination
server users list.
Pls hlp to get rid of this error.
Regards,
SSKSSK
Does the login have full pemissions? What is an account SQL Server Agent run
under?
"SSK" <SSK@.discussions.microsoft.com> wrote in message
news:CC9BF3BD-5394-40B1-A8E2-7D1DAC73BBA2@.microsoft.com...
>A job is created to fetch data from source server and populate the
> destination server. This job has the owner as windows authentication(user
> account). This main job inturn creates sub jobs with owner as sa.
> when i run the sub jobs from query analyser it works fine. But when ran
> from
> sql server agent/jobs it is failing with the following error.
> Msg 18456, Sev 14: Login failed for user 'CHNDomain\CHNSHL23456$'.
> [SQLSTATE
> 28000]
> Msg 7312, Sev 14: [SQLSTATE 01000].
> [Note: CHNSHL23456$ is the destination system number]
> when same job ran from query analyser that was logged using 'sa' account
> fails with the following error.
> Server: Msg 18456, Level 14, State 1, Line 1
> Login failed for user 'sa'.
> [OLE/DB provider returned message: Invalid connection string attribute
]
> The windows authenticated user ID exists in both source server/destination
> server users list.
> Pls hlp to get rid of this error.
> Regards,
> SSK
>|||What account is the SQL Agent service running under ? Jobs owned by sa will
access resources under the context of the SQL Agent service account.
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"SSK" <SSK@.discussions.microsoft.com> wrote in message
news:CC9BF3BD-5394-40B1-A8E2-7D1DAC73BBA2@.microsoft.com...
>A job is created to fetch data from source server and populate the
> destination server. This job has the owner as windows authentication(user
> account). This main job inturn creates sub jobs with owner as sa.
> when i run the sub jobs from query analyser it works fine. But when ran
> from
> sql server agent/jobs it is failing with the following error.
> Msg 18456, Sev 14: Login failed for user 'CHNDomain\CHNSHL23456$'.
> [SQLSTATE
> 28000]
> Msg 7312, Sev 14: [SQLSTATE 01000].
> [Note: CHNSHL23456$ is the destination system number]
> when same job ran from query analyser that was logged using 'sa' account
> fails with the following error.
> Server: Msg 18456, Level 14, State 1, Line 1
> Login failed for user 'sa'.
> [OLE/DB provider returned message: Invalid connection string attribute
]
> The windows authenticated user ID exists in both source server/destination
> server users list.
> Pls hlp to get rid of this error.
> Regards,
> SSK
>|||The SQL server agent is started by Local System account.
The login account has admin privileges on source and destination server als
o.
"Jasper Smith" wrote:
> What account is the SQL Agent service running under ? Jobs owned by sa wil
l
> access resources under the context of the SQL Agent service account.
> --
> HTH
> Jasper Smith (SQL Server MVP)
> http://www.sqldbatips.com
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
> "SSK" <SSK@.discussions.microsoft.com> wrote in message
> news:CC9BF3BD-5394-40B1-A8E2-7D1DAC73BBA2@.microsoft.com...
>
>|||Local System does not have access to network resources. If
you are accessing other servers, you need to use a domain
account for the service with the appropriate permissions.
-Sue
On Wed, 24 Aug 2005 23:33:09 -0700, SSK
<SSK@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>The SQL server agent is started by Local System account.
>The login account has admin privileges on source and destination server al
so.
>"Jasper Smith" wrote:
>
Run Time Database Connection
I 've created dsn for sqlserver during run time but while connecting with crystalreport it gives ODBC Error . I need to connect using CRAXDRT.Report,CRAXDRT.Application ,I'm Using vb as front end
Thanks In AdvGenerall the errors are descriptive, so please provide details on which ODBC error it is.
Dave
(Me.HomeTown = DarrenLehmann.HomeTown)
Go Aussies.|||Hi Spring soft
I solved my problem thanx for ur post|||Hi Tony,
Perhaps you could let us know the solution, for enlightenment of others.
On reflection, I suspect the report had a subreport. That's the most common reason (apart from improperly structured formulae) that raises ODBC errors.
Dave|||Ofcourse dave
Private m_crxApp As New CRAXDRT.Application
Private m_crxRep As CRAXDRT.Report
Attribute m_crxRep.VB_VarHelpID = -1
Private m_crxTab As CRAXDRT.DatabaseTable
Implements clsSimpleReport
Public Function clsSimpleReport_RunReport(sReportFileName As String, sTitle As String) As Variant
Dim i As Integer, j As Integer
On Error Resume Next
Screen.MousePointer = 11
m_crxApp.LogOnServer "p2sodbc.dll", "DSN", "DBNAME, "UID", "PWD"
Set m_crxRep = m_crxApp.OpenReport(App.Path & "\Reports\" & sReportFileName)
crvReport.ReportSource = m_crxRep
crvReport.ViewReport
End sub
My mistake was instead of p2sodbc.dll in logon server function i put some other dll file i'm not remembering that nowsql
Run the job
Another question, after i create the job, can i see the content of the job as i want to modify.Yes you can,
You just right click on the job and choose start job.
and it will run that instance and it will run again according to the schedule you have set for it.
Lystra|||Thanks, i got it. I had a question, Can i see the content of the job as this job was created long time ago, i want to modified, How can i see the content? Thanks again!|||Double click on the job, click on the step tab and double click on the step you want to see.
Lystra|||Thank, i tried to use your way to run the job once, it didn't work, i found when i create a job, it also create local package, so i have go the DTS folder then click the local package, right click the package i want to run then execute the package, then it worked, why i right the job to start the job it didn't work?|||You said a job, But if it is a DTS package you can excute it directly from the package.
As for the 'job create a local package' it's the other way around, a local packages create a job if you add a schedule.
Thanks
Lystra|||Thank you very much!
RUN SQL Stored Procedure in Access
I have a SQL stored procedure which I would like to run through Access.
This procedure has a paramert.
I created a form and by clicking a buttom I want to run this procedure but before to be able to input the parametr as well.
I am not sure if there is any way I can do this in the Access interface or wherther I have to use VBA code(which I am not familiar with)
Thank you very much.
Regards.
Pete
Quote:
Originally Posted by petr_podskubka
Hi there
I have a SQL stored procedure which I would like to run through Access.
This procedure has a paramert.
I created a form and by clicking a buttom I want to run this procedure but before to be able to input the parametr as well.
I am not sure if there is any way I can do this in the Access interface or wherther I have to use VBA code(which I am not familiar with)
Thank you very much.
Regards.
Pete
I would like to know if you would have information I trying to find information on how can I have my SQL stored procedure through Access...
Thank you for helping
|||Quote:
Originally Posted by petr_podskubka
Hi there
I have a SQL stored procedure which I would like to run through Access.
This procedure has a paramert.
I created a form and by clicking a buttom I want to run this procedure but before to be able to input the parametr as well.
I am not sure if there is any way I can do this in the Access interface or wherther I have to use VBA code(which I am not familiar with)
Thank you very much.
Regards.
Pete
it will be a little bit of both...you need the VBA to establish connection and some setting. although there are objects that can handle some of these tasks, you still might need some VBA coding to handle some stuff, ie, error handling.
|||Try this:http://archives.postgresql.org/pgsq...05/msg01260.php
Basically what it does, it changes text of your query every time you pass parameters.
The best part it is ready to use you dont need to write it yourself.
Good Luck.
Irina.|||
Quote:
Originally Posted by petr_podskubka
Hi there
I have a SQL stored procedure which I would like to run through Access.
This procedure has a paramert.
I created a form and by clicking a buttom I want to run this procedure but before to be able to input the parametr as well.
I am not sure if there is any way I can do this in the Access interface or wherther I have to use VBA code(which I am not familiar with)
Thank you very much.
Regards.
Pete
Look at ADP files in Access stored procedures are exposed in the GUI interface along with views you enter paramters for the stored procedure via the Forms Inputparameters property of the form
Regards
Jim|||
Quote:
Originally Posted by Jim Doherty
Look at ADP files in Access stored procedures are exposed in the GUI interface along with views you enter paramters for the stored procedure via the Forms Inputparameters property of the form
Regards
Jim
As I understood this question it is a pass through query that runs on SQL Server side and not on Access side.
|||Quote:
Originally Posted by iburyak
As I understood this question it is a pass through query that runs on SQL Server side and not on Access side.
Hi Iburyak,
You're probably right of course and me way off the mark at the end of the day :)... but the poster simply mentioned 'Access' and my presumption is that they might not be aware that in Access .ADP files as distinct from mdb files were intended to work directly with SQL Server. The connection method is (universal data link) automated within the interface they might want to consider their options?
Regards
Jim
Tuesday, March 20, 2012
Run scripts on multiple servers in SQL Management Studio
I have a number of scripts that I need to run on multiple servers and databases. Once I have created a Solution with them all in, how do I make them run in a specific sequence, and how can I switch the focus of the entire set of scripts to the other databases I want to run them on?
Thanks,
-Rob
There is no way to do this included in SQL Management Studio. Solutions in SMS aren't like VS solutions, in that you can execute code pages and objects. In SMS the solution is just a convenient place to store and organize the script files you are working with.
You would have to open each script seperately and execute it against the server and database you wanted in the order you wanted.
Sorry, it's going to be a manual process. There are some 3rd party tools that might help some. Check Red Gate and APEX products.
|||You can do this by using a batch file to execute either OSQL or SQLCMD (preferred) - both of which can be used to execute script files. If you pass server and database names as parameters into your batch file you can then pass the parameter values to OSQL or SQLCMD.
I don't have any examples to hand, but the following links should set you on the right track:
http://msdn2.microsoft.com/en-us/library/ms162806.aspx
http://msdn2.microsoft.com/en-us/library/ms162773.aspx
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/percent.mspx?mfr=true
This is how we deploy changes to our databases in each of our environments - the only thing that changes between each environment is the server name parameter. We generally have one batch file per database and one SQL script per database object - one batch file can be used to execute hundreds of SQL script files if need be.
Chris
|||Dan and Chris,
Thanks for your response on my question. Not the answers I was hoping to get, but thanks anyway!! I have used the DOS bat file method successfully in the the past, but it is a bit clunky and was hoping against hope that there would be a better method in the SQL management Studio. DO you think I may be looking in the wrong tool?
I can't believe that I am the only one who thinks that the lack of a tool or process to set up implementation of scripts is a serious gap in the SQL Management Studio.
Thanks again, Rob
|||You have to remember that SQL Server is an RDBMS. Tools provide for development are extras that I find invaluable. Just look at how clunky the management and development tools that come with Oracle have been over the years.
On a good note, you may be able to make some progress by developing your procedures and sql code in Visual Studio instead of SMS. If you have VS 2005 professional edition you can create a sql server database project that will allow you to write t-sql code and execute it. You should be able to write a minor application that would execute the scripts for you against a list of databases and/or servers.
Sorry that there isn't an easier way to do it through SMS. Perhaps it will be a forthcoming feature. I'll suggest it on the product feedback group.
Run scripts on multiple servers in SQL Management Studio
I have a number of scripts that I need to run on multiple servers and databases. Once I have created a Solution with them all in, how do I make them run in a specific sequence, and how can I switch the focus of the entire set of scripts to the other databases I want to run them on?
Thanks,
-Rob
There is no way to do this included in SQL Management Studio. Solutions in SMS aren't like VS solutions, in that you can execute code pages and objects. In SMS the solution is just a convenient place to store and organize the script files you are working with.
You would have to open each script seperately and execute it against the server and database you wanted in the order you wanted.
Sorry, it's going to be a manual process. There are some 3rd party tools that might help some. Check Red Gate and APEX products.
|||You can do this by using a batch file to execute either OSQL or SQLCMD (preferred) - both of which can be used to execute script files. If you pass server and database names as parameters into your batch file you can then pass the parameter values to OSQL or SQLCMD.
I don't have any examples to hand, but the following links should set you on the right track:
http://msdn2.microsoft.com/en-us/library/ms162806.aspx
http://msdn2.microsoft.com/en-us/library/ms162773.aspx
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/percent.mspx?mfr=true
This is how we deploy changes to our databases in each of our environments - the only thing that changes between each environment is the server name parameter. We generally have one batch file per database and one SQL script per database object - one batch file can be used to execute hundreds of SQL script files if need be.
Chris
|||Dan and Chris,
Thanks for your response on my question. Not the answers I was hoping to get, but thanks anyway!! I have used the DOS bat file method successfully in the the past, but it is a bit clunky and was hoping against hope that there would be a better method in the SQL management Studio. DO you think I may be looking in the wrong tool?
I can't believe that I am the only one who thinks that the lack of a tool or process to set up implementation of scripts is a serious gap in the SQL Management Studio.
Thanks again, Rob
|||You have to remember that SQL Server is an RDBMS. Tools provide for development are extras that I find invaluable. Just look at how clunky the management and development tools that come with Oracle have been over the years.
On a good note, you may be able to make some progress by developing your procedures and sql code in Visual Studio instead of SMS. If you have VS 2005 professional edition you can create a sql server database project that will allow you to write t-sql code and execute it. You should be able to write a minor application that would execute the scripts for you against a list of databases and/or servers.
Sorry that there isn't an easier way to do it through SMS. Perhaps it will be a forthcoming feature. I'll suggest it on the product feedback group.
Run Reporting services from a netwrok share
B point to the report manager on server A. I created a netwrok share on
server A and have iis pointed to this share. When I try to browse the report
manger I get:
Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.
Parser Error Message: Execution permission cannot be acquired
Is it possible to do what I am trying? Is there an easier way?No, you cannot do this. If you want to have report manager on a different
box than the database you can do that but you have to purchase an additional
license. If you want a web farm you can do that. You cannot use any network
file sharing to accomplish anything. The reason is, Report Manager is a
asp.net application. The reports do not exist as files, they are all stored
in the database (search for *.rdl on the server and you will not see any).
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"lykerd" <lykerd@.discussions.microsoft.com> wrote in message
news:775ED6F2-F21A-4DA1-A3AE-5C09A3FFA94B@.microsoft.com...
>I have reporting services installed on server A. I want to have iis on
>server
> B point to the report manager on server A. I created a netwrok share on
> server A and have iis pointed to this share. When I try to browse the
> report
> manger I get:
> Description: An error occurred during the processing of a configuration
> file
> required to service this request. Please review the specific error details
> below and modify your configuration file appropriately.
> Parser Error Message: Execution permission cannot be acquired
> Is it possible to do what I am trying? Is there an easier way?