How can I select distinct values from a table which has column datatype as
Text.
data sholud n't be truncated.
--
Regards,
Kassim.http://support.microsoft.com/kb/162032/en-us
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"M Kassim" <MKassim@.discussions.microsoft.com> schrieb im Newsbeitrag
news:85267AF5-DAE1-45AE-B24B-C90502681D3F@.microsoft.com...
> How can I select distinct values from a table which has column datatype as
> Text.
> data sholud n't be truncated.
> --
> Regards,
> Kassim.|||I do get these error, is there any other way to over come this.
Kassim.
"Jens Sü?meyer" wrote:
> http://support.microsoft.com/kb/162032/en-us
> HTH, Jens Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
> "M Kassim" <MKassim@.discussions.microsoft.com> schrieb im Newsbeitrag
> news:85267AF5-DAE1-45AE-B24B-C90502681D3F@.microsoft.com...
>
>|||I do get these error, is there any other way to over come this.
Kassim.
"Jens Sü?meyer" wrote:
> http://support.microsoft.com/kb/162032/en-us
> HTH, Jens Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
> "M Kassim" <MKassim@.discussions.microsoft.com> schrieb im Newsbeitrag
> news:85267AF5-DAE1-45AE-B24B-C90502681D3F@.microsoft.com...
>
>|||I do get these error, is there any other way to over come this.
Kassim.
"Jens Sü?meyer" wrote:
> http://support.microsoft.com/kb/162032/en-us
> HTH, Jens Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
> "M Kassim" <MKassim@.discussions.microsoft.com> schrieb im Newsbeitrag
> news:85267AF5-DAE1-45AE-B24B-C90502681D3F@.microsoft.com...
>
>|||Can you post some DDL and your query please.
"M Kassim" <MKassim@.discussions.microsoft.com> schrieb im Newsbeitrag
news:517D91E0-FA6D-41EB-AD5C-3CAF4ED0F393@.microsoft.com...
>I do get these error, is there any other way to over come this.
> Kassim.
> "Jens Smeyer" wrote:
>|||Does the text column need to be part of the DISTINCT
operator, or can you be sure the text columns match if all
the other columns match? If you only need DISTINCT on
the other columns, one solution is to create a primary key or
unique column for the table. If myID is a unique
integer column, you could do something like this:
select * from myTable
where myID in (
select min(myID)
from myTable
group by col1, col2, col3
-- Do *not* include the text column in this list
)
If there are two different text column values for
the same (col1, col2, col3), you will get only one
of those rows.
If you need to determine if the text columns are unequal,
you could compare the first 8000 characters, or more if
you want:
select * from myTable
where not exists (
select * from myTable as Tcopy
where Tcopy.col1 = T.col1
and Tcopy.col2 = T.col2
..
and substring(Tcopy.textcol,1,8000) = substring(T.textcol,1,8000)
and substring(Tcopy.textcol,8001,8000) = substring(T.textcol,8001,8000)
and Tcopy.myID < T.myID
)
Steve Kass
Drew University
M Kassim wrote:
>How can I select distinct values from a table which has column datatype as
>Text.
>data sholud n't be truncated.
>|||Hi,
I have a table called comments, which has 2 columns commentID primarykey
and comment [Text datatype], now I would like
select distinct comment from comments.
Kassim.
---
"Steve Kass" wrote:
> Does the text column need to be part of the DISTINCT
> operator, or can you be sure the text columns match if all
> the other columns match? If you only need DISTINCT on
> the other columns, one solution is to create a primary key or
> unique column for the table. If myID is a unique
> integer column, you could do something like this:
> select * from myTable
> where myID in (
> select min(myID)
> from myTable
> group by col1, col2, col3
> -- Do *not* include the text column in this list
> )
> If there are two different text column values for
> the same (col1, col2, col3), you will get only one
> of those rows.
> If you need to determine if the text columns are unequal,
> you could compare the first 8000 characters, or more if
> you want:
> select * from myTable
> where not exists (
> select * from myTable as Tcopy
> where Tcopy.col1 = T.col1
> and Tcopy.col2 = T.col2
> ...
> and substring(Tcopy.textcol,1,8000) = substring(T.textcol,1,8000)
> and substring(Tcopy.textcol,8001,8000) = substring(T.textcol,8001,8000)
> and Tcopy.myID < T.myID
> )
> Steve Kass
> Drew University
> M Kassim wrote:
>
>sql
Showing posts with label datatype. Show all posts
Showing posts with label datatype. Show all posts
Sunday, March 25, 2012
Friday, March 9, 2012
Displaying De-Serialized Images in Reports
PREFACE:
I have a field in my SQL Server database that is called "Ink" and is Text as
the datatype.
I have put into this field a Base64 String which represents serialized
digital ink collected on a Tablet PC.
I wrote a small piece of Custom Code in the Report to de-serialize the ink
and transform it into System.Drawing.Bitmap, but it does not render in the
report.
QUESTION
Is it possible to display images in a report from a function that returns a
data type of System.Drawing.Bitmap?
If not, can I ask how you are planning to implement digital INK support in
databases?
--
Shawn Nanto
Leszynski Group, Inc.
Bellevue, WAImages can be directly displayed when they are returned as Base64 encoded
byte array. The image type has to be "Database" and you must set the
MimeType to the correct image format.
Note: System.Drawing.Bitmap is not supported.
The relevant section in the RDL file would look similar to this:
<Image>
<MIMEType>image/bmp</MIMEType>
<Source>Database</Source>
<Value>=Fields!InkImage.Value</Value>
...
</Image>
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Shawn Nanto" <ShawnNanto@.discussions.microsoft.com> wrote in message
news:0A54FC08-2ECB-4996-B585-5F7E4BA3A8C9@.microsoft.com...
> PREFACE:
> I have a field in my SQL Server database that is called "Ink" and is Text
as
> the datatype.
> I have put into this field a Base64 String which represents serialized
> digital ink collected on a Tablet PC.
> I wrote a small piece of Custom Code in the Report to de-serialize the ink
> and transform it into System.Drawing.Bitmap, but it does not render in the
> report.
> QUESTION
> Is it possible to display images in a report from a function that returns
a
> data type of System.Drawing.Bitmap?
> If not, can I ask how you are planning to implement digital INK support in
> databases?
>
> --
> Shawn Nanto
> Leszynski Group, Inc.
> Bellevue, WA
I have a field in my SQL Server database that is called "Ink" and is Text as
the datatype.
I have put into this field a Base64 String which represents serialized
digital ink collected on a Tablet PC.
I wrote a small piece of Custom Code in the Report to de-serialize the ink
and transform it into System.Drawing.Bitmap, but it does not render in the
report.
QUESTION
Is it possible to display images in a report from a function that returns a
data type of System.Drawing.Bitmap?
If not, can I ask how you are planning to implement digital INK support in
databases?
--
Shawn Nanto
Leszynski Group, Inc.
Bellevue, WAImages can be directly displayed when they are returned as Base64 encoded
byte array. The image type has to be "Database" and you must set the
MimeType to the correct image format.
Note: System.Drawing.Bitmap is not supported.
The relevant section in the RDL file would look similar to this:
<Image>
<MIMEType>image/bmp</MIMEType>
<Source>Database</Source>
<Value>=Fields!InkImage.Value</Value>
...
</Image>
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Shawn Nanto" <ShawnNanto@.discussions.microsoft.com> wrote in message
news:0A54FC08-2ECB-4996-B585-5F7E4BA3A8C9@.microsoft.com...
> PREFACE:
> I have a field in my SQL Server database that is called "Ink" and is Text
as
> the datatype.
> I have put into this field a Base64 String which represents serialized
> digital ink collected on a Tablet PC.
> I wrote a small piece of Custom Code in the Report to de-serialize the ink
> and transform it into System.Drawing.Bitmap, but it does not render in the
> report.
> QUESTION
> Is it possible to display images in a report from a function that returns
a
> data type of System.Drawing.Bitmap?
> If not, can I ask how you are planning to implement digital INK support in
> databases?
>
> --
> Shawn Nanto
> Leszynski Group, Inc.
> Bellevue, WA
Friday, February 24, 2012
Display RTF stored in image data type on SRS Report
In Microsoft Project Server, RTF notes are stored in the field
TASK_NOTES_RTF as a SQL Server image datatype. I am trying to display
the RTF note on a SQL 2000 Reporting Services report.
I need either assembly code or embed code examples.
Thanksunfortinuatly you cant
"SAM" <samb@.sambrooks.com> wrote in message
news:1172779991.405337.35550@.v33g2000cwv.googlegroups.com...
> In Microsoft Project Server, RTF notes are stored in the field
> TASK_NOTES_RTF as a SQL Server image datatype. I am trying to display
> the RTF note on a SQL 2000 Reporting Services report.
> I need either assembly code or embed code examples.
> Thanks
>|||Smokey,
I am currently displaying the ascii content of the TASK_NOTES_RTF field in a
SQL 2000 Reporting Services report, so fortunately, you can.
But, thanks for your input.
"Smokey Grindel" wrote:
> unfortinuatly you cant
> "SAM" <samb@.sambrooks.com> wrote in message
> news:1172779991.405337.35550@.v33g2000cwv.googlegroups.com...
> > In Microsoft Project Server, RTF notes are stored in the field
> > TASK_NOTES_RTF as a SQL Server image datatype. I am trying to display
> > the RTF note on a SQL 2000 Reporting Services report.
> >
> > I need either assembly code or embed code examples.
> >
> > Thanks
> >
>
>|||you cant display it formatted
"SamB" <SamB@.discussions.microsoft.com> wrote in message
news:C0DE0C34-359F-48AE-8127-1623D7D01857@.microsoft.com...
> Smokey,
> I am currently displaying the ascii content of the TASK_NOTES_RTF field in
> a
> SQL 2000 Reporting Services report, so fortunately, you can.
> But, thanks for your input.
> "Smokey Grindel" wrote:
>> unfortinuatly you cant
>> "SAM" <samb@.sambrooks.com> wrote in message
>> news:1172779991.405337.35550@.v33g2000cwv.googlegroups.com...
>> > In Microsoft Project Server, RTF notes are stored in the field
>> > TASK_NOTES_RTF as a SQL Server image datatype. I am trying to display
>> > the RTF note on a SQL 2000 Reporting Services report.
>> >
>> > I need either assembly code or embed code examples.
>> >
>> > Thanks
>> >
>>|||Smokiey,
Learn about instantiation, custom report items, the shift key, and the
apostrophe and you will be surprised at what the difference between "can" and
"can't" is, particlularly "formatted."
Thanks again for your timely reply!
"Smokey Grindel" wrote:
> you cant display it formatted
> "SamB" <SamB@.discussions.microsoft.com> wrote in message
> news:C0DE0C34-359F-48AE-8127-1623D7D01857@.microsoft.com...
> > Smokey,
> >
> > I am currently displaying the ascii content of the TASK_NOTES_RTF field in
> > a
> > SQL 2000 Reporting Services report, so fortunately, you can.
> >
> > But, thanks for your input.
> >
> > "Smokey Grindel" wrote:
> >
> >> unfortinuatly you cant
> >>
> >> "SAM" <samb@.sambrooks.com> wrote in message
> >> news:1172779991.405337.35550@.v33g2000cwv.googlegroups.com...
> >> > In Microsoft Project Server, RTF notes are stored in the field
> >> > TASK_NOTES_RTF as a SQL Server image datatype. I am trying to display
> >> > the RTF note on a SQL 2000 Reporting Services report.
> >> >
> >> > I need either assembly code or embed code examples.
> >> >
> >> > Thanks
> >> >
> >>
> >>
> >>
>
>
TASK_NOTES_RTF as a SQL Server image datatype. I am trying to display
the RTF note on a SQL 2000 Reporting Services report.
I need either assembly code or embed code examples.
Thanksunfortinuatly you cant
"SAM" <samb@.sambrooks.com> wrote in message
news:1172779991.405337.35550@.v33g2000cwv.googlegroups.com...
> In Microsoft Project Server, RTF notes are stored in the field
> TASK_NOTES_RTF as a SQL Server image datatype. I am trying to display
> the RTF note on a SQL 2000 Reporting Services report.
> I need either assembly code or embed code examples.
> Thanks
>|||Smokey,
I am currently displaying the ascii content of the TASK_NOTES_RTF field in a
SQL 2000 Reporting Services report, so fortunately, you can.
But, thanks for your input.
"Smokey Grindel" wrote:
> unfortinuatly you cant
> "SAM" <samb@.sambrooks.com> wrote in message
> news:1172779991.405337.35550@.v33g2000cwv.googlegroups.com...
> > In Microsoft Project Server, RTF notes are stored in the field
> > TASK_NOTES_RTF as a SQL Server image datatype. I am trying to display
> > the RTF note on a SQL 2000 Reporting Services report.
> >
> > I need either assembly code or embed code examples.
> >
> > Thanks
> >
>
>|||you cant display it formatted
"SamB" <SamB@.discussions.microsoft.com> wrote in message
news:C0DE0C34-359F-48AE-8127-1623D7D01857@.microsoft.com...
> Smokey,
> I am currently displaying the ascii content of the TASK_NOTES_RTF field in
> a
> SQL 2000 Reporting Services report, so fortunately, you can.
> But, thanks for your input.
> "Smokey Grindel" wrote:
>> unfortinuatly you cant
>> "SAM" <samb@.sambrooks.com> wrote in message
>> news:1172779991.405337.35550@.v33g2000cwv.googlegroups.com...
>> > In Microsoft Project Server, RTF notes are stored in the field
>> > TASK_NOTES_RTF as a SQL Server image datatype. I am trying to display
>> > the RTF note on a SQL 2000 Reporting Services report.
>> >
>> > I need either assembly code or embed code examples.
>> >
>> > Thanks
>> >
>>|||Smokiey,
Learn about instantiation, custom report items, the shift key, and the
apostrophe and you will be surprised at what the difference between "can" and
"can't" is, particlularly "formatted."
Thanks again for your timely reply!
"Smokey Grindel" wrote:
> you cant display it formatted
> "SamB" <SamB@.discussions.microsoft.com> wrote in message
> news:C0DE0C34-359F-48AE-8127-1623D7D01857@.microsoft.com...
> > Smokey,
> >
> > I am currently displaying the ascii content of the TASK_NOTES_RTF field in
> > a
> > SQL 2000 Reporting Services report, so fortunately, you can.
> >
> > But, thanks for your input.
> >
> > "Smokey Grindel" wrote:
> >
> >> unfortinuatly you cant
> >>
> >> "SAM" <samb@.sambrooks.com> wrote in message
> >> news:1172779991.405337.35550@.v33g2000cwv.googlegroups.com...
> >> > In Microsoft Project Server, RTF notes are stored in the field
> >> > TASK_NOTES_RTF as a SQL Server image datatype. I am trying to display
> >> > the RTF note on a SQL 2000 Reporting Services report.
> >> >
> >> > I need either assembly code or embed code examples.
> >> >
> >> > Thanks
> >> >
> >>
> >>
> >>
>
>
Friday, February 17, 2012
Display Image Datatype from a table in Reporting Services report..!
I have a table that has an image datatype column and I also have a
contant type column in that same table to define which type of data is
stored in that table.
contant type column in that same table to define which type of data is
stored in that table.
In this case a screen shot or may be a word document may be stored in
that table...!
I am trying to use that image datatype field in my report and when they
click some button I needed the reporting service report to open a
window based on the content type and display that image.
Has anyone done this? Any help will be much appreciated...
Thanks in advance...This article might help:
http://support.microsoft.com/defaul...kb;en-us;258038
If not, and you're specifically interested in Reporting Services, then
you might want to post in microsoft.public.sqlserver.reportingsvcs.
Simon
display HTML from a text datatype textbox
I have a textbox in a report defined with a text field from our database that
has HTML in it.
How can I get this to display in HTML format in the report?
StephanieOn Dec 12, 11:29 am, Stephanie <Stepha...@.discussions.microsoft.com>
wrote:
> I have a textbox in a report defined with a text field from our database that
> has HTML in it.
> How can I get this to display in HTML format in the report?
> Stephanie
Can't be done with vanilla Reporting Services 2005. The report
renderer converts all Field data to > and < commands.
You will either have to design your own Custom Control, find one to
purchase out there (I haven't had luck), or go towards ASP or ASP.NET
to dump the query's results into the HTML stream.
-- Scott
has HTML in it.
How can I get this to display in HTML format in the report?
StephanieOn Dec 12, 11:29 am, Stephanie <Stepha...@.discussions.microsoft.com>
wrote:
> I have a textbox in a report defined with a text field from our database that
> has HTML in it.
> How can I get this to display in HTML format in the report?
> Stephanie
Can't be done with vanilla Reporting Services 2005. The report
renderer converts all Field data to > and < commands.
You will either have to design your own Custom Control, find one to
purchase out there (I haven't had luck), or go towards ASP or ASP.NET
to dump the query's results into the HTML stream.
-- Scott
Tuesday, February 14, 2012
display FLOAT datatype with commas?
Is it possible to display a FLOAT datatype with all its commas every
three digits? I can't figure out how to use CAST or CONVERT to do this.
(I know this kind of thing is usually done on the client side, but
that's not possible right now.) Thanks much.here you go
DECLARE @.v float
SELECT @.v = 1322323.6666
SELECT CONVERT(VARCHAR,convert(money,@.v),1)
http://sqlservercode.blogspot.com/|||Why is this a float?
Anyway, see http://tinyurl.com/zlbmw
This is not pretty.
"Rick Charnes" <rickxyz--nospam.zyxcharnes@.thehartford.com> wrote in message
news:MPG.1e7917a698fb998c989921@.msnews.microsoft.com...
> Is it possible to display a FLOAT datatype with all its commas every
> three digits? I can't figure out how to use CAST or CONVERT to do this.
> (I know this kind of thing is usually done on the client side, but
> that's not possible right now.) Thanks much.|||FANTASTIC. Thank you.
Is there a way to right-justify the output? (I know we have character
data now, so it may not be possible?) Thanks.
In article <1141853921.455400.117020@.j52g2000cwj.googlegroups.com>,
denis.gobo@.gmail.com says...
> here you go
> DECLARE @.v float
> SELECT @.v = 1322323.6666
> SELECT CONVERT(VARCHAR,convert(money,@.v),1)
> http://sqlservercode.blogspot.com/
>|||What if it's a bigger FLOAT value than MONEY can support?
DECLARE @.v float
SELECT @.v = 1321324441322323.6666
Also, you should always specify the size of your VARCHAR parameters, IMHO.
"SQL" <denis.gobo@.gmail.com> wrote in message
news:1141853921.455400.117020@.j52g2000cwj.googlegroups.com...
> here you go
> DECLARE @.v float
> SELECT @.v = 1322323.6666
> SELECT CONVERT(VARCHAR,convert(money,@.v),1)
> http://sqlservercode.blogspot.com/
>|||> Is there a way to right-justify the output?
Umm, sure, you could say RIGHT(SPACE(30)+...stuff..., 30)
But what application is consuming this result that can't right-justify ?
Are you going to ask for a way to embed <img> tags next? :-)
T-SQL is not meant to be a presentation language.|||What is the basic principle of a tiered architecture? We do display
formatting in the front end and never in the database. Since FLOAT
can come back as exponential notation, you really don't want to do it
in SQL.|||Brilliant. Thank you VERY much. Much appreciated. I know T-SQL is not
meant to be a presentation language, but for a very quick one-time
temporary project I am forced to use it as such. This is perfect.
Thank you.
In article <OPUigrvQGHA.4956@.TK2MSFTNGP09.phx.gbl>,
ten.xoc@.dnartreb.noraa says...
> Umm, sure, you could say RIGHT(SPACE(30)+...stuff..., 30)
> But what application is consuming this result that can't right-justify ?
> Are you going to ask for a way to embed <img> tags next? :-)
> T-SQL is not meant to be a presentation language.
>
>
three digits? I can't figure out how to use CAST or CONVERT to do this.
(I know this kind of thing is usually done on the client side, but
that's not possible right now.) Thanks much.here you go
DECLARE @.v float
SELECT @.v = 1322323.6666
SELECT CONVERT(VARCHAR,convert(money,@.v),1)
http://sqlservercode.blogspot.com/|||Why is this a float?
Anyway, see http://tinyurl.com/zlbmw
This is not pretty.
"Rick Charnes" <rickxyz--nospam.zyxcharnes@.thehartford.com> wrote in message
news:MPG.1e7917a698fb998c989921@.msnews.microsoft.com...
> Is it possible to display a FLOAT datatype with all its commas every
> three digits? I can't figure out how to use CAST or CONVERT to do this.
> (I know this kind of thing is usually done on the client side, but
> that's not possible right now.) Thanks much.|||FANTASTIC. Thank you.
Is there a way to right-justify the output? (I know we have character
data now, so it may not be possible?) Thanks.
In article <1141853921.455400.117020@.j52g2000cwj.googlegroups.com>,
denis.gobo@.gmail.com says...
> here you go
> DECLARE @.v float
> SELECT @.v = 1322323.6666
> SELECT CONVERT(VARCHAR,convert(money,@.v),1)
> http://sqlservercode.blogspot.com/
>|||What if it's a bigger FLOAT value than MONEY can support?
DECLARE @.v float
SELECT @.v = 1321324441322323.6666
Also, you should always specify the size of your VARCHAR parameters, IMHO.
"SQL" <denis.gobo@.gmail.com> wrote in message
news:1141853921.455400.117020@.j52g2000cwj.googlegroups.com...
> here you go
> DECLARE @.v float
> SELECT @.v = 1322323.6666
> SELECT CONVERT(VARCHAR,convert(money,@.v),1)
> http://sqlservercode.blogspot.com/
>|||> Is there a way to right-justify the output?
Umm, sure, you could say RIGHT(SPACE(30)+...stuff..., 30)
But what application is consuming this result that can't right-justify ?
Are you going to ask for a way to embed <img> tags next? :-)
T-SQL is not meant to be a presentation language.|||What is the basic principle of a tiered architecture? We do display
formatting in the front end and never in the database. Since FLOAT
can come back as exponential notation, you really don't want to do it
in SQL.|||Brilliant. Thank you VERY much. Much appreciated. I know T-SQL is not
meant to be a presentation language, but for a very quick one-time
temporary project I am forced to use it as such. This is perfect.
Thank you.
In article <OPUigrvQGHA.4956@.TK2MSFTNGP09.phx.gbl>,
ten.xoc@.dnartreb.noraa says...
> Umm, sure, you could say RIGHT(SPACE(30)+...stuff..., 30)
> But what application is consuming this result that can't right-justify ?
> Are you going to ask for a way to embed <img> tags next? :-)
> T-SQL is not meant to be a presentation language.
>
>
Subscribe to:
Posts (Atom)