>I am working on a script to create a database in SQL Server 2008. The script includes the creation of UDFs, and at least one of those contains a "?" in the UDF. Since SQLDMO is apparently gone, I am working on using SQLExec() to execute the script. The problem is that SQLExec() is interpreting the "?" as a parameter (and prompting for a value) when it is not. Is there anyway to tell SQLExec() to ignore anything it interprets as a parameter?
>
>Thanks.
I used xp_cmdshell to execute a script, which would create complete database on the server. By default xp_cmdShell is disabled (I think). You have to enable it on your SQL Server.
For security reasons it is not recommended to keep this feature enabled all the time.
lcCommand=[EXEC master..xp_cmdshell 'osql -S ]+[Your Server Name]+[ -d ]+[DataBase Name]+[ -E -i ]+[ScriptName]+[ -n']
lr = SQLEXEC(nHandle, lcCommand) &&& nHandle - connection handle
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only