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

creating SQL Server 2005 database from powershell function Expand / Collapse
Author
Message
Posted Tuesday, December 08, 2009 9:58 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, December 17, 2012 4:21 PM
Points: 74, Visits: 316
I misposted this topic in the SQL Server development forum before I knew this forum existed.

I have developed a powershell script to install databases and database objects (procedures, functions, etc). The script allows the user to pass in a directory and request that the database be created at that location. What I want to do is validate that the user has permissions to create the database at that location. I have checks that validate the passed location is a directory, but I can not figure out to validate that SQL Server is allowed to created the database files in the requested file system location.
Post #830806
Posted Saturday, February 20, 2010 8:13 PM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: 2 days ago @ 6:19 AM
Points: 3,833, Visits: 4,052
The following articles describe how to create a Database using Powershell:

http://arcware.net/creating-a-sql-server-database-from-powershell/

http://sqlblog.com/blogs/allen_white/archive/2008/04/28/create-database-from-powershell.aspx


For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

Post #869743
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse