Monday, March 19, 2012
Can the Output parameter length be more than 8000 characters?
I am running one SP - which needs to return strings, seperated by
delimitter. I am using output parameter of type Varchar (8000). I learned
that this is maximum length allowed.
Now what problem I am facing is, for a particular field, the delimitted text
is getting higher than 8000 characters and that is why the rest of the value
is getting truncated.
Can you guys let me know any better way of achieving this?
I will be extremely thankful to you.
Regards,
SachinYou'll have to select the data instead of using an output param... Or
upgrade to SQL Server 2005 and use VARCHAR(MAX) instead :)
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"Sachin Vaishnav" <SachinVaishnav@.discussions.microsoft.com> wrote in
message news:880D2034-115A-4E86-9D38-97BD909BF564@.microsoft.com...
> Hi!
> I am running one SP - which needs to return strings, seperated by
> delimitter. I am using output parameter of type Varchar (8000). I learned
> that this is maximum length allowed.
> Now what problem I am facing is, for a particular field, the delimitted
> text
> is getting higher than 8000 characters and that is why the rest of the
> value
> is getting truncated.
> Can you guys let me know any better way of achieving this?
> I will be extremely thankful to you.
> Regards,
> Sachin|||Instead of Varchar(8000) ... how about using TEXT or NText as your datatype?
Best Regards
Vadivel
http://vadivel.blogspot.com
http://thinkingms.com/vadivel
"Sachin Vaishnav" wrote:
> Hi!
> I am running one SP - which needs to return strings, seperated by
> delimitter. I am using output parameter of type Varchar (8000). I learned
> that this is maximum length allowed.
> Now what problem I am facing is, for a particular field, the delimitted te
xt
> is getting higher than 8000 characters and that is why the rest of the val
ue
> is getting truncated.
> Can you guys let me know any better way of achieving this?
> I will be extremely thankful to you.
> Regards,
> Sachin|||Thanks. Using 2005 is not possible for me now. I will have to manage fromw
what I have already :)
Anyways, as per your other suggestion, the problem in that is, I am already
having one select returned out of the SP. So, there is no point in that also
.
Can some cursor type of output or XML type of output is useful to me?
I need to send it back to the API and the API is used by UI.
Help me,
Sachin
"Adam Machanic" wrote:
> You'll have to select the data instead of using an output param... Or
> upgrade to SQL Server 2005 and use VARCHAR(MAX) instead :)
>
> --
> Adam Machanic
> Pro SQL Server 2005, available now
> http://www.apress.com/book/bookDisplay.html?bID=457
> --
>
> "Sachin Vaishnav" <SachinVaishnav@.discussions.microsoft.com> wrote in
> message news:880D2034-115A-4E86-9D38-97BD909BF564@.microsoft.com...
>
>|||Stored procedures can return multiple rowsets... Why not use two?
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"Sachin Vaishnav" <SachinVaishnav@.discussions.microsoft.com> wrote in
message news:DB3F424E-01C2-49DB-B7B7-99D22F91CD24@.microsoft.com...
> Thanks. Using 2005 is not possible for me now. I will have to manage fromw
> what I have already :)
> Anyways, as per your other suggestion, the problem in that is, I am
> already
> having one select returned out of the SP. So, there is no point in that
> also.
> Can some cursor type of output or XML type of output is useful to me?
> I need to send it back to the API and the API is used by UI.
> Help me,
> Sachin
> "Adam Machanic" wrote:
>|||"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:Ogxg9Nr7FHA.1416@.TK2MSFTNGP09.phx.gbl...
> Stored procedures can return multiple rowsets... Why not use two?
...or use multiple Output parameters.
When one reaches the 8000 character limit, insert the rest in the 2nd.
But I'd prefer Adam's solution, 2 recordsets.|||Hi!
Thanks a lot. Is it possible to have 2 RS from SP? Well, I was unable to get
once. Can I have some example of the same?
Thanks
Sachin
"Adam Machanic" wrote:
> Stored procedures can return multiple rowsets... Why not use two?
>
> --
> Adam Machanic
> Pro SQL Server 2005, available now
> http://www.apress.com/book/bookDisplay.html?bID=457
> --
>
> "Sachin Vaishnav" <SachinVaishnav@.discussions.microsoft.com> wrote in
> message news:DB3F424E-01C2-49DB-B7B7-99D22F91CD24@.microsoft.com...
>
>|||Sure...
CREATE PROCEDURE TWO_RESULT_SETS
AS
BEGIN
SELECT 1
SELECT 2
END
GO
EXEC TWO_RESULT_SETS
GO
DROP PROCEDURE TWO_RESULT_SETS
GO
--
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"Sachin Vaishnav" <SachinVaishnav@.discussions.microsoft.com> wrote in
message news:FD089362-31C1-49B2-83B0-88ED1F9FD5FC@.microsoft.com...
> Hi!
> Thanks a lot. Is it possible to have 2 RS from SP? Well, I was unable to
> get
> once. Can I have some example of the same?
> Thanks
> Sachin
> "Adam Machanic" wrote:
>|||Thanks a lotl!
However, I know this. But i guess, the problem is perhaps, when I write 2
selects in the SP, if I am using ADODB.Recordset to retrieve the data, I
won't get the result of both the record set. Right?
So, can you suggest me how do I tackle that one? :)
Thanks again!
Regards,
Sachin
"Adam Machanic" wrote:
> Sure...
> --
> CREATE PROCEDURE TWO_RESULT_SETS
> AS
> BEGIN
> SELECT 1
> SELECT 2
> END
> GO
> EXEC TWO_RESULT_SETS
> GO
> DROP PROCEDURE TWO_RESULT_SETS
> GO
> --
> --
> Adam Machanic
> Pro SQL Server 2005, available now
> http://www.apress.com/book/bookDisplay.html?bID=457
> --
>
> "Sachin Vaishnav" <SachinVaishnav@.discussions.microsoft.com> wrote in
> message news:FD089362-31C1-49B2-83B0-88ED1F9FD5FC@.microsoft.com...
>
>|||Set rsSecond = rsFirst.NextRecordset()
cheers,
</wqw>
Can the data viewers display Chinese characters?
The data viewer displays Chinese characters as boxes, something similar to [_], at least on a computer with the following regional settings.
get-wmiobject CIM_OperatingSystem | ft OSLanguage, CodeSet, Locale
OSLanguage CodeSet Locale
- -
1033 1252 0409
The data itself is flowing correctly into the target database with a pipeline data_type of DT_WSTR. The ideograms can be seen by query utilities which supports a unicode font (e.g. Management Studio).
Yes, follow
Tools > Options > Environment > Fonts and Colors, then
select Show settings for: Business Intelligence Data Viewers.
Now select the font you want to use.|||Thanks a lot Michael, works great.
Can the data viewers display Chinese characters?
The data viewer displays Chinese characters as boxes, something similar to [_], at least on a computer with the following regional settings.
get-wmiobject CIM_OperatingSystem | ft OSLanguage, CodeSet, Locale
OSLanguage CodeSet Locale
- -
1033 1252 0409
The data itself is flowing correctly into the target database with a pipeline data_type of DT_WSTR. The ideograms can be seen by query utilities which supports a unicode font (e.g. Management Studio).
Yes, follow
Tools > Options > Environment > Fonts and Colors, then
select Show settings for: Business Intelligence Data Viewers.
Now select the font you want to use.|||Thanks a lot Michael, works great.
Tuesday, February 14, 2012
Can not Update/Insert big5 characters in to sql server 2000
I have current current sql server 2000 database containing some columns in big5. To display these cols correctly, my asp.net nust have directive with CodePage="1252" ContentType="text/html;charset=BIG5". I can not update, or insert big5 character into these columns via .aspx page. I'm using .net framework 2.0.
Please help me, thanks a lot for any help.
The quick question is why are you using Latin code page to save data going into a Chinese alphabet database column?|||I really don't want to use that method, but it's a legacy database used with asp. We are migrating to asp.net while the asp version's still running. So, I can not change it. But your question may give me some ideas, thank you very much.
By the way, I've try the solution in http://forums.asp.net/518209/ShowPost.aspx, It seem to be ok. But there're some words becoming '?' after updated into database.
Any hints for me
|||I have read that thread but not everything the person said is correct so here is what you to avoid character conversion, in VS2005 the advanced option let you save your code with code pages any langauge, and you can also do encoding of the page when you save it. These will help you with the application layer but also make sure you use column level collation in the database because the Latin alphabet is 26 characters, the Chinese is more than 2000 characters, they cannot be passed arround as you want. The links below will help you. Hope this helps.
https://www.microsoft.co.ke/middleeast/msdn/arabicsupp.aspx#7
http://www.developerland.com/DotNet/General/99.aspx
|||ThankCaddre very much,
I'll read them. My important problem is: I cannot column change the 'level collation in the database' as you said because it's a legacy database. Actually, I don't know much 'bout it. I'll check with my DBA.
regards,
thanks a lot,
I'm using sql server 2000, and I'm trying to use UTF-8 charset only
|||You cannot use UTF-8 in SQL Server because SQL Server uses UC-S 2 a version of UTF-16 but here is a thread I helped someone do Chinese collation in SQL Server 2000. But you can do encoding in the application layer in UTF-8. Hope this helps.
http://forums.asp.net/1067798/ShowPost.aspx