Showing posts with label via. Show all posts
Showing posts with label via. Show all posts

Monday, March 26, 2012

Read Text file from SqlServer

Hi Frinds,

I have the text file in my server.

Is it possible to read the text file and insert into table via sql server stored procedure.

yes. You can use BCP or BULK INSERT to do the job. Refer to Books Online for more details. http://search.live.com/macros/sql_server_user_education/booksonline

Read Only permission for ReportingServices.GetPolicies()

I would like for a user to view the groups that have permssion for a
particular folder in SQL Reporting Services that they have access to via the
Web Services by calling ReportingServices.GetPolicies(). I realize
(according to MS's website and trial and error) that the user must have the
"Read Security Policies" right for that folder. The only way I have found
to set this via a Role is to allow "Set security for individual items".
Is there any way to allow a user to only view the security information via
ReportingServices.GetPolicies() without allowing them to change the security
policies?
Any help would be greatly appreciated. Thank you.
Jeremy M. WhiteWell, I found a way to do it, but I'm not really excited about it.
Currently, I am selecting directly from the SQL Reporting services database.
Again, I would prefer to do it through the web services, but I guess this
will suffice. For anyone interested, here is the SQL statement to retrieve
the policy information:
SELECT
U.UserName, U.UserType, R.RoleName, R.Description
FROM
Catalog As C INNER JOIN
PolicyUserRole As PU
ON (C.PolicyID = PU.PolicyID)
INNER JOIN
Roles As R
ON (PU.RoleID = R.RoleID)
INNER JOIN
Users As U
ON (PU.UserID = U.UserID)
WHERE
C.Path = @.ItemName
If anyone is able to determine how to provide read-only access to the
policies via a role, please let me know.
Thanks,
Jeremy
"Jeremy M. White" <jeremy_white@.dart.biz> wrote in message
news:uEkE3mbzEHA.1300@.TK2MSFTNGP14.phx.gbl...
> I would like for a user to view the groups that have permssion for a
> particular folder in SQL Reporting Services that they have access to via
the
> Web Services by calling ReportingServices.GetPolicies(). I realize
> (according to MS's website and trial and error) that the user must have
the
> "Read Security Policies" right for that folder. The only way I have found
> to set this via a Role is to allow "Set security for individual items".
> Is there any way to allow a user to only view the security information via
> ReportingServices.GetPolicies() without allowing them to change the
security
> policies?
> Any help would be greatly appreciated. Thank you.
> Jeremy M. White
>

Friday, March 23, 2012

Read file info via Transact SQL....

Hi there.
Any ideas how I could go about getting a file's "Created" date/time into a
datetime variable using T-SQL? I'm thinking along the lines of using the
results of a call to xp_cmdshell but as to what command I should call...
well...
Any help would be appreciated!Sure you can use any DOS command via xp_cmdshell. Here is a rough example
of reading datetimes.
CREATE TABLE #dirlist (FName VARCHAR(1000))
-- Insert the results of the dir cmd into a table so we can scan it
INSERT INTO #dirlist (FName)
exec master..xp_cmdshell 'dir /OD C:\Backups\*.trn'
-- Remove the garbage
DELETE #dirlist WHERE
SUBSTRING(FName,1,2) < '00' OR
SUBSTRING(FName,1,2) > '99' OR
FName IS NULL
SELECT SUBSTRING(FName,40,40) AS FName
FROM #dirlist
WHERE CAST(SUBSTRING(FName,1,20) AS DATETIME) < @.DelDate
AND SUBSTRING(FName,40,40) LIKE '%.TRN'
Andrew J. Kelly SQL MVP
"len" <len@.discussions.microsoft.com> wrote in message
news:74125E9D-6E97-46FE-855C-CA2913135FE3@.microsoft.com...
> Hi there.
> Any ideas how I could go about getting a file's "Created" date/time into a
> datetime variable using T-SQL? I'm thinking along the lines of using the
> results of a call to xp_cmdshell but as to what command I should call...
> well...
> Any help would be appreciated!|||Rather than placing this functionality in a stored procedure, consider a DTS
package and VBScript task.
http://msdn.microsoft.com/library/d...
flow_0793.asp
http://www.sqldts.com/?246
http://msdn.microsoft.com/library/d...efc4b9f49c7.asp
"len" <len@.discussions.microsoft.com> wrote in message
news:74125E9D-6E97-46FE-855C-CA2913135FE3@.microsoft.com...
> Hi there.
> Any ideas how I could go about getting a file's "Created" date/time into a
> datetime variable using T-SQL? I'm thinking along the lines of using the
> results of a call to xp_cmdshell but as to what command I should call...
> well...
> Any help would be appreciated!sql

Wednesday, March 21, 2012

'read' audit

Is there any way to identify which records in a SQL database were 'read'
and by whom? Thanks.
Message posted via http://www.droptable.comBy "read", do you mean returned by a query or involved in a query
computation? Even in a modestly large system, that could be tens of millions
of rows per day. That said, there is perhaps a method to extract this
information from a SQL Profiler event.
"Carolyn via droptable.com" <forum@.droptable.com> wrote in message
news:c8ba5f4b6213454d88acc5502db49860@.SQ
droptable.com...
> Is there any way to identify which records in a SQL database were 'read'
> and by whom? Thanks.
> --
> Message posted via http://www.droptable.com

'read' audit

Is there any way to identify which records in a SQL database were 'read'
and by whom? Thanks.
Message posted via http://www.sqlmonster.com
By "read", do you mean returned by a query or involved in a query
computation? Even in a modestly large system, that could be tens of millions
of rows per day. That said, there is perhaps a method to extract this
information from a SQL Profiler event.
"Carolyn via SQLMonster.com" <forum@.SQLMonster.com> wrote in message
news:c8ba5f4b6213454d88acc5502db49860@.SQLMonster.c om...
> Is there any way to identify which records in a SQL database were 'read'
> and by whom? Thanks.
> --
> Message posted via http://www.sqlmonster.com

Friday, March 9, 2012

RDL vs RDLC

My application is a large windows form app that connects to databases via webservice. The client has no ability to get to the SQL Server. Do I even have an option of using Reporting Services, or do I have to use client deployed reports in RDLC files and pass it a dataset? If so, what are the advantages of using SSRS?

I don't have a problem with this method, since it is pretty much identical to what we do with Crystal Reports, but I want to make sure I understand the alternatives.

Thanks

The FAQ section about the ReportViewer controls may be helpful (e.g. #8): http://www.gotreportviewer.com/

-- Robert

RDL Database Location

I am now supporting a previously installed copy of RS 2000.
RS was installed on ServerA which the users access via browser to
render the reports. The RDLs however are located in a SQL DB
on ServerB.
After much searching around I finally found the RDL server\DB but this
was after having no luck trying to determine this from the RS config
installed on ServerA. I checked the registry and all the config files under
the \Program Files\Microsoft SQL Server folder. Where is the RDL
server info maintained?
Thanks and Happy New Year to All!!Use WMI. There is an example here
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSUIREF/htm/f1_rsc_help_v1_3ddc.asp?frame=true
--
HTH,
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
"Mike Harbinger" <MikeH@.Cybervillage.net> wrote in message
news:uj74zY0DGHA.3916@.TK2MSFTNGP10.phx.gbl...
>I am now supporting a previously installed copy of RS 2000.
> RS was installed on ServerA which the users access via browser to
> render the reports. The RDLs however are located in a SQL DB
> on ServerB.
> After much searching around I finally found the RDL server\DB but this
> was after having no luck trying to determine this from the RS config
> installed on ServerA. I checked the registry and all the config files
> under
> the \Program Files\Microsoft SQL Server folder. Where is the RDL
> server info maintained?
> Thanks and Happy New Year to All!!
>
>|||I don't see any reference to this any any of the items discussed?
"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:O$iSKI7DGHA.620@.TK2MSFTNGP11.phx.gbl...
> Use WMI. There is an example here
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSUIREF/htm/f1_rsc_help_v1_3ddc.asp?frame=true
> --
> HTH,
> Jasper Smith (SQL Server MVP)
> http://www.sqldbatips.com
>
> "Mike Harbinger" <MikeH@.Cybervillage.net> wrote in message
> news:uj74zY0DGHA.3916@.TK2MSFTNGP10.phx.gbl...
>>I am now supporting a previously installed copy of RS 2000.
>> RS was installed on ServerA which the users access via browser to
>> render the reports. The RDLs however are located in a SQL DB
>> on ServerB.
>> After much searching around I finally found the RDL server\DB but this
>> was after having no luck trying to determine this from the RS config
>> installed on ServerA. I checked the registry and all the config files
>> under
>> the \Program Files\Microsoft SQL Server folder. Where is the RDL
>> server info maintained?
>> Thanks and Happy New Year to All!!
>>
>|||If you compile and run the code sample you'll see one of the properties
returned from the MSReportServer_ConfigurationSetting instance is the
DatabaseServerName which is what I believe you were asking about? A cut down
version for that specific property is below
string servername = "servername"; // change this to your RS servername
string WmiNamespace = @."\\" + servername +
@."\root\Microsoft\SqlServer\ReportingServices\v8";
string WmiRSClass = @."\\" + servername +
@."\root\Microsoft\SqlServer\ReportingServices\v8:MSReportServer_ConfigurationSetting";
ManagementClass serverClass;
ManagementScope scope;
scope = new ManagementScope(WmiNamespace);
scope.Connect();
serverClass = new ManagementClass(WmiRSClass);
serverClass.Get();
if (serverClass == null)
throw new Exception("No class found");
ManagementObjectCollection instances = serverClass.GetInstances();
foreach(ManagementObject instance in instances)
{
Console.Out.WriteLine("Instance Detected");
PropertyDataCollection instProps = instance.Properties;
foreach(PropertyData prop in instProps)
{
if(prop.Name == "DatabaseServerName")
{
string name = prop.Name;
object val = prop.Value;
Console.Out.Write("Property Name: " + name);
if (val != null)
Console.Out.WriteLine(" Value: " + val.ToString());
else
Console.Out.WriteLine(" Value: <null>");
}
}
}
Console.WriteLine("");
Console.WriteLine("Press any key to exit....");
Console.ReadLine();
--
HTH,
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
"Mike Harbinger" <MikeH@.Cybervillage.net> wrote in message
news:%23weMuK8DGHA.1976@.TK2MSFTNGP10.phx.gbl...
>I don't see any reference to this any any of the items discussed?
>
> "Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
> news:O$iSKI7DGHA.620@.TK2MSFTNGP11.phx.gbl...
>> Use WMI. There is an example here
>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSUIREF/htm/f1_rsc_help_v1_3ddc.asp?frame=true
>> --
>> HTH,
>> Jasper Smith (SQL Server MVP)
>> http://www.sqldbatips.com
>>
>> "Mike Harbinger" <MikeH@.Cybervillage.net> wrote in message
>> news:uj74zY0DGHA.3916@.TK2MSFTNGP10.phx.gbl...
>>I am now supporting a previously installed copy of RS 2000.
>> RS was installed on ServerA which the users access via browser to
>> render the reports. The RDLs however are located in a SQL DB
>> on ServerB.
>> After much searching around I finally found the RDL server\DB but this
>> was after having no luck trying to determine this from the RS config
>> installed on ServerA. I checked the registry and all the config files
>> under
>> the \Program Files\Microsoft SQL Server folder. Where is the RDL
>> server info maintained?
>> Thanks and Happy New Year to All!!
>>
>>
>|||Thanks Jasper, but I an not a .NET programmer. I assumed that this was
exposed at a higher level either in the the GUI tools, config files or
registry. If not, could I impose on you as to how I might go about compiling
this?
"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:uB7ZEG9DGHA.128@.TK2MSFTNGP10.phx.gbl...
> If you compile and run the code sample you'll see one of the properties
> returned from the MSReportServer_ConfigurationSetting instance is the
> DatabaseServerName which is what I believe you were asking about? A cut
> down version for that specific property is below
> string servername = "servername"; // change this to your RS servername
> string WmiNamespace = @."\\" + servername +
> @."\root\Microsoft\SqlServer\ReportingServices\v8";
> string WmiRSClass = @."\\" + servername +
> @."\root\Microsoft\SqlServer\ReportingServices\v8:MSReportServer_ConfigurationSetting";
> ManagementClass serverClass;
> ManagementScope scope;
> scope = new ManagementScope(WmiNamespace);
> scope.Connect();
> serverClass = new ManagementClass(WmiRSClass);
> serverClass.Get();
> if (serverClass == null)
> throw new Exception("No class found");
> ManagementObjectCollection instances = serverClass.GetInstances();
> foreach(ManagementObject instance in instances)
> {
> Console.Out.WriteLine("Instance Detected");
> PropertyDataCollection instProps = instance.Properties;
> foreach(PropertyData prop in instProps)
> {
> if(prop.Name == "DatabaseServerName")
> {
> string name = prop.Name;
> object val = prop.Value;
> Console.Out.Write("Property Name: " + name);
> if (val != null)
> Console.Out.WriteLine(" Value: " + val.ToString());
> else
> Console.Out.WriteLine(" Value: <null>");
> }
> }
> }
> Console.WriteLine("");
> Console.WriteLine("Press any key to exit....");
> Console.ReadLine();
> --
> HTH,
> Jasper Smith (SQL Server MVP)
> http://www.sqldbatips.com
>
> "Mike Harbinger" <MikeH@.Cybervillage.net> wrote in message
> news:%23weMuK8DGHA.1976@.TK2MSFTNGP10.phx.gbl...
>>I don't see any reference to this any any of the items discussed?
>>
>> "Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
>> news:O$iSKI7DGHA.620@.TK2MSFTNGP11.phx.gbl...
>> Use WMI. There is an example here
>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSUIREF/htm/f1_rsc_help_v1_3ddc.asp?frame=true
>> --
>> HTH,
>> Jasper Smith (SQL Server MVP)
>> http://www.sqldbatips.com
>>
>> "Mike Harbinger" <MikeH@.Cybervillage.net> wrote in message
>> news:uj74zY0DGHA.3916@.TK2MSFTNGP10.phx.gbl...
>>I am now supporting a previously installed copy of RS 2000.
>> RS was installed on ServerA which the users access via browser to
>> render the reports. The RDLs however are located in a SQL DB
>> on ServerB.
>> After much searching around I finally found the RDL server\DB but this
>> was after having no luck trying to determine this from the RS config
>> installed on ServerA. I checked the registry and all the config files
>> under
>> the \Program Files\Microsoft SQL Server folder. Where is the RDL
>> server info maintained?
>> Thanks and Happy New Year to All!!
>>
>>
>>
>|||Hi Mike,
I have uploaded a sample project to
http://www.sqldbatips.com/samples/code/RSWMIConfig.zip
If you have Visual Studio 2003 installed just open the project, fill in the
servername and press F5 to run it. If you don't have it installed then just
grab the RSWMIConfig.exe out of the \bin\Debug folder. Open a command prompt
to the folder where the exe is and run it supplying the servername as an
argument e.g.
C:\>RSWMIConfig.exe servername
--
HTH,
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
"Mike Harbinger" <MikeH@.Cybervillage.net> wrote in message
news:ukyqFr$DGHA.3820@.TK2MSFTNGP12.phx.gbl...
> Thanks Jasper, but I an not a .NET programmer. I assumed that this was
> exposed at a higher level either in the the GUI tools, config files or
> registry. If not, could I impose on you as to how I might go about
> compiling this?
> "Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
> news:uB7ZEG9DGHA.128@.TK2MSFTNGP10.phx.gbl...
>> If you compile and run the code sample you'll see one of the properties
>> returned from the MSReportServer_ConfigurationSetting instance is the
>> DatabaseServerName which is what I believe you were asking about? A cut
>> down version for that specific property is below
>> string servername = "servername"; // change this to your RS servername
>> string WmiNamespace = @."\\" + servername +
>> @."\root\Microsoft\SqlServer\ReportingServices\v8";
>> string WmiRSClass = @."\\" + servername +
>> @."\root\Microsoft\SqlServer\ReportingServices\v8:MSReportServer_ConfigurationSetting";
>> ManagementClass serverClass;
>> ManagementScope scope;
>> scope = new ManagementScope(WmiNamespace);
>> scope.Connect();
>> serverClass = new ManagementClass(WmiRSClass);
>> serverClass.Get();
>> if (serverClass == null)
>> throw new Exception("No class found");
>> ManagementObjectCollection instances = serverClass.GetInstances();
>> foreach(ManagementObject instance in instances)
>> {
>> Console.Out.WriteLine("Instance Detected");
>> PropertyDataCollection instProps = instance.Properties;
>> foreach(PropertyData prop in instProps)
>> {
>> if(prop.Name == "DatabaseServerName")
>> {
>> string name = prop.Name;
>> object val = prop.Value;
>> Console.Out.Write("Property Name: " + name);
>> if (val != null)
>> Console.Out.WriteLine(" Value: " + val.ToString());
>> else
>> Console.Out.WriteLine(" Value: <null>");
>> }
>> }
>> }
>> Console.WriteLine("");
>> Console.WriteLine("Press any key to exit....");
>> Console.ReadLine();
>> --
>> HTH,
>> Jasper Smith (SQL Server MVP)
>> http://www.sqldbatips.com
>>
>> "Mike Harbinger" <MikeH@.Cybervillage.net> wrote in message
>> news:%23weMuK8DGHA.1976@.TK2MSFTNGP10.phx.gbl...
>>I don't see any reference to this any any of the items discussed?
>>
>> "Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
>> news:O$iSKI7DGHA.620@.TK2MSFTNGP11.phx.gbl...
>> Use WMI. There is an example here
>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSUIREF/htm/f1_rsc_help_v1_3ddc.asp?frame=true
>> --
>> HTH,
>> Jasper Smith (SQL Server MVP)
>> http://www.sqldbatips.com
>>
>> "Mike Harbinger" <MikeH@.Cybervillage.net> wrote in message
>> news:uj74zY0DGHA.3916@.TK2MSFTNGP10.phx.gbl...
>>I am now supporting a previously installed copy of RS 2000.
>> RS was installed on ServerA which the users access via browser to
>> render the reports. The RDLs however are located in a SQL DB
>> on ServerB.
>> After much searching around I finally found the RDL server\DB but this
>> was after having no luck trying to determine this from the RS config
>> installed on ServerA. I checked the registry and all the config files
>> under
>> the \Program Files\Microsoft SQL Server folder. Where is the RDL
>> server info maintained?
>> Thanks and Happy New Year to All!!
>>
>>
>>
>>
>|||Jasper
Thanks for your help on this but I cannot find
RSWMIConfig.exe anywhere on the machine
hosting RS report manager nor on my machine
which has Visual Studio .Net 2003 installed.
I do have RSConfig.exe but it does not handle that
argument.
Mike
"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:OiiOBkJEGHA.2648@.TK2MSFTNGP11.phx.gbl...
> Hi Mike,
> I have uploaded a sample project to
> http://www.sqldbatips.com/samples/code/RSWMIConfig.zip
> If you have Visual Studio 2003 installed just open the project, fill in
> the servername and press F5 to run it. If you don't have it installed then
> just grab the RSWMIConfig.exe out of the \bin\Debug folder. Open a command
> prompt to the folder where the exe is and run it supplying the servername
> as an argument e.g.
> C:\>RSWMIConfig.exe servername
> --
> HTH,
> Jasper Smith (SQL Server MVP)
> http://www.sqldbatips.com
>
> "Mike Harbinger" <MikeH@.Cybervillage.net> wrote in message
> news:ukyqFr$DGHA.3820@.TK2MSFTNGP12.phx.gbl...
>> Thanks Jasper, but I an not a .NET programmer. I assumed that this was
>> exposed at a higher level either in the the GUI tools, config files or
>> registry. If not, could I impose on you as to how I might go about
>> compiling this?
>> "Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
>> news:uB7ZEG9DGHA.128@.TK2MSFTNGP10.phx.gbl...
>> If you compile and run the code sample you'll see one of the properties
>> returned from the MSReportServer_ConfigurationSetting instance is the
>> DatabaseServerName which is what I believe you were asking about? A cut
>> down version for that specific property is below
>> string servername = "servername"; // change this to your RS servername
>> string WmiNamespace = @."\\" + servername +
>> @."\root\Microsoft\SqlServer\ReportingServices\v8";
>> string WmiRSClass = @."\\" + servername +
>> @."\root\Microsoft\SqlServer\ReportingServices\v8:MSReportServer_ConfigurationSetting";
>> ManagementClass serverClass;
>> ManagementScope scope;
>> scope = new ManagementScope(WmiNamespace);
>> scope.Connect();
>> serverClass = new ManagementClass(WmiRSClass);
>> serverClass.Get();
>> if (serverClass == null)
>> throw new Exception("No class found");
>> ManagementObjectCollection instances = serverClass.GetInstances();
>> foreach(ManagementObject instance in instances)
>> {
>> Console.Out.WriteLine("Instance Detected");
>> PropertyDataCollection instProps = instance.Properties;
>> foreach(PropertyData prop in instProps)
>> {
>> if(prop.Name == "DatabaseServerName")
>> {
>> string name = prop.Name;
>> object val = prop.Value;
>> Console.Out.Write("Property Name: " + name);
>> if (val != null)
>> Console.Out.WriteLine(" Value: " + val.ToString());
>> else
>> Console.Out.WriteLine(" Value: <null>");
>> }
>> }
>> }
>> Console.WriteLine("");
>> Console.WriteLine("Press any key to exit....");
>> Console.ReadLine();
>> --
>> HTH,
>> Jasper Smith (SQL Server MVP)
>> http://www.sqldbatips.com
>>
>> "Mike Harbinger" <MikeH@.Cybervillage.net> wrote in message
>> news:%23weMuK8DGHA.1976@.TK2MSFTNGP10.phx.gbl...
>>I don't see any reference to this any any of the items discussed?
>>
>> "Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
>> news:O$iSKI7DGHA.620@.TK2MSFTNGP11.phx.gbl...
>> Use WMI. There is an example here
>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSUIREF/htm/f1_rsc_help_v1_3ddc.asp?frame=true
>> --
>> HTH,
>> Jasper Smith (SQL Server MVP)
>> http://www.sqldbatips.com
>>
>> "Mike Harbinger" <MikeH@.Cybervillage.net> wrote in message
>> news:uj74zY0DGHA.3916@.TK2MSFTNGP10.phx.gbl...
>>I am now supporting a previously installed copy of RS 2000.
>> RS was installed on ServerA which the users access via browser to
>> render the reports. The RDLs however are located in a SQL DB
>> on ServerB.
>> After much searching around I finally found the RDL server\DB but
>> this
>> was after having no luck trying to determine this from the RS config
>> installed on ServerA. I checked the registry and all the config files
>> under
>> the \Program Files\Microsoft SQL Server folder. Where is the RDL
>> server info maintained?
>> Thanks and Happy New Year to All!!
>>
>>
>>
>>
>>
>

Saturday, February 25, 2012

RDA pull - from a temporary table

Hi

I am doing a RDA Pull with tracking off, getting the data via a stored procedure.

Ideally I want the proc to return the data from a temporary table, so I can do some fancy formatting of the data before we pull it down to the PDA. It's not updateable, so with tracking off, I would have thought this would be possible - but sadly it doesn't work. No error messages, but the table doesn't get created.

I'm using SQL 2005 June CTP if that helps.

Any ideas ?

thanks
Bruce

Here are the details we want:
1) Where is this Store Proc executed and how?

Note: SQL Mobile does not support stored procs in its Database. However you can use RDA.SubmitSql to execute a stored proc, available in SQL Server DB, on SQL Server remotely from SQL Mobile device.

2) SQL Statement in "RDA.Pull" command can only be some thing like
"SELECT col1, col2, col3 from testTable where col4 = 'TEST'".

It CANNOT be some thing like
"Execute sp_createformattedtemptable testTable".

If you want to acheive the functionality you are mentionig, you can do this way:
Before you do RDA Pull, do a RDA Submit SQL and execute store proc. This store proc should create a table with the expected data in expected format. Then use RDA Pull to pull the table down to SQL Mobile device. And, then do RDA Submit SQL to delete the just created temp table.

Hope this helps!

Thanks,
Laxmi NRO, MSFT, SQL Mobile