Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««123

SQL Server PowerShell Extensions (SQLPSX) Part 2 Expand / Collapse
Author
Message
Posted Tuesday, December 09, 2008 6:53 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, April 04, 2012 10:02 PM
Points: 11, Visits: 231
The CSV files are on the server and the sql agent is using a windows account
Post #616607
Posted Tuesday, December 09, 2008 8:54 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, April 04, 2012 10:02 PM
Points: 11, Visits: 231
It seems to be a known issue..

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1565378&SiteID=1&pageid=0

It must something to do with permissions and the sql agent (although the account has local admin and is sa on the server). Ill keep looking and post any updates if I find anything.
Post #616630
Posted Wednesday, December 10, 2008 12:12 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, April 04, 2012 10:02 PM
Points: 11, Visits: 231
I have stop all sql server services, manually added sysadmin sql server role to the windows account used by the agent and restarted all sql services and it is now working.
I am not sure if that really solved the problem but it seems fine and data is correctly bulk inserted to the db! Im now going through ssrs
Thanks for your help Chad
Post #616702
Posted Monday, April 13, 2009 9:01 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, May 08, 2013 1:43 PM
Points: 3, Visits: 68
I had issues trying to run powershell from sql agent but got the following to work:

(1) use the SqlCmd in the step.
(2) created a batch file that containted the following:

REM change to the correct drive
I:
REM change to my working directory
cd \mydir
REM now call powershell script
C:\WINDOWS\SysWOW64\windowspowershell\v1.0\powershell.exe -Nologo -NoProfile -Noninteractive -Command "& 'I:\DataXfer\ssh\myscript.ps1'"

-------------------------------------------------------
NOTE: the string following the -Command
you must have a "& '\pathname_script' "
-------------------------------------------------------
Post #695872
Posted Wednesday, July 08, 2009 10:46 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, March 20, 2014 12:45 PM
Points: 50, Visits: 140
Great article!

I found that I also had to change the $StartInfo.WorkingDirectory = "" in the Run-SmoToCSVFile script. This was not mentioned in the article that I saw.
Post #749491
« Prev Topic | Next Topic »

Add to briefcase «««123

Permissions Expand / Collapse