Showing posts with label procedure. Show all posts
Showing posts with label procedure. Show all posts

Friday, March 30, 2012

Reading a text file from a stored procedure.

A rookie question - all I want to do is open a text file x.txt and read each line - no bcp or bulk insert required.
Is there a simple way to do this ?
Thanks in advance to all who reply !Not with ANSI-92 syntax. You'd have to use specific DBMS extensions for it. Pick the engine (Oracle, SQL Server, UDB, etc.) and post accordingly.|||I am using SQL Server 7.0.

I know how to do this in Oracle using the DBMS functions. Are there similar functions in MSSQL ?

Thanks for your reply !|||I use sp_OAxxx with FileSystemObject.|||Originally posted by BrutusBuckeye
I am using SQL Server 7.0.

I know how to do this in Oracle using the DBMS functions. Are there similar functions in MSSQL ?

Thanks for your reply ! In my opinion, this is one of the fundamental design flaws in Oracle. They are attempting to make PL/SQL a programming language instead of a data[base] manipulation language.

If you stop and think about it, reading text the way that you want to do it is a client side activity. Using BCP or BULK INSERT are server side activities. There is a fundamental difference between them (which machine the code actually runs on)!

Any solution you find for MS-SQL will involve server side activity. Sybase (now Microsoft) never intended for Transact-SQL scripts to run on the client, they always assumed that those Transact-SQL scripts would run on the server. That is exactly why user interface code, file access, etc are absent from Transact-SQL... The absence is by design.

Using Microsoft Transact-SQL, you'll need to either adopt a server centric point of view, or write your client side code using the client language. There is a clear distinction between the client and server in Transact-SQL.

-PatP|||BrutusBuckeye, Pat has a very strong opinion about all this ;)

I'd still use sp_OAxxx if you insist on reading a text file one line at a time, but why bother? Use BULK INSERT and then deal with it in a recordset-based fashion!|||UNCLE !!!! :)

Thanks for all your help. I am indeed going the Bulk Insert route.

Thanks again from the school of hard knocks.. :)|||Originally posted by rdjabarov
BrutusBuckeye, Pat has a very strong opinion about all this ;) Dang! Did I let that secret out again ?!?!

-PatP

Reading a long string

Hi there,
How can i see what a long string value is? I have a stored procedure which
creates a dynamic xml string and when i select it at the end of the SP the
result is about 100 chars long although i know it is about 7000 long and I
need to inspect the whole string, put it in an xml reader interface etc to
play around with. Even if i send the result to file, it is still truncated.
How can I read the whole string?
thanksWhat version of SQL are you using? XML data needs an XML client.
In SQL 2005 there's a built-in reader, that can display the XML in humanly
readable form, but for SQL 2000 you'd need a client application - look into
using SQLXML.
ML
http://milambda.blogspot.com/|||"louise raisbeck" <louiseraisbeck@.discussions.microsoft.com> wrote in
message news:B8A6F36D-818D-44AB-A992-95744A9E1056@.microsoft.com...
> Hi there,
> How can i see what a long string value is? I have a stored procedure which
> creates a dynamic xml string and when i select it at the end of the SP the
> result is about 100 chars long although i know it is about 7000 long and I
> need to inspect the whole string, put it in an xml reader interface etc to
> play around with. Even if i send the result to file, it is still
> truncated.
> How can I read the whole string?
> thanks
If this is SQL 2k and you are using Query Analyser, ensure that you have
set your results length long enough.
Look at Tools->Options Choose Results tab, then put 8000 in the box for
Maximum Characters Per Column
Rick Sawtell
MCT, MCSD, MCDBA|||THANKS!!! i didnt realise you could set this option.
In response to ML - I am creating my own custom xml string. I wont go into
reasons but in a nutshell it is completely dynamic, not as simple as return
this resultset as xml. I then use that as an xml datasource in a .net page.
Regards
"Rick Sawtell" wrote:

> "louise raisbeck" <louiseraisbeck@.discussions.microsoft.com> wrote in
> message news:B8A6F36D-818D-44AB-A992-95744A9E1056@.microsoft.com...
> If this is SQL 2k and you are using Query Analyser, ensure that you have
> set your results length long enough.
> Look at Tools->Options Choose Results tab, then put 8000 in the box for
> Maximum Characters Per Column
>
> Rick Sawtell
> MCT, MCSD, MCDBA
>
>

re-adding a removed extended stored procedure

Hi everyone,
I have recently remove few extended stored procedure on a sql server 2000
sp4 as part of our sql lockdown, including 'xp_getnetname'. When I try to
schedule a DTS job, it get the following error msg:
"Cannot find the function xp_getnetname in the library 'xplog70.dll'. Reason
127"...
I have added xp_getnetname (successfully!) using:
EXEC sp_addextendedproc 'xp_getnetname' ,'xplog70.dll'
BUT i still get the same error message. I am ABLE to use "sp_helptext
xp_getnetname" which gives me "xplog70.dll" as the output but I don't know
why I cannot execute it.
Thanks
"I saw it work in a cartoon once so I am pretty sure I can do it."Found the problem, the SP is in the xpstar.dll
--
Senior DBA
MSc in CS, MCSE4, IBM Certified MQ 5.3 Administrator
"I saw it work in a cartoon once so I am pretty sure I can do it."
"Sas" wrote:

> Hi everyone,
> I have recently remove few extended stored procedure on a sql server 2000
> sp4 as part of our sql lockdown, including 'xp_getnetname'. When I try to
> schedule a DTS job, it get the following error msg:
> "Cannot find the function xp_getnetname in the library 'xplog70.dll'. Reas
on
> 127"...
> I have added xp_getnetname (successfully!) using:
> EXEC sp_addextendedproc 'xp_getnetname' ,'xplog70.dll'
> BUT i still get the same error message. I am ABLE to use "sp_helptext
> xp_getnetname" which gives me "xplog70.dll" as the output but I don't know
> why I cannot execute it.
> Thanks
> --
> "I saw it work in a cartoon once so I am pretty sure I can do it."

Wednesday, March 28, 2012

read usergroup for a username with stored procedure

Hi

I wounder if there is a sp in the master db that can give me what usergroup a username is connected to / and or give me info if the username is valid (Windows NT login).

If not: then how do I read what usergroup a username is connected to? sysxlogin table in master db? And can I connect to a sp in master db from another db? Can I create a sp in my db that reads in the master db?

Thanks!!

Best Regards

Staffan

Yes, sp_helpuser

As long as your login has privileges to run system procedures in the master database, you will be able to run the procedure from any database (SQL Server always checks the master database if the procedure starts with sp_ )

sql

Read Uncommitted

Stored procedure is causing blocking. Stored procedure only reads.
We add :
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
to the stored procedure and the blocking has gone down and I'm addressing a
similar problem with other stored procedures. I know the whole "dirty read"
thing and I'm not sure how likely that is...but is there anything else we
should be aware of while using this statement?
Thanks
Apart from the obvious, doing dirty read you risk getting inconsistent data:
You can get false data corruption messages. Like reading the data while "physically" in flux. Just
don't worry about them. If you see them, and want to handle it, just re-try.
Also, if on 2005, consider using any of the snapshot isolation modes. But make sure you read up on
the consequences first.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"jason7655" <jason7655@.discussions.microsoft.com> wrote in message
news:5DEC3C93-73F8-4F24-B264-2018B423C8F4@.microsoft.com...
> Stored procedure is causing blocking. Stored procedure only reads.
> We add :
> SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
> to the stored procedure and the blocking has gone down and I'm addressing a
> similar problem with other stored procedures. I know the whole "dirty read"
> thing and I'm not sure how likely that is...but is there anything else we
> should be aware of while using this statement?
> Thanks
|||See http://sqlblogcasts.com/blogs/tonyrogerson/archive/2006/11/10/1280.aspx
..
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)
"jason7655" <jason7655@.discussions.microsoft.com> wrote in message
news:5DEC3C93-73F8-4F24-B264-2018B423C8F4@.microsoft.com...
> Stored procedure is causing blocking. Stored procedure only reads.
> We add :
> SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
> to the stored procedure and the blocking has gone down and I'm addressing
> a
> similar problem with other stored procedures. I know the whole "dirty
> read"
> thing and I'm not sure how likely that is...but is there anything else we
> should be aware of while using this statement?
> Thanks
sql

Read Uncommitted

Stored procedure is causing blocking. Stored procedure only reads.
We add :
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
to the stored procedure and the blocking has gone down and I'm addressing a
similar problem with other stored procedures. I know the whole "dirty read"
thing and I'm not sure how likely that is...but is there anything else we
should be aware of while using this statement?
ThanksApart from the obvious, doing dirty read you risk getting inconsistent data:
You can get false data corruption messages. Like reading the data while "physically" in flux. Just
don't worry about them. If you see them, and want to handle it, just re-try.
Also, if on 2005, consider using any of the snapshot isolation modes. But make sure you read up on
the consequences first.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"jason7655" <jason7655@.discussions.microsoft.com> wrote in message
news:5DEC3C93-73F8-4F24-B264-2018B423C8F4@.microsoft.com...
> Stored procedure is causing blocking. Stored procedure only reads.
> We add :
> SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
> to the stored procedure and the blocking has gone down and I'm addressing a
> similar problem with other stored procedures. I know the whole "dirty read"
> thing and I'm not sure how likely that is...but is there anything else we
> should be aware of while using this statement?
> Thanks|||See http://sqlblogcasts.com/blogs/tonyrogerson/archive/2006/11/10/1280.aspx
.
--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)
"jason7655" <jason7655@.discussions.microsoft.com> wrote in message
news:5DEC3C93-73F8-4F24-B264-2018B423C8F4@.microsoft.com...
> Stored procedure is causing blocking. Stored procedure only reads.
> We add :
> SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
> to the stored procedure and the blocking has gone down and I'm addressing
> a
> similar problem with other stored procedures. I know the whole "dirty
> read"
> thing and I'm not sure how likely that is...but is there anything else we
> should be aware of while using this statement?
> Thanks

Read Uncommitted

Stored procedure is causing blocking. Stored procedure only reads.
We add :
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
to the stored procedure and the blocking has gone down and I'm addressing a
similar problem with other stored procedures. I know the whole "dirty read"
thing and I'm not sure how likely that is...but is there anything else we
should be aware of while using this statement?
ThanksApart from the obvious, doing dirty read you risk getting inconsistent data:
You can get false data corruption messages. Like reading the data while "phy
sically" in flux. Just
don't worry about them. If you see them, and want to handle it, just re-try.
Also, if on 2005, consider using any of the snapshot isolation modes. But ma
ke sure you read up on
the consequences first.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"jason7655" <jason7655@.discussions.microsoft.com> wrote in message
news:5DEC3C93-73F8-4F24-B264-2018B423C8F4@.microsoft.com...
> Stored procedure is causing blocking. Stored procedure only reads.
> We add :
> SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
> to the stored procedure and the blocking has gone down and I'm addressing
a
> similar problem with other stored procedures. I know the whole "dirty rea
d"
> thing and I'm not sure how likely that is...but is there anything else we
> should be aware of while using this statement?
> Thanks|||See http://sqlblogcasts.com/blogs/tonyr...11/10/1280.aspx
.
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)
"jason7655" <jason7655@.discussions.microsoft.com> wrote in message
news:5DEC3C93-73F8-4F24-B264-2018B423C8F4@.microsoft.com...
> Stored procedure is causing blocking. Stored procedure only reads.
> We add :
> SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
> to the stored procedure and the blocking has gone down and I'm addressing
> a
> similar problem with other stored procedures. I know the whole "dirty
> read"
> thing and I'm not sure how likely that is...but is there anything else we
> should be aware of while using this statement?
> Thanks

Friday, March 23, 2012

read from .ini file

hi,
i have a requirement in which i need to read from a .ini file in the stored procedure of sql server 2K.
is it possible? i tried searching on google but i cannot find anything that can help.At the very least you should be able to use the Scripting.FileSystemObject and instantiate it use sp_OACreate (see SQL BOL for details).

However, I'm not sure that this is such a great idea. You're mixing environments (database and operating system) and the results may not be all that you would like them to be. How often is the .ini file going to be updated? Would it be possible to store the .ini values in the db (or even replace the .ini file with a database parameters table)?

Regards,

hmscott

Wednesday, March 21, 2012

READ COMMITTED SNAPSHOT ON causes performance degradation

I am running a benchmark test with multiple connections running the same
stored procedure with different parameters. This stored procedures does only
SELECT. There are no other activity on the database.
The stored procedure containst this select
SELECT Model,AVG(Price),MIN(Price),MAX(Price),COUNT(*)
FROM SH_Product
WHERE Project_Number = @.Station
AND EmployeeID = 0
AND Type = @.Match100
GROUP BY Model
ORDER BY Model
When the database is set in READ COMMITTED SNAPSHOT OFF mode, the number of
transactions per second increases linearly as more and more connections are
added.
But when the database is set to READ COMMITTED SNAPSHOT ON, the performance
degrades after 20 users, the total transactions processed per second remains
constant when number of users increase. That means for each user the
transactions per second reduces.
I can understand this if there was any other INSERT/UPDATE/DELETE activity
happening on the database, as SELECT will have to traverse the row version
chain to get the data, but in SELECT only environment, how can the
performance degrade.
With READ COMMITTED SNAPSHOT ON, there are no locks to acquire hence less
overhead for SQL Server. I have a PSS ticket open for this, but I am getting
a satisfactory answer. All I get is since SELECT needs to go to tempdb to get
row version it is slower, but my point is if there is no data change why does
SQL Server has to go to tempdb?
Am I missing something?. Please help.
Thank youOn Thu, 27 Sep 2007 12:31:01 -0700, Shailesh Khanal wrote:
(snip)
>I can understand this if there was any other INSERT/UPDATE/DELETE activity
>happening on the database, as SELECT will have to traverse the row version
>chain to get the data, but in SELECT only environment, how can the
>performance degrade.
>With READ COMMITTED SNAPSHOT ON, there are no locks to acquire hence less
>overhead for SQL Server. I have a PSS ticket open for this, but I am getting
>a satisfactory answer. All I get is since SELECT needs to go to tempdb to get
>row version it is slower, but my point is if there is no data change why does
>SQL Server has to go to tempdb?
Hi Shailesh,
I'm not intimately familiar with the internals of READ COMMITTED
SNAPSHOT, but my guess is that SQL Server has to go to tempdb because it
can't know that there are no previous row versions there without looking
first.
Have you considered setting the database to READ ONLY? That will fully
eliminate all locking overhead.
--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis|||Thanks Hugo
I am seeing this behavior while running a benchmark, which has different
sets of tests, one of them being CPU intensive test which only does SELECT.
It is not on a real production database so putting database in READ ONLY
mode is not an issue, but I wanted to understand the performance issue
without doing it.
I looked at page file structure in Kalen Delaney's book and I don't see any
information about whether SQL server puts a status bit on the page itself
for locked rows. But with READ COMMITTED SNAPSHOT ON, SQL server puts a 14
byte data in each row to store Transaction Sequence number (XSN), it is only
added when the row is updated. So logically speaking when a connection tries
to SELECT from a row, it has a XSN and when it goes to check the row in disk
if there is no XSN field then it should immediately know that the row is not
modified and should not go to tempdb to check.
Even if there is XSN for the row, and if it's value is less than SELECT XSN
then it should check lock records before going to tempdb. And this overhead
is also incurred when database is in READ COMMITTED SNAPSHOT OFF mode. So I
don't really get why the performance suffers so much.
"Hugo Kornelis" <hugo@.perFact.REMOVETHIS.info.INVALID> wrote in message
news:m3oqf31go4ti3d37736nsegqp2patoqjin@.4ax.com...
> On Thu, 27 Sep 2007 12:31:01 -0700, Shailesh Khanal wrote:
> (snip)
>>I can understand this if there was any other INSERT/UPDATE/DELETE activity
>>happening on the database, as SELECT will have to traverse the row version
>>chain to get the data, but in SELECT only environment, how can the
>>performance degrade.
>>With READ COMMITTED SNAPSHOT ON, there are no locks to acquire hence less
>>overhead for SQL Server. I have a PSS ticket open for this, but I am
>>getting
>>a satisfactory answer. All I get is since SELECT needs to go to tempdb to
>>get
>>row version it is slower, but my point is if there is no data change why
>>does
>>SQL Server has to go to tempdb?
> Hi Shailesh,
> I'm not intimately familiar with the internals of READ COMMITTED
> SNAPSHOT, but my guess is that SQL Server has to go to tempdb because it
> can't know that there are no previous row versions there without looking
> first.
> Have you considered setting the database to READ ONLY? That will fully
> eliminate all locking overhead.
> --
> Hugo Kornelis, SQL Server MVP
> My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis

Read / Write Into .doc From SQL Stored Procedure

I need to create a flat file as word document, may i know how to write text from stored procedure if a file is already exist then the text will append, how to do it ?

Thank you.

Often, the quality of the responses received is related to our ability to ‘bounce’ ideas off of each other. In the future, to make it easier for us to offer you assistance, and to prevent folks from wasting time on already answered questions, please don't post to multiple newsgroups. Choose the one that best fits your question and post there. Only post to another newsgroup if you get no answer in a day or two (or if you accidentally posted to the wrong newsgroup –and you indicate that you've already posted elsewhere).

Tuesday, March 20, 2012

Reaading and Processing a Recordset from Com object

Hi everybody.

I need help with the next topic.

From a stored procedure in sqlserver, I need to call a com+ dll, this dll connect ot another database diferent to sqlserver y return this dll must return to stored procedure a recordser for ther processing.

I tried with sp_OACreate, sp_OAMethod, sp_OAGetProperty but I did not know how to process a recordset

Thanks

Erik

You can return the recordset data as a multi-dimensional array and this will be streamed to the client. You can use INSERT...EXEC on the server-side to capture the results into a temporary table for example. You can't return the recordset object directly since SQL Server will not know how to process it. See sp_OAMethod topic in BOL for more details.

Re: Stored procedure not executing correctly

Hi everyone,

I am having trouble with this stored procedure. The @.curr_type stores the first value of inspection type of the recordset , @.inspec_type stores the current record of the inspection type. @.inspec_type moves to the next record while @.curr_type's value remain the same for comparisons.

The error is in the Else statment. These variables,@.curr_type and @.inspec_type, values are = 3 the else statement should not be executed.

Is something wrong with my code or logic?
Thank you for any assistance.Mind posting some code ?|||Yeah, without seeing it you want us to guess? Well, I guess that the ELSE is not executed because a check for a value of the variable does not take into account a possibility of NULL. Good enough, hey?! ;)|||so Sorry! absent minded me.

Here is my code:

CREATE PROCEDURE dbo.spCheck_inspection_type
@.inspec_type smallint Out, @.curr_type smallint Out
AS--ve

declare insp_type cursor

For
Select inspection_type
From tblTmp_inspec
Where partial <> 0 or complete <> 0;
set @.curr_type = 0;

Open insp_type
Fetch Next From insp_type Into @.inspec_type

While @.@.FETCH_STATUS = 0
Begin
if @.curr_type = 0
set @.curr_type = @.inspec_type;
Else
--last inspection type is @.curr_type
Begin
if @.curr_type <> @.inspec_type
close insp_type
deallocate insp_type
return(1);
End

Fetch Next From insp_type Into @.inspec_type

End

close insp_type
deallocate insp_type

return(0);
GO

The ELSE statment executed eventhough both variables 's values is 3 . Why?

Thank you much!!|||Indeting is SO overlooked...

You have logic problems...I guess they don't call them scop termintors here...

BUT...for now, to make it easier to read, use a BEGIN and END for every logic block...AND make sure to match them up...

BUT...This is WAY to over done for what you're trying to do...which is?

Here, look at this

CREATE PROC spCheck_inspection_type
@.inspec_type smallint OUT, @.curr_type smallint OuT
AS
DECLARE insp_type CURSOR
FOR
SELECT inspection_type FROM tblTmp_inspec WHERE partial <> 0 or complete <> 0;
SET @.curr_type = 0;

Open insp_type
FETCH NEXT FROM insp_type INTO @.inspec_type

WHILE @.@.FETCH_STATUS = 0
BEGIN
IF @.curr_type = 0
SET @.curr_type = @.inspec_type;
ELSE
BEGIN
IF @.curr_type <> @.inspec_type
CLOSE insp_type
DEALLOCATE insp_type
RETURN 1
END
FETCH NEXT FROM insp_type INTO @.inspec_type
END

CLOSE insp_type
DEALLOCATE insp_type

RETURN 0
GO|||That's too many colors,Brett, andno comment on what they mean!

All the guy is missing is BEGIN...END on the test for @.curr_type <> @.inspec_type: if @.curr_type <> @.inspec_type begin
close insp_type
deallocate insp_type
return(1);
end|||fine...fine...fine...

BUT!

Would you do this?

I mean, what does it even mean?|||Yup, there are problems with the code. Most obvious one is that the cursor declaration does not take into account the order of records as they get returned. This would yield unpredictable results when the app is running on a single CPU machine while being tested, compared to a prod environment when it gets deployed onto a SMP system.

To avoid usage of cursor, while fixing the ORDERing issue, would be to do the following:

declare @.curr_type int, @.record_id int
select @.curr_type = inspection_type, @.record_id = <record_id> from (
select top 1 <record_id>, inspection_type from tblTmp_inspec
WHERE partial <> 0 or complete <> 0
order by <record_id>) x

if exists (select 1 from tblTmp_inspec where <record_id> > @.record_id
and partial <> 0 or complete <> 0 and inspection_type <> @.curr_type)
return 1
else
return 0|||Brett, that was the most beautiful piece of SQL I've ever seen.

I am reminded of the Old Testament story of Joseph and his "Code of many colors". It must have looked something like that.

:)|||Brett, that was the most beautiful piece of SQL I've ever seen.
:)

And you know that's saying something...because he's, well, blind

Thanks Dude...

Seriously, alicejwz, Lettuce know what you're doing, and we can hook you up.

Re: Trouble in getting a value from bit data type in stored procedure

Hi eveyone,

I'm trying to get the stored procedure to return a value from a field in a table. The value in the field stores a bit value and default value is set to 0. So there should always a value in that field but it is giving me a null value. Can anyone see why.
I'm calling sp thru vb. Thanks much!

This is VB:
sub
Set cancel_inspection_query = Nothing
With cancel_inspection_query
.ActiveConnection = CurrentProject.Connection
.CommandText = "spInspec_cancel_initial_scan1"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("ret_val", adInteger, adParamReturnValue)
.Parameters.Append .CreateParameter("@.inspec_id", adInteger, adParamInput, 4, Me!inspecid.Caption)
.Parameters.Append .CreateParameter("@.bag_num", adInteger, adParamInput, 4, Me!bag_num.Caption)
.Parameters.Append .CreateParameter("@.sampling_id", adInteger, adParamInput, 4, Me!rmr.Caption)
.Execute , , adExecuteNoRecords

End With
Debug.Print cancel_inspection_query("ret_val").Value
end sub

This is sp:

CREATE PROCEDURE dbo.spInspec_cancel_initial_scan1
@.inspec_id int,
@.sampling_id int,
@.bag_num int
AS
declare @.inspection_complete bit

SELECT @.inspection_complete = inspection_complete
FROM dbo.tblBag_results
WHERE bag_num = @.bag_num;
begin
if @.inspection_complete= 1
return(1)
Else
if @.inspection_complete = 0
return(100)
--else
--return(-1)The Table DDL would help.

Is Bag_Num a PK or unique index?

If not, that's a problem...

Also is the column defined as NOT NULL?

If not, that's a problem...

And why not use an OUTPUT variable instead?

You should let SQL Server manage the return value. I've seen times when it overrides your value...which could be a problem if you code for a particular value...

Friday, March 9, 2012

RDL name with umlauts

Hello,
I programmatically upload a rdl file to my reporting server with Delphi 7
like this:
procedure TRepServWrapper.PublishRDLFile (const rdlname, rdlfile, parentPath
: String);
var
fs : TFileStream;
byteArray : TByteDynArray;
warnings : ArrayOfWarning;
i : Integer;
begin
fs := TFileStream.Create(rdlfile,fmOpenRead);
Try
Try
if fs.Size > 0 Then
begin
SetLength(byteArray, fs.Size);
fs.ReadBuffer(byteArray[0],fs.Size);
end;
except on e:Exception do
raise ECouldNotOpenRDLFile.Create('TRepServWrapper.PublishRDLFile: '
+ errCouldNotOpenRDLFile + ': '+e.Message);
end;
finally
fs.Free;
end;
Try
warnings := FRSInt.CreateReport(rdlname,parentPath,True,byteArray,nil);
If Not (warnings = nil) Then
begin
for i := 0 to High(warnings)-1 do
SendDebug('Warnung beim Upload der RDL: '+ warnings[i].Message);
end;
except on e : Exception do
raise ECouldNotUploadRDL.Create('TRepServWrapper.PublishRDLFile: ' +
errCouldNotUploadRDL + ': ' + e.Message);
end;
end;
This works except one thing:
Due to german users I'd like to have umlauts in the rdl name. Unfortunately
Reporting Services do not allow that (besides some other special characters).
Is there a special conversion to make this work?
Thank you in advance.
Sandra GeislerHello Sandra,
which version of Reporting Services do you use?
Which Webservice, should be ReportService2005?
Can you reproduce this with the upload function in Report Manager?
Can you reproduce this with the sample RSS script, which uploads the sample
report?
Regards
Klaus Sobel
Microsoft Developer Support EMEA
"Sandra Geisler" <SandraGeisler@.discussions.microsoft.com> schrieb im
Newsbeitrag news:D3D806A0-7ADA-4168-BF28-7C9E17B0522C@.microsoft.com...
> Hello,
> I programmatically upload a rdl file to my reporting server with Delphi 7
> like this:
> procedure TRepServWrapper.PublishRDLFile (const rdlname, rdlfile,
> parentPath
> : String);
> var
> fs : TFileStream;
> byteArray : TByteDynArray;
> warnings : ArrayOfWarning;
> i : Integer;
> begin
> fs := TFileStream.Create(rdlfile,fmOpenRead);
> Try
> Try
> if fs.Size > 0 Then
> begin
> SetLength(byteArray, fs.Size);
> fs.ReadBuffer(byteArray[0],fs.Size);
> end;
> except on e:Exception do
> raise ECouldNotOpenRDLFile.Create('TRepServWrapper.PublishRDLFile: '
> + errCouldNotOpenRDLFile + ': '+e.Message);
> end;
> finally
> fs.Free;
> end;
> Try
> warnings :=> FRSInt.CreateReport(rdlname,parentPath,True,byteArray,nil);
> If Not (warnings = nil) Then
> begin
> for i := 0 to High(warnings)-1 do
> SendDebug('Warnung beim Upload der RDL: '+ warnings[i].Message);
> end;
> except on e : Exception do
> raise ECouldNotUploadRDL.Create('TRepServWrapper.PublishRDLFile: ' +
> errCouldNotUploadRDL + ': ' + e.Message);
> end;
> end;
>
> This works except one thing:
> Due to german users I'd like to have umlauts in the rdl name.
> Unfortunately
> Reporting Services do not allow that (besides some other special
> characters).
> Is there a special conversion to make this work?
> Thank you in advance.
> Sandra Geisler|||Hello,
thanks for your fast reply.
I also get this error message (sry, I forgot):
Der Name des Elements 'T'bel' ist nicht gültig. Der Name kann höchstens 260
Zeichen lang sein und kann nicht mit einem Schrägstrich beginnen; au�erdem
gelten weitere Einschränkungen. Informationen zu allen Einschränkungen finden
Sie in der Dokumentation. --> Der Name des Elements 'S'sel' ist nicht
gültig. Der Name kann höchstens 260 Zeichen lang sein und kann nicht mit
einem Schrägstrich beginnen; au�erdem gelten weitere Einschränkungen.
Informationen zu allen Einschränkungen finden Sie in der
Dokumentation. 13:05:43
Regarding your questions:
> which version of Reporting Services do you use?
SQL Server 2000 SP4, Reporting Services Enterprise Version 8.00.1038.00
(i.e. SP2)
> Which Webservice, should be ReportService2005?
ummmmhh, where do I look that up? But regarding to question 1 I do not think
it is ReportService2005...
> Can you reproduce this with the upload function in Report Manager?
No, that works ok with the same rdl. But, in this case you dont have to
enter the name of the rdl resp. report, just the rdl file location and the
name is created automatically (and correctly).
Thanks in advance
Sandra Geisler
"Klaus Sobel [MS]" wrote:
> Hello Sandra,
> which version of Reporting Services do you use?
> Which Webservice, should be ReportService2005?
> Can you reproduce this with the upload function in Report Manager?
> Can you reproduce this with the sample RSS script, which uploads the sample
> report?
> Regards
> Klaus Sobel
> Microsoft Developer Support EMEA
> "Sandra Geisler" <SandraGeisler@.discussions.microsoft.com> schrieb im
> Newsbeitrag news:D3D806A0-7ADA-4168-BF28-7C9E17B0522C@.microsoft.com...
> > Hello,
> >
> > I programmatically upload a rdl file to my reporting server with Delphi 7
> > like this:
> >
> > procedure TRepServWrapper.PublishRDLFile (const rdlname, rdlfile,
> > parentPath
> > : String);
> > var
> > fs : TFileStream;
> > byteArray : TByteDynArray;
> > warnings : ArrayOfWarning;
> > i : Integer;
> > begin
> > fs := TFileStream.Create(rdlfile,fmOpenRead);
> > Try
> > Try
> > if fs.Size > 0 Then
> > begin
> > SetLength(byteArray, fs.Size);
> > fs.ReadBuffer(byteArray[0],fs.Size);
> > end;
> > except on e:Exception do
> > raise ECouldNotOpenRDLFile.Create('TRepServWrapper.PublishRDLFile: '
> > + errCouldNotOpenRDLFile + ': '+e.Message);
> > end;
> > finally
> > fs.Free;
> > end;
> >
> > Try
> > warnings :=> > FRSInt.CreateReport(rdlname,parentPath,True,byteArray,nil);
> > If Not (warnings = nil) Then
> > begin
> > for i := 0 to High(warnings)-1 do
> > SendDebug('Warnung beim Upload der RDL: '+ warnings[i].Message);
> > end;
> > except on e : Exception do
> > raise ECouldNotUploadRDL.Create('TRepServWrapper.PublishRDLFile: ' +
> > errCouldNotUploadRDL + ': ' + e.Message);
> > end;
> > end;
> >
> >
> > This works except one thing:
> > Due to german users I'd like to have umlauts in the rdl name.
> > Unfortunately
> > Reporting Services do not allow that (besides some other special
> > characters).
> > Is there a special conversion to make this work?
> >
> > Thank you in advance.
> >
> > Sandra Geisler
>
>|||Hello Sandra,
at the end the Upload in Report Manager is also using the CreateReport
method, so in general it works with the web service method.
It's possible that the problem is related with the DELPHI app, which is
calling the web service.
Try the sample RSS Script UploadReports.rss
You should find it in
\Programme\Microsoft SQL Server\MSSQL\Reporting Services\Samples
If this works there's a problem with the DELPHI app.
Best Regards
Klaus Sobel
Microsoft Developer Support EMEA
"Sandra Geisler" <SandraGeisler@.discussions.microsoft.com> schrieb im
Newsbeitrag news:49BCE6D2-B86E-4E7C-961C-1F5FB3C4DBFF@.microsoft.com...
> Hello,
> thanks for your fast reply.
> I also get this error message (sry, I forgot):
> Der Name des Elements 'T'bel' ist nicht gültig. Der Name kann höchstens
> 260
> Zeichen lang sein und kann nicht mit einem Schrägstrich beginnen; außerdem
> gelten weitere Einschränkungen. Informationen zu allen Einschränkungen
> finden
> Sie in der Dokumentation. --> Der Name des Elements 'S'sel' ist nicht
> gültig. Der Name kann höchstens 260 Zeichen lang sein und kann nicht mit
> einem Schrägstrich beginnen; außerdem gelten weitere Einschränkungen.
> Informationen zu allen Einschränkungen finden Sie in der
> Dokumentation. 13:05:43
> Regarding your questions:
>> which version of Reporting Services do you use?
> SQL Server 2000 SP4, Reporting Services Enterprise Version 8.00.1038.00
> (i.e. SP2)
>> Which Webservice, should be ReportService2005?
> ummmmhh, where do I look that up? But regarding to question 1 I do not
> think
> it is ReportService2005...
>> Can you reproduce this with the upload function in Report Manager?
> No, that works ok with the same rdl. But, in this case you dont have to
> enter the name of the rdl resp. report, just the rdl file location and the
> name is created automatically (and correctly).
> Thanks in advance
> Sandra Geisler
>
> "Klaus Sobel [MS]" wrote:
>> Hello Sandra,
>> which version of Reporting Services do you use?
>> Which Webservice, should be ReportService2005?
>> Can you reproduce this with the upload function in Report Manager?
>> Can you reproduce this with the sample RSS script, which uploads the
>> sample
>> report?
>> Regards
>> Klaus Sobel
>> Microsoft Developer Support EMEA
>> "Sandra Geisler" <SandraGeisler@.discussions.microsoft.com> schrieb im
>> Newsbeitrag news:D3D806A0-7ADA-4168-BF28-7C9E17B0522C@.microsoft.com...
>> > Hello,
>> >
>> > I programmatically upload a rdl file to my reporting server with Delphi
>> > 7
>> > like this:
>> >
>> > procedure TRepServWrapper.PublishRDLFile (const rdlname, rdlfile,
>> > parentPath
>> > : String);
>> > var
>> > fs : TFileStream;
>> > byteArray : TByteDynArray;
>> > warnings : ArrayOfWarning;
>> > i : Integer;
>> > begin
>> > fs := TFileStream.Create(rdlfile,fmOpenRead);
>> > Try
>> > Try
>> > if fs.Size > 0 Then
>> > begin
>> > SetLength(byteArray, fs.Size);
>> > fs.ReadBuffer(byteArray[0],fs.Size);
>> > end;
>> > except on e:Exception do
>> > raise
>> > ECouldNotOpenRDLFile.Create('TRepServWrapper.PublishRDLFile: '
>> > + errCouldNotOpenRDLFile + ': '+e.Message);
>> > end;
>> > finally
>> > fs.Free;
>> > end;
>> >
>> > Try
>> > warnings :=>> > FRSInt.CreateReport(rdlname,parentPath,True,byteArray,nil);
>> > If Not (warnings = nil) Then
>> > begin
>> > for i := 0 to High(warnings)-1 do
>> > SendDebug('Warnung beim Upload der RDL: '+
>> > warnings[i].Message);
>> > end;
>> > except on e : Exception do
>> > raise ECouldNotUploadRDL.Create('TRepServWrapper.PublishRDLFile: '
>> > +
>> > errCouldNotUploadRDL + ': ' + e.Message);
>> > end;
>> > end;
>> >
>> >
>> > This works except one thing:
>> > Due to german users I'd like to have umlauts in the rdl name.
>> > Unfortunately
>> > Reporting Services do not allow that (besides some other special
>> > characters).
>> > Is there a special conversion to make this work?
>> >
>> > Thank you in advance.
>> >
>> > Sandra Geisler
>>|||Hello Klaus,
thanks for your reply.
Unfortunately I don't have this sample script on my test machine.
I suppose the problem does not origin from the delphi app, anyway not
directly.
I agree, that the Report Manager also has to use the CreateReport method to
upload the rdl. But I think there is perhaps some encoding incompatibility
between the delphi app and the webservice. The origin of the described error
message is definitely the webservice, namely :
Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings.resources.Strings rsInvalidItemName
But I don't understand that, because the name definitely does not contain
any invalid characters and the problem only occurs with umlauts. Other names
are accepted, so that the constitution of the path of the rdl could not be
the problem. The error only occurs if in the CreateReport method the first
parameter contains an umlaut.
The wrapping class has the following registration code for the callback
interface:
InvRegistry.RegisterInterface(TypeInfo(ReportingServiceSoap),
'http://schemas.microsoft.com/sqlserver/2003/12/reporting/reportingservices',
'utf-8');
Whereby ReportingServiceSoap is the callback interface where the methods of
the webservice are defined.
I think it is some encoding issue, but I don't know exactly where to start
searching.
Thanks in advance
Sandra Geisler
"Klaus Sobel [MS]" wrote:
> Hello Sandra,
> at the end the Upload in Report Manager is also using the CreateReport
> method, so in general it works with the web service method.
> It's possible that the problem is related with the DELPHI app, which is
> calling the web service.
> Try the sample RSS Script UploadReports.rss
> You should find it in
> \Programme\Microsoft SQL Server\MSSQL\Reporting Services\Samples
> If this works there's a problem with the DELPHI app.
> Best Regards
> Klaus Sobel
> Microsoft Developer Support EMEA
> "Sandra Geisler" <SandraGeisler@.discussions.microsoft.com> schrieb im
> Newsbeitrag news:49BCE6D2-B86E-4E7C-961C-1F5FB3C4DBFF@.microsoft.com...
> > Hello,
> >
> > thanks for your fast reply.
> >
> > I also get this error message (sry, I forgot):
> >
> > Der Name des Elements 'T'bel' ist nicht gültig. Der Name kann höchstens
> > 260
> > Zeichen lang sein und kann nicht mit einem Schrägstrich beginnen; au�erdem
> > gelten weitere Einschränkungen. Informationen zu allen Einschränkungen
> > finden
> > Sie in der Dokumentation. --> Der Name des Elements 'S'sel' ist nicht
> > gültig. Der Name kann höchstens 260 Zeichen lang sein und kann nicht mit
> > einem Schrägstrich beginnen; au�erdem gelten weitere Einschränkungen.
> > Informationen zu allen Einschränkungen finden Sie in der
> > Dokumentation. 13:05:43
> >
> > Regarding your questions:
> >
> >> which version of Reporting Services do you use?
> >
> > SQL Server 2000 SP4, Reporting Services Enterprise Version 8.00.1038.00
> > (i.e. SP2)
> >
> >> Which Webservice, should be ReportService2005?
> > ummmmhh, where do I look that up? But regarding to question 1 I do not
> > think
> > it is ReportService2005...
> >
> >> Can you reproduce this with the upload function in Report Manager?
> >
> > No, that works ok with the same rdl. But, in this case you dont have to
> > enter the name of the rdl resp. report, just the rdl file location and the
> > name is created automatically (and correctly).
> >
> > Thanks in advance
> >
> > Sandra Geisler
> >
> >
> >
> > "Klaus Sobel [MS]" wrote:
> >
> >> Hello Sandra,
> >>
> >> which version of Reporting Services do you use?
> >> Which Webservice, should be ReportService2005?
> >> Can you reproduce this with the upload function in Report Manager?
> >> Can you reproduce this with the sample RSS script, which uploads the
> >> sample
> >> report?
> >>
> >> Regards
> >>
> >> Klaus Sobel
> >>
> >> Microsoft Developer Support EMEA
> >> "Sandra Geisler" <SandraGeisler@.discussions.microsoft.com> schrieb im
> >> Newsbeitrag news:D3D806A0-7ADA-4168-BF28-7C9E17B0522C@.microsoft.com...
> >> > Hello,
> >> >
> >> > I programmatically upload a rdl file to my reporting server with Delphi
> >> > 7
> >> > like this:
> >> >
> >> > procedure TRepServWrapper.PublishRDLFile (const rdlname, rdlfile,
> >> > parentPath
> >> > : String);
> >> > var
> >> > fs : TFileStream;
> >> > byteArray : TByteDynArray;
> >> > warnings : ArrayOfWarning;
> >> > i : Integer;
> >> > begin
> >> > fs := TFileStream.Create(rdlfile,fmOpenRead);
> >> > Try
> >> > Try
> >> > if fs.Size > 0 Then
> >> > begin
> >> > SetLength(byteArray, fs.Size);
> >> > fs.ReadBuffer(byteArray[0],fs.Size);
> >> > end;
> >> > except on e:Exception do
> >> > raise
> >> > ECouldNotOpenRDLFile.Create('TRepServWrapper.PublishRDLFile: '
> >> > + errCouldNotOpenRDLFile + ': '+e.Message);
> >> > end;
> >> > finally
> >> > fs.Free;
> >> > end;
> >> >
> >> > Try
> >> > warnings :=> >> > FRSInt.CreateReport(rdlname,parentPath,True,byteArray,nil);
> >> > If Not (warnings = nil) Then
> >> > begin
> >> > for i := 0 to High(warnings)-1 do
> >> > SendDebug('Warnung beim Upload der RDL: '+
> >> > warnings[i].Message);
> >> > end;
> >> > except on e : Exception do
> >> > raise ECouldNotUploadRDL.Create('TRepServWrapper.PublishRDLFile: '
> >> > +
> >> > errCouldNotUploadRDL + ': ' + e.Message);
> >> > end;
> >> > end;
> >> >
> >> >
> >> > This works except one thing:
> >> > Due to german users I'd like to have umlauts in the rdl name.
> >> > Unfortunately
> >> > Reporting Services do not allow that (besides some other special
> >> > characters).
> >> > Is there a special conversion to make this work?
> >> >
> >> > Thank you in advance.
> >> >
> >> > Sandra Geisler
> >>
> >>
> >>
>
>|||Oh my god, I solved it ;-).
It was an encoding issue which had its origin in the SOAPHTPPClient unit of
Delphi.
I had to set the THTTPRIO.HTTPWebNode.UseUTF8InHeader to true and then it
worked :-)...
Thank you very much for your support!
"Sandra Geisler" wrote:
> Hello Klaus,
> thanks for your reply.
> Unfortunately I don't have this sample script on my test machine.
> I suppose the problem does not origin from the delphi app, anyway not
> directly.
> I agree, that the Report Manager also has to use the CreateReport method to
> upload the rdl. But I think there is perhaps some encoding incompatibility
> between the delphi app and the webservice. The origin of the described error
> message is definitely the webservice, namely :
> Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings.resources.Strings rsInvalidItemName
> But I don't understand that, because the name definitely does not contain
> any invalid characters and the problem only occurs with umlauts. Other names
> are accepted, so that the constitution of the path of the rdl could not be
> the problem. The error only occurs if in the CreateReport method the first
> parameter contains an umlaut.
> The wrapping class has the following registration code for the callback
> interface:
> InvRegistry.RegisterInterface(TypeInfo(ReportingServiceSoap),
> 'http://schemas.microsoft.com/sqlserver/2003/12/reporting/reportingservices',
> 'utf-8');
> Whereby ReportingServiceSoap is the callback interface where the methods of
> the webservice are defined.
> I think it is some encoding issue, but I don't know exactly where to start
> searching.
> Thanks in advance
> Sandra Geisler
> "Klaus Sobel [MS]" wrote:
> > Hello Sandra,
> >
> > at the end the Upload in Report Manager is also using the CreateReport
> > method, so in general it works with the web service method.
> >
> > It's possible that the problem is related with the DELPHI app, which is
> > calling the web service.
> >
> > Try the sample RSS Script UploadReports.rss
> >
> > You should find it in
> >
> > \Programme\Microsoft SQL Server\MSSQL\Reporting Services\Samples
> >
> > If this works there's a problem with the DELPHI app.
> >
> > Best Regards
> >
> > Klaus Sobel
> >
> > Microsoft Developer Support EMEA
> >
> > "Sandra Geisler" <SandraGeisler@.discussions.microsoft.com> schrieb im
> > Newsbeitrag news:49BCE6D2-B86E-4E7C-961C-1F5FB3C4DBFF@.microsoft.com...
> > > Hello,
> > >
> > > thanks for your fast reply.
> > >
> > > I also get this error message (sry, I forgot):
> > >
> > > Der Name des Elements 'T'bel' ist nicht gültig. Der Name kann höchstens
> > > 260
> > > Zeichen lang sein und kann nicht mit einem Schrägstrich beginnen; au�erdem
> > > gelten weitere Einschränkungen. Informationen zu allen Einschränkungen
> > > finden
> > > Sie in der Dokumentation. --> Der Name des Elements 'S'sel' ist nicht
> > > gültig. Der Name kann höchstens 260 Zeichen lang sein und kann nicht mit
> > > einem Schrägstrich beginnen; au�erdem gelten weitere Einschränkungen.
> > > Informationen zu allen Einschränkungen finden Sie in der
> > > Dokumentation. 13:05:43
> > >
> > > Regarding your questions:
> > >
> > >> which version of Reporting Services do you use?
> > >
> > > SQL Server 2000 SP4, Reporting Services Enterprise Version 8.00.1038.00
> > > (i.e. SP2)
> > >
> > >> Which Webservice, should be ReportService2005?
> > > ummmmhh, where do I look that up? But regarding to question 1 I do not
> > > think
> > > it is ReportService2005...
> > >
> > >> Can you reproduce this with the upload function in Report Manager?
> > >
> > > No, that works ok with the same rdl. But, in this case you dont have to
> > > enter the name of the rdl resp. report, just the rdl file location and the
> > > name is created automatically (and correctly).
> > >
> > > Thanks in advance
> > >
> > > Sandra Geisler
> > >
> > >
> > >
> > > "Klaus Sobel [MS]" wrote:
> > >
> > >> Hello Sandra,
> > >>
> > >> which version of Reporting Services do you use?
> > >> Which Webservice, should be ReportService2005?
> > >> Can you reproduce this with the upload function in Report Manager?
> > >> Can you reproduce this with the sample RSS script, which uploads the
> > >> sample
> > >> report?
> > >>
> > >> Regards
> > >>
> > >> Klaus Sobel
> > >>
> > >> Microsoft Developer Support EMEA
> > >> "Sandra Geisler" <SandraGeisler@.discussions.microsoft.com> schrieb im
> > >> Newsbeitrag news:D3D806A0-7ADA-4168-BF28-7C9E17B0522C@.microsoft.com...
> > >> > Hello,
> > >> >
> > >> > I programmatically upload a rdl file to my reporting server with Delphi
> > >> > 7
> > >> > like this:
> > >> >
> > >> > procedure TRepServWrapper.PublishRDLFile (const rdlname, rdlfile,
> > >> > parentPath
> > >> > : String);
> > >> > var
> > >> > fs : TFileStream;
> > >> > byteArray : TByteDynArray;
> > >> > warnings : ArrayOfWarning;
> > >> > i : Integer;
> > >> > begin
> > >> > fs := TFileStream.Create(rdlfile,fmOpenRead);
> > >> > Try
> > >> > Try
> > >> > if fs.Size > 0 Then
> > >> > begin
> > >> > SetLength(byteArray, fs.Size);
> > >> > fs.ReadBuffer(byteArray[0],fs.Size);
> > >> > end;
> > >> > except on e:Exception do
> > >> > raise
> > >> > ECouldNotOpenRDLFile.Create('TRepServWrapper.PublishRDLFile: '
> > >> > + errCouldNotOpenRDLFile + ': '+e.Message);
> > >> > end;
> > >> > finally
> > >> > fs.Free;
> > >> > end;
> > >> >
> > >> > Try
> > >> > warnings :=> > >> > FRSInt.CreateReport(rdlname,parentPath,True,byteArray,nil);
> > >> > If Not (warnings = nil) Then
> > >> > begin
> > >> > for i := 0 to High(warnings)-1 do
> > >> > SendDebug('Warnung beim Upload der RDL: '+
> > >> > warnings[i].Message);
> > >> > end;
> > >> > except on e : Exception do
> > >> > raise ECouldNotUploadRDL.Create('TRepServWrapper.PublishRDLFile: '
> > >> > +
> > >> > errCouldNotUploadRDL + ': ' + e.Message);
> > >> > end;
> > >> > end;
> > >> >
> > >> >
> > >> > This works except one thing:
> > >> > Due to german users I'd like to have umlauts in the rdl name.
> > >> > Unfortunately
> > >> > Reporting Services do not allow that (besides some other special
> > >> > characters).
> > >> > Is there a special conversion to make this work?
> > >> >
> > >> > Thank you in advance.
> > >> >
> > >> > Sandra Geisler
> > >>
> > >>
> > >>
> >
> >
> >|||Sandra,
you saved my day.
I stuck in a similar problem. But UseUTF8InHeader solved it.
Thank you
"Sandra Geisler" wrote:
> Oh my god, I solved it ;-).
> It was an encoding issue which had its origin in the SOAPHTPPClient unit of
> Delphi.
> I had to set the THTTPRIO.HTTPWebNode.UseUTF8InHeader to true and then it
> worked :-)...
> Thank you very much for your support!|||Glad to be of some help!
Best regards
Sandra
"Christian Loidl" wrote:
> Sandra,
> you saved my day.
> I stuck in a similar problem. But UseUTF8InHeader solved it.
> Thank you
> "Sandra Geisler" wrote:
> > Oh my god, I solved it ;-).
> > It was an encoding issue which had its origin in the SOAPHTPPClient unit of
> > Delphi.
> > I had to set the THTTPRIO.HTTPWebNode.UseUTF8InHeader to true and then it
> > worked :-)...
> >
> > Thank you very much for your support!
>

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