Friday, March 30, 2012
Reading a long string
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
>
>
Tuesday, March 20, 2012
Re: Get not null or empty string is not work
Could anyone see where the error is in this IF statement?
I have three records in Shipment_history table with that work_ord_num and w/i those three records one record has a value in cust_part_num field.
I want the query return the cust_part_num value but it returns the record w/o cust_part_num.
Thanks much!
spSomething
:
Declare popu_tbl Cursor
For
SELECT TOP 100 PERCENT dbo.tblShipping_sched.work_ord_num, ...
FROM tbl
WHERE..
Open popu_tbl
Fetch Next From
While ...
Begin
--***
IF @.cust_part_num is null
SELECT @.cust_part_num = cust_part_num FROM dbo.Shipment_history
WHERE work_ord_num like (left(@.work_ord_num, 6) + '%') AND work_ord_line_num = @.work_ord_line_num
AND cust_part_num <> "";
--** the line above doesn't workUse:
IF @.cust_part_num is NOT null
...but why are you doing this in a cursor?
I'd almost guarantee that there are other issues with the code you have ommitted.
Friday, March 9, 2012
RDC Connection string data
CRReport.Database.Tables(1).SetLogOnInfo sCRServer, sCRDatabase, sCRLogin, sCRPassword
and that works fine, but I would like to be able to pass the Workstation ID(WSID) and App name(APP) like can be done in a standard ado connection string.
i.e.
Cn = "uid=sa;pwd=admin;driver={SQL Server};server=NTSERVER5;WSID=" & Trim(sUserName) & "-" & getUserComputerName() & ";APP=" & App.EXEName & "-" & sServerName & ";database=" & sDatabaseName & ";dsn=,,connection=adConnectAsync"
Any ideas on how to pass that information for crystal to use it, when logging in?I also connected to crystal using :
CRReport.Database.LogOnServerEx "pdssql.dll", sCRServer, sCRDatabase, sCRLogin, sCRPassword, "uid=sa;pwd=admin;driver={pdssql.dll};server=" & sCRServer & ";WSID=" & Trim(sUserName) & "-" & getUserComputerName() & ";APP=" & "CR" & App.EXEName & "-" & sServerName & ";database=" & sDatabaseName & ";dsn=,,connection=adConnectAsync"
but MS SQL in the Prodcess Info, when the report runs stilll doesn't show the WSID and APP information on the server. I passed it above, but??
Any ideas.
thanks,
Dean
Saturday, February 25, 2012
RDA Error:Failure setting up a non parameterized query, possible incorrect SQL query
I receive this error :
Failure setting up a non parameterized query, possible incorrect SQL query
any 1 can help me plz?
here is my code :
string strDBFile = DBPath;
string strConnLocal = DBConnection;
string strConnRemote = "Provider=sqloledb; "
+ "Data Source=AMNEH; "
+ "Initial Catalog=SIS; "
+ "Integrated Security=SSPI;";
string strURL = "http://" + ipAddress + "/" + virtualDirectory + "/sqlcesa30.dll";
SqlCeRemoteDataAccess rdaNW = new SqlCeRemoteDataAccess();
try
{
rdaNW.LocalConnectionString = strConnLocal;
rdaNW.InternetUrl = strURL;
rdaNW.InternetLogin = "";
rdaNW.InternetPassword = "";
string select = "select * from tabel1 where field1=326";
rdaNW.Pull("tabel1",select,
strConnRemote,
RdaTrackOption.TrackingOnWithIndexes,
"ErrorLog");
}
catch (SqlCeException exSQL)
{
MessageBox.Show("HRESULT:" + exSQL.HResult.ToString() + ",\nNativeError:" + exSQL.NativeError.ToString() + ",\nMessage:" + exSQL.Message);
}
finally
{
rdaNW.Dispose();
}
There is no obvious error with your select query but there are a number of things that can be setup incorrectly when doing RDA. Did you remove the table from the SQL CE database before running this code? I have answered dozens of questions in this forum and on microsoft.public.sqlserver.ce on the topic of troubleshooting RDA. You can use Google Advanced Group Search to search for the posts that apply to RDA.
Darren