|
-
Jun 28th, 2010, 08:28 AM
#1
Thread Starter
Hyperactive Member
intser HTML into SQL Server
Hi All
Im trying to insert HTML text into a fiel in my table on SQL Server 2005. I then call the string in the tablle via ADO.NET
However, when i copy and paste the following into my field within my table it truncates the text. any ideas on how I can sucessfuly ass the following text int my table?
thanks
Code:
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt">Dear<?xml:namespace prefix = o ns = "“““urn:schemas-microsoft-com:office:office”““" /><o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt"><o:p> </o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><B><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-fareast-language: EN-GB; mso-no-proof: yes">Kind Regards<o:p></o:p></SPAN></B></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><B><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-fareast-language: EN-GB; mso-no-proof: yes"><o:p> </o:p></SPAN></B></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><B><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-fareast-language: EN-GB; mso-no-proof: yes">Shamal Samal<o:p></o:p></SPAN></B></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><B><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-fareast-language: EN-GB; mso-no-proof: yes">Accounts Manager<o:p></o:p></SPAN></B></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-fareast-language: EN-GB; mso-no-proof: yes"><o:p> </o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-fareast-language: EN-GB; mso-no-proof: yes">Tel: + 44 (0)207 100 1919<BR>Fax: +44 (0)203 393 3777<BR><A href="http://www.capitalvisas.com/"><SPAN style="COLOR: blue">www.capitalvisas.com</SPAN></A><o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-fareast-language: EN-GB; mso-no-proof: yes"><o:p> </o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-fareast-language: EN-GB; mso-no-proof: yes">Capital Visas Ltd is authorised and regulated by the Office of the Services of Immigration Commissioner(OISC)<o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-fareast-language: EN-GB; mso-no-proof: yes"><o:p> </o:p></SPAN></P>
<SPAN style="FONT-FAMILY: Webdings; COLOR: green; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-fareast-language: EN-GB; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ansi-language: EN-GB; mso-bidi-language: AR-SA">ü</SPAN><SPAN style="FONT-FAMILY: 'Ocean Sans MT Light'; COLOR: green; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-fareast-language: EN-GB; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ansi-language: EN-GB; mso-bidi-language: AR-SA"> </SPAN><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: green; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-fareast-language: EN-GB; mso-no-proof: yes; mso-ansi-language: EN-GB; mso-bidi-language: AR-SA">Think of the environment - do you really need to print this e-mail?</SPAN><SPAN style="FONT-FAMILY: 'Ocean Sans MT Light'; COLOR: green; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-fareast-language: EN-GB; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ansi-language: EN-GB; mso-bidi-language: AR-SA"> </SPAN><SPAN style="FONT-FAMILY: Webdings; COLOR: green; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-fareast-language: EN-GB; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ansi-language: EN-GB; mso-bidi-language: AR-SA">P</SPAN><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-fareast-language: EN-GB; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ansi-language: EN-GB; mso-bidi-language: AR-SA"><BR> <BR></SPAN><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-fareast-language: EN-GB; mso-no-proof: yes; mso-ansi-language: EN-GB; mso-bidi-language: AR-SA">Capital Visas Limited made the following annotations:<BR><BR>"This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you." <BR><BR>Capital Visas Limited a ajouté le commentaire suivant:<BR><BR>Ce courrier et toute pièce jointe qu'il contient sont réservés au seul destinataire indiqué et peuvent renfermer des renseignements confidentiels et privilégiés. Si vous n'êtes pas le destinataire prévu, toute divulgation, duplication, utilisation ou distribution du courrier ou de toute pièce jointe est interdite. Si vous avez reçu cette communication par erreur, veuillez nous en aviser par courrier et détruire immédiatement le courrier et les pièces jointes. Merci.</SPAN>
-
Jun 28th, 2010, 08:32 AM
#2
Re: intser HTML into SQL Server
What do you mean it truncates the text? How long is the text? How did you define the field? Are you using SSMS to view the posted text, if so there is a limit as to how much text will be brought back from a field in that application.
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Jun 28th, 2010, 08:45 AM
#3
Thread Starter
Hyperactive Member
Re: intser HTML into SQL Server
 Originally Posted by GaryMazzone
What do you mean it truncates the text? How long is the text? How did you define the field? Are you using SSMS to view the posted text, if so there is a limit as to how much text will be brought back from a field in that application.
When I simply copy and paste that peice of HTML into the field it cuts of at the </P> Section
-
Jun 28th, 2010, 08:48 AM
#4
Re: intser HTML into SQL Server
Again... So what is the field definded like? How do you know if is truncated? Do the insert statement report trucnation?
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Jun 28th, 2010, 09:11 AM
#5
Thread Starter
Hyperactive Member
Re: intser HTML into SQL Server
 Originally Posted by GaryMazzone
Again... So what is the field definded like? How do you know if is truncated? Do the insert statement report trucnation?
Hi
The field is defined as nvarchar(MAX)
I know its trucncated because when i copy and paste the text it only pastes a small proportion of it
Code:
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><?xml:namespace prefix = o ns = "‘‘‘‘urn:schemas-microsoft-com:office:office’’’’" /><o:p><FONT face=Calibri> </FONT></o:p></P><P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><o:p><FONT face=Calibri> </FONT></o:p></P><P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="mso-bookmark: _MailAutoSig"><B><SPAN style="COLOR: black; mso-fareast-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-fareast-language: EN-GB; mso-no-proof: yes"><o:p><FONT face=Calibri> </FONT></o:p></SPAN></B></SPAN></P><P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="mso-bookmark: _MailAutoSig"><B><SPAN style="COLOR: black; mso-fareast-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-fareast-language: EN-GB; mso-no-proof: yes"><o:p><FONT face=Calibri> </FONT></o:p></SPAN></B></SPAN></P>
Only the above part is pasted into the field
-
Jun 28th, 2010, 11:50 AM
#6
Re: intser HTML into SQL Server
Again if using SSMS then there is a size limit on what is displayed in any text field. You do not get everything. displayed back.
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Jun 28th, 2010, 12:04 PM
#7
Re: intser HTML into SQL Server
Same thing happens if you run a SELECT Query too... but you can increase the amount of data displayed in the return. From inside SMS, Tools -> Options... select Query Results -> SQL Server -> Results to Text -> Maximum number of characters displayed in each column. By default it's 256...
-tg
-
Jun 29th, 2010, 03:40 AM
#8
Thread Starter
Hyperactive Member
Re: intser HTML into SQL Server
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|