Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Create Database Error

Author  Topic 

poser
Posting Yak Master

124 Posts

Posted - 2009-01-06 : 13:24:30
Does anyone see anything wrong with this Create Database Statement:

*** CREATE THE DATABASE WITH THE DEFAULT VALUES & PATH
*/
SET @svStatement ='CREATE DATABASE ' + @svDBName + ' ON ( NAME = ''' + @svDBName + '_Dat'', FILENAME = ''' + @svDBFilePath + @svDBName + '.mdf'', SIZE = 30MB) LOG ON ( NAME = ''' + @svDBName + '_Log'', FILENAME = ''' + @svDBFilePath + @svDBName + '_log.ldf'', SIZE = 10MB)'
EXECUTE sp_executesql @svStatement


I get the Error Message:

The VB Application identified by the event source logged this Application Infosilem Encampus - Suite Manager: Thread ID: 1284 ,Logged: -2147148903 I:\Data\,Database path is invalid (7065) : Source : CClientIClient_CreateDatabase

When I do a run I:\Data the path is correct. Is there an extra comma in my command somewhere cause in the error message it is I:\Data\,

Or do you seen anything else in the Error message that might give me a clue?

And I do have sa priveledges.

Thanks for ALL of your help...
R/P

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-01-06 : 13:26:49
Could you run this after the SET: PRINT @svStatement? Post the output of the PRINT command please.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -