The Run as Script option allows you to insert SQL statements that have special identifiers that are automatically replaced by your SQL data provider. These identifiers are defined in the web.config file under dotnetnuke > data > providers . By default, this section will look like this:
<data defaultProvider="SqlDataProvider"> <providers> <clear/> <add name="SqlDataProvider" type="DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider" connectionStringName="SiteSqlServer" upgradeConnectionString="" providerPath="~\Providers\DataProviders\SqlDataProvider\" objectQualifier="" databaseOwner="dbo"/> </providers> </data>
Pay attention to the attributes objectQualifier and databaseOwner ? If you insert an SQL statement into the Host> SQL field containing {objectQualifer} and / or {databaseOwner}, these values ββwill automatically be replaced with the values ββfor the above attributes.
So, let's say you paste the following SQL statement into this field with the "Run as Script" checkbox:
CREATE TABLE {databaseOwner}[{objectQualifier}Cars]
Assuming we use the values ββin the above web.config snippet, the SQL statement that will be executed will look like this:
CREATE TABLE [dbo][Cars]
source share