Showing posts with label text. Show all posts
Showing posts with label text. Show all posts

Thursday, March 29, 2012

Dreaded TEXT column

I need to setup repliaction between A and B. I have high transaction /min count. Some tables have TEXT columns. This is what i am planning to do:

Example: table name is CREDITS

vertical partition the table into two. First table (will be called CREDITS_PRI) holds PK column and non TEXT columns, second table (will be called CREDITS_SEC) holds PK column and TEXT columns.

Create a view called CREDITS with INSTEAD OF triggers for inserts, updates and deletes. So far so good. Then setup replication with immediate updating subscription between A and B for tables called ..._PRI and merge replication between A and B for tables called ..._SEC.

Would this work? How do other companies handle this? thank you in advance for pointing me into the right direction.

Lars

Yes, this would work, you could also leave your tables intact the way they were and implement bi-directional transactional replication.

However I assume you're on SQL 2000, correct? If you're on SQL 2005, immediate updating would work just fine if you replaced text datatype with varchar(max) datatype, it's also more optimal and efficient in terms of data storage.

|||

Thank you,

yes, we still are on SQL 2000 and won't upgrade until another 6 months. I have never heard of bi-directional replication since it wasn't mentioned anywhere. I found a great link on MS com and will take a look at it. Thanks again.

L

Drawing Circles and line and text note in report

I am not sure if this is possible with the reporting tool, but I thought I
would ask. In MS Word, you are able to select an option to â'drawâ' a line or
object on the screen. thought that it would be useful to allow a user to add
a circle or line and a text note to the report prior to printing it. I want
to know whether this is possibleExample: if I wanted to circle the name of
one employee on the report before printing it.
Is this possible with the SQL report writer?
Thanks!Currently there is no feature in RS for users to be able to modify the report in anyway after the report is generated, but would like to have this feature in the later versions.
>--Original Message--
>I am not sure if this is possible with the reporting tool, but I thought I >would ask. In MS Word, you are able to select an option to =E2?odraw=E2?=9D a line or >object on the screen. thought that it would be useful to allow a user to add >a circle or line and a text note to the report prior to printing it. I want >to know whether this is possibleExample: if I wanted to circle the name of >one employee on the report before printing it.
>Is this possible with the SQL report writer?
> >Thanks!
> >
>.
>

drawbacks of full text search of sql server 2005

hi,
i m building a big websites which has larger database.so i want to know that what are the drawbacks and benefits of full text search of sql server 2005.
shikha

Quote:

Originally Posted by shikha srivastava

hi,
i m building a big websites which has larger database.so i want to know that what are the drawbacks and benefits of full text search of sql server 2005.
shikha


Hi there,

Not so sure of that issue yet, in fact just got the chance to install MSSQL 2005 today.

Need some time to get familiar with it's features, since it's very new i doubt you can get any feedback within this few weeks. Hang on, give some time, let others to play around with it to learn it's advantages as well as disadvantages.

Good luck & Take care.sql

Sunday, March 25, 2012

downloading data from a table

I need to download all data in a table into a text file or an excel spreadsheet. What would be the easiest way to do this?
Hi,
Please see the reply to the same post in microsoft.public.sqlserver.server
group
Thanks
Hari
"Joel" <anonymous@.discussions.microsoft.com> wrote in message
news:4E7B6116-7F34-47B0-B8C7-055E2DCF1560@.microsoft.com...
> I need to download all data in a table into a text file or an excel
spreadsheet. What would be the easiest way to do this?
>

Thursday, March 22, 2012

download data into text file

I need to download all data in a table into a text file or an excel spreadsheet. What would be the easiest way to do this?
DTS would be the easiest way.
In Enterprise Manager, the shortcut is to right click on the table and choose export data.
|||Hi,
There are 2 options:-
1. DTS (A Graphical interface , you can just by clicking down load the
contents of a table to Text file.
2. BCP OUT (This is command line utility ) ... For more help execute BCP/?
from command prompt.
a. Using query to BCP OUT specific columns
BCP "Select name from dbname..sysusers" QUERYOUT
c:\sysusers.txt -Usa -Ppassword -SServer_name -c
b. BCP OUT entire table
BCP master..sysobjects OUT c:\sysusers.txt -Usa -Ppassword -SServer_name -c
Thanks
Hari
MCDBA
"Ken Dutton" <anonymous@.discussions.microsoft.com> wrote in message
news:00E0DDBA-97BD-4DB0-B582-8D6863E7C6F2@.microsoft.com...
> DTS would be the easiest way.
> In Enterprise Manager, the shortcut is to right click on the table and
choose export data.
|||Hi,
I understand that you want to export the Data in a table to an excel work
sheet or a Text file.
You can achieve this by Import Export Wizard.
In the Enterprise Manager, select the Table from which you want to export
the data .
Right click on that table.
Select All Tasks
Select Export Data
Click on Next - On the Welcome Dialog of DTS Import/Export Wizard
You will get a Choose a Source Dialog. It would by default show the current
database. If that's the database from where you want to export the data,
click on Next
You will get a Choose a Destination Dialog
1. To save the data to Excel (2000 or above) worksheet
a. Select Excel 97 -2 000 in the Destination (from the pull down menu)
b. In the File name option, enter the filename for the output file.
Click on Next
You will see a Specify Table Copy or Query Dialog
Select the "Copy Table(s) and view(s) from the source database
Then Click on NExt
You will get a Select Source Tables and Views Dialog
Select the table from which you want to export the data and then click on
Next.
You will get a Save, Schedule and replicate package dialog.
Select "Run Immediately" option
Click on Next
You will get a Completing the DTS Import/Export Wizard dialog.
Click on Finish
This will successfully create an excel file and populate it with the
records from the selected table.
2. To save the data to Text File
a. Select Text File in the destination (from the pull down menu)
b. in the File Name option ,enter the filename for the output file.
Click on Next
You will see a Specify Table Copy or Query Dialog
Select the "Copy Table(s) and view(s) from the source database
Then Click on NExt
You will get a Select Destination File Format dialog
Select the appropriate format (or leave it to default).
You may want to select the option (First Row has Column Names), to include
the column names in the output
Then Click on NExt
You will get a Save, Schedule and replicate package dialog.
Select "Run Immediately" option
Click on Next
You will get a Completing the DTS Import/Export Wizard dialog.
Click on Finish
This will successfully create an excel file and populate it with the
records from the selected table.
HTH
Ashish
This posting is provided "AS IS" with no warranties, and confers no rights.
|||How about going into EXCEL and DATA>IMPORT EXTERNAL DATA>IMPORT DATA>NEW SQL SERVER CONNECTION.
If the goal is to get SQL data into EXCEL, why use BCP or EM?
|||Yes, that worked very well
Thanks
Joel

download data into text file

I need to download all data in a table into a text file or an excel spreadsh
eet. What would be the easiest way to do this?DTS would be the easiest way.
In Enterprise Manager, the shortcut is to right click on the table and choos
e export data.|||Hi,
There are 2 options:-
1. DTS (A Graphical interface , you can just by clicking down load the
contents of a table to Text file.
2. BCP OUT (This is command line utility ) ... For more help execute BCP/?
from command prompt.
a. Using query to BCP OUT specific columns
BCP "Select name from dbname..sysusers" QUERYOUT
c:\sysusers.txt -Usa -Ppassword -SServer_name -c
b. BCP OUT entire table
BCP master..sysobjects OUT c:\sysusers.txt -Usa -Ppassword -SServer_name -c
Thanks
Hari
MCDBA
"Ken Dutton" <anonymous@.discussions.microsoft.com> wrote in message
news:00E0DDBA-97BD-4DB0-B582-8D6863E7C6F2@.microsoft.com...
> DTS would be the easiest way.
> In Enterprise Manager, the shortcut is to right click on the table and
choose export data.|||Hi,
I understand that you want to export the Data in a table to an excel work
sheet or a Text file.
You can achieve this by Import Export Wizard.
In the Enterprise Manager, select the Table from which you want to export
the data .
Right click on that table.
Select All Tasks
Select Export Data
Click on Next - On the Welcome Dialog of DTS Import/Export Wizard
You will get a Choose a Source Dialog. It would by default show the current
database. If that's the database from where you want to export the data,
click on Next
You will get a Choose a Destination Dialog
1. To save the data to Excel (2000 or above) worksheet
a. Select Excel 97 -2 000 in the Destination (from the pull down menu)
b. In the File name option, enter the filename for the output file.
Click on Next
You will see a Specify Table Copy or Query Dialog
Select the "Copy Table(s) and view(s) from the source database
Then Click on NExt
You will get a Select Source Tables and Views Dialog
Select the table from which you want to export the data and then click on
Next.
You will get a Save, Schedule and replicate package dialog.
Select "Run Immediately" option
Click on Next
You will get a Completing the DTS Import/Export Wizard dialog.
Click on Finish
This will successfully create an excel file and populate it with the
records from the selected table.
2. To save the data to Text File
a. Select Text File in the destination (from the pull down menu)
b. in the File Name option ,enter the filename for the output file.
Click on Next
You will see a Specify Table Copy or Query Dialog
Select the "Copy Table(s) and view(s) from the source database
Then Click on NExt
You will get a Select Destination File Format dialog
Select the appropriate format (or leave it to default).
You may want to select the option (First Row has Column Names), to include
the column names in the output
Then Click on NExt
You will get a Save, Schedule and replicate package dialog.
Select "Run Immediately" option
Click on Next
You will get a Completing the DTS Import/Export Wizard dialog.
Click on Finish
This will successfully create an excel file and populate it with the
records from the selected table.
HTH
Ashish
This posting is provided "AS IS" with no warranties, and confers no rights.|||How about going into EXCEL and DATA>IMPORT EXTERNAL DATA>IMPORT DATA>NEW SQL
SERVER CONNECTION.
If the goal is to get SQL data into EXCEL, why use BCP or EM?|||Yes, that worked very well
Thanks
Joel

download data into text file

I need to download all data in a table into a text file or an excel spreadsheet. What would be the easiest way to do this?DTS would be the easiest way
In Enterprise Manager, the shortcut is to right click on the table and choose export data.|||Hi,
There are 2 options:-
1. DTS (A Graphical interface , you can just by clicking down load the
contents of a table to Text file.
2. BCP OUT (This is command line utility ) ... For more help execute BCP/?
from command prompt.
a. Using query to BCP OUT specific columns
BCP "Select name from dbname..sysusers" QUERYOUT
c:\sysusers.txt -Usa -Ppassword -SServer_name -c
b. BCP OUT entire table
BCP master..sysobjects OUT c:\sysusers.txt -Usa -Ppassword -SServer_name -c
Thanks
Hari
MCDBA
"Ken Dutton" <anonymous@.discussions.microsoft.com> wrote in message
news:00E0DDBA-97BD-4DB0-B582-8D6863E7C6F2@.microsoft.com...
> DTS would be the easiest way.
> In Enterprise Manager, the shortcut is to right click on the table and
choose export data.|||Hi,
I understand that you want to export the Data in a table to an excel work
sheet or a Text file.
You can achieve this by Import Export Wizard.
In the Enterprise Manager, select the Table from which you want to export
the data .
Right click on that table.
Select All Tasks
Select Export Data
Click on Next - On the Welcome Dialog of DTS Import/Export Wizard
You will get a Choose a Source Dialog. It would by default show the current
database. If that's the database from where you want to export the data,
click on Next
You will get a Choose a Destination Dialog
1. To save the data to Excel (2000 or above) worksheet
a. Select Excel 97 -2 000 in the Destination (from the pull down menu)
b. In the File name option, enter the filename for the output file.
Click on Next
You will see a Specify Table Copy or Query Dialog
Select the "Copy Table(s) and view(s) from the source database
Then Click on NExt
You will get a Select Source Tables and Views Dialog
Select the table from which you want to export the data and then click on
Next.
You will get a Save, Schedule and replicate package dialog.
Select "Run Immediately" option
Click on Next
You will get a Completing the DTS Import/Export Wizard dialog.
Click on Finish
This will successfully create an excel file and populate it with the
records from the selected table.
2. To save the data to Text File
a. Select Text File in the destination (from the pull down menu)
b. in the File Name option ,enter the filename for the output file.
Click on Next
You will see a Specify Table Copy or Query Dialog
Select the "Copy Table(s) and view(s) from the source database
Then Click on NExt
You will get a Select Destination File Format dialog
Select the appropriate format (or leave it to default).
You may want to select the option (First Row has Column Names), to include
the column names in the output
Then Click on NExt
You will get a Save, Schedule and replicate package dialog.
Select "Run Immediately" option
Click on Next
You will get a Completing the DTS Import/Export Wizard dialog.
Click on Finish
This will successfully create an excel file and populate it with the
records from the selected table.
HTH
Ashish
This posting is provided "AS IS" with no warranties, and confers no rights.

Monday, March 19, 2012

doubt about sqlserver data types

I'm working with sqlserver express 2005, and I have a lot of doubts about what sqlserver data types use. More exactly my doubt is about text types... nchar, nvarchar, varchar... what are the differences?

thanks.::More exactly my doubt is about text types... nchar, nvarchar, varchar... what are the
::differences?

I really hate to tell you, but there is a documentation for SQL Server that has exact definitions of every data type.

Sunday, March 11, 2012

Double Line border turn to be single in Reporting Service

I tried to set double in bottom border of text file. But it turned out to be single line either Previewing in Designer or Printing or Exporting to PDF. Does anyone have any idea?Try to increase width to at least 3pt|||

Thank you for your post, Lev. I just tried that. But it seems not working even I set borderwidth to 5pt. I found double line is OK only when exporting to excel. Does anyone else have the same issue with me?

|||

What version of RS are you using? Are you viewing the PDF at 100% zoom? It should work with a width of >3pt.

Thank you.

|||

Dear Donovan,

I tried again after your reply. It did work this time. There must be somewhere wrong while I did my test yesterday.

Thank both of you, Lev & Donovan!

Cheers!

|||I am having the exact same problem. I am using RS2005. I set the bottom border to double. I have tried changing the border width and this just makes the single line that is displayed thicker. If I export to Excel, I can see the double line, otherwise in preview, pdf, etc, I only see the single line. Any other ideas?|||

Could this be the result of border clipping? Is the report item you placed the double border on inside of another item? A border starts at the edge of a report item and extends out half the width on each side of this edge. If the item with a border is contained inside another item, any of the border that extends beyond the bounds of that container will be clipped. In this way, a double border will appear to show only a single border if half of it is clipped.

If that's not the case, would you please either post a simple demonstration RDL to this thread or open a bug on http://connect.microsoft.com so I can take a look?

Thank you.

|||It looks like the border is being "clipped off". I am using a matrix to display the data. The very last row of the matrix is where I am attempting to set the bottom border as double. If I add another row below this one, the double border is displayed correctly.

Double Line border turn to be single in Reporting Service

I tried to set double in bottom border of text file. But it turned out to be single line either Previewing in Designer or Printing or Exporting to PDF. Does anyone have any idea?Try to increase width to at least 3pt|||

Thank you for your post, Lev. I just tried that. But it seems not working even I set borderwidth to 5pt. I found double line is OK only when exporting to excel. Does anyone else have the same issue with me?

|||

What version of RS are you using? Are you viewing the PDF at 100% zoom? It should work with a width of >3pt.

Thank you.

|||

Dear Donovan,

I tried again after your reply. It did work this time. There must be somewhere wrong while I did my test yesterday.

Thank both of you, Lev & Donovan!

Cheers!

|||I am having the exact same problem. I am using RS2005. I set the bottom border to double. I have tried changing the border width and this just makes the single line that is displayed thicker. If I export to Excel, I can see the double line, otherwise in preview, pdf, etc, I only see the single line. Any other ideas?|||

Could this be the result of border clipping? Is the report item you placed the double border on inside of another item? A border starts at the edge of a report item and extends out half the width on each side of this edge. If the item with a border is contained inside another item, any of the border that extends beyond the bounds of that container will be clipped. In this way, a double border will appear to show only a single border if half of it is clipped.

If that's not the case, would you please either post a simple demonstration RDL to this thread or open a bug on http://connect.microsoft.com so I can take a look?

Thank you.

|||It looks like the border is being "clipped off". I am using a matrix to display the data. The very last row of the matrix is where I am attempting to set the bottom border as double. If I add another row below this one, the double border is displayed correctly.

Friday, March 9, 2012

Double Byte Characters scrambled in PDF Output

Does anybody know how I can Clean up some European Characters such as "?"
in a text field:
"45000 m² new office project designed by Arquitectonica. Revised proposal
and clarifications issued to client on 26 Aug: 1239K? for MOEX, 985K for
Synthese as option. Ten competitors, including Coteba. Contract award
expected by 15 Sept 04."
Is there a certain data type to use or is there a conversion fucntion to
use?
HelpWhat you can do in this case is :
write custom code for all the clean up.
You can write code tab of the Report Properties in the Report tab under main menu.
Write your own VB.NET code.
>--Original Message--
>Does anybody know how I can Clean up some European Characters such as "?"
>in a text field:
>"45000 m=B2 new office project designed by Arquitectonica. Revised proposal
>and clarifications issued to client on 26 Aug: 1239K? for MOEX, 985K for
>Synthese as option. Ten competitors, including Coteba. Contract award
>expected by 15 Sept 04."
>Is there a certain data type to use or is there a conversion fucntion to
>use?
>Help
>
>.
>

Double Byte Character Problem

I am storing text in sql server 2000. DataType for the field is ntext. I am
storing a string which has characters both in english and in Japanese. If the
number of characters in string are upto 4000 then every thing works fine. If
I retrieve the data it shows me exactly the string which I stored. But the
moment chracters exceed 4000(even 4001) the japanese characters are converted
to question mark("?") . Collation for the database is
SQL_Latin1_General_CP1_Cl_AS. Please help me.
Thank you.
Junaid Rehman
Are you observing this behavior from Query Analyzer or your application
program?
Hope this helps.
Dan Guzman
SQL Server MVP
"rehmanjr" <rehmanjr@.discussions.microsoft.com> wrote in message
news:29958380-55A3-4BC7-9383-5DE2738B0120@.microsoft.com...
>I am storing text in sql server 2000. DataType for the field is ntext. I am
> storing a string which has characters both in english and in Japanese. If
> the
> number of characters in string are upto 4000 then every thing works fine.
> If
> I retrieve the data it shows me exactly the string which I stored. But the
> moment chracters exceed 4000(even 4001) the japanese characters are
> converted
> to question mark("?") . Collation for the database is
> SQL_Latin1_General_CP1_Cl_AS. Please help me.
> Thank you.
> Junaid Rehman
|||I made a simple page in vb.net which has two textboxes and a submit button. I
enter the text in first textbox and when I submit the form data is inserted
into database. When the characters entered in textbox are less then 4000 the
data which is inserted in database has japanese characters represented as
small boxes. Then I retrieve the the data stored in database in 2nd textbox
and it appears fine. But when characters entered in first textbox exceed 4000
the data which is inserted into database has japanese characters converted to
question mark("?") instead of those small boxes (which were there earlier
when characters were less then 4000). When I retrieve this text in 2nd box it
shows question marks instead of Japanese characters. I explained it in bit
detail so that you know what I am exactly doing.
Junaid Rehman
"Dan Guzman" wrote:

> Are you observing this behavior from Query Analyzer or your application
> program?
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "rehmanjr" <rehmanjr@.discussions.microsoft.com> wrote in message
> news:29958380-55A3-4BC7-9383-5DE2738B0120@.microsoft.com...
>
>
|||Below is a code snippet that properly stores unicode values as described in
your narrative. Also, I used a font that properly rendered the unicode
characters. You might check this against your code. If you still have
problems, please post your code.
Dim mySqlConnection As New SqlConnection(connectionString)
mySqlConnection.Open()
Dim mySqlCommand As New SqlCommand
mySqlCommand.Connection = mySqlConnection
'create test table
mySqlCommand.CommandText = "CREATE TABLE #MyTable(MyData ntext)"
mySqlCommand.ExecuteNonQuery()
'create unicode value from form
mySqlCommand.CommandText = "INSERT INTO #MyTable VALUES(@.MyData)"
Dim myDataParamter As New SqlParameter("@.MyData", SqlDbType.NText)
myDataParamter.Value = Me.TextBox1.Text
mySqlCommand.Parameters.Add(myDataParamter)
mySqlCommand.ExecuteNonQuery()
'retrieve inserted value
mySqlCommand.CommandText = "SELECT MyData FROM #MyTable"
Dim SqlDataReader As SqlDataReader = mySqlCommand.ExecuteReader
SqlDataReader.Read()
Me.TextBox2.Text = SqlDataReader.GetString(0)
SqlDataReader.Close()
'cleanup
mySqlCommand.CommandText = "DROP TABLE #MyTable"
mySqlCommand.ExecuteNonQuery()
mySqlConnection.Close()
Hope this helps.
Dan Guzman
SQL Server MVP
"rehmanjr" <rehmanjr@.discussions.microsoft.com> wrote in message
news:6C3267D6-DD99-417A-9B65-D40FE6217DF2@.microsoft.com...[vbcol=seagreen]
>I made a simple page in vb.net which has two textboxes and a submit button.
>I
> enter the text in first textbox and when I submit the form data is
> inserted
> into database. When the characters entered in textbox are less then 4000
> the
> data which is inserted in database has japanese characters represented as
> small boxes. Then I retrieve the the data stored in database in 2nd
> textbox
> and it appears fine. But when characters entered in first textbox exceed
> 4000
> the data which is inserted into database has japanese characters converted
> to
> question mark("?") instead of those small boxes (which were there earlier
> when characters were less then 4000). When I retrieve this text in 2nd box
> it
> shows question marks instead of Japanese characters. I explained it in bit
> detail so that you know what I am exactly doing.
> Junaid Rehman
> "Dan Guzman" wrote:

Double Byte Character Problem

I am storing text in sql server 2000. DataType for the field is ntext. I am
storing a string which has characters both in english and in Japanese. If the
number of characters in string are upto 4000 then every thing works fine. If
I retrieve the data it shows me exactly the string which I stored. But the
moment chracters exceed 4000(even 4001) the japanese characters are converted
to question mark("?") . Collation for the database is
SQL_Latin1_General_CP1_Cl_AS. Please help me.
Thank you.
Junaid RehmanAre you observing this behavior from Query Analyzer or your application
program?
--
Hope this helps.
Dan Guzman
SQL Server MVP
"rehmanjr" <rehmanjr@.discussions.microsoft.com> wrote in message
news:29958380-55A3-4BC7-9383-5DE2738B0120@.microsoft.com...
>I am storing text in sql server 2000. DataType for the field is ntext. I am
> storing a string which has characters both in english and in Japanese. If
> the
> number of characters in string are upto 4000 then every thing works fine.
> If
> I retrieve the data it shows me exactly the string which I stored. But the
> moment chracters exceed 4000(even 4001) the japanese characters are
> converted
> to question mark("?") . Collation for the database is
> SQL_Latin1_General_CP1_Cl_AS. Please help me.
> Thank you.
> Junaid Rehman|||I made a simple page in vb.net which has two textboxes and a submit button. I
enter the text in first textbox and when I submit the form data is inserted
into database. When the characters entered in textbox are less then 4000 the
data which is inserted in database has japanese characters represented as
small boxes. Then I retrieve the the data stored in database in 2nd textbox
and it appears fine. But when characters entered in first textbox exceed 4000
the data which is inserted into database has japanese characters converted to
question mark("?") instead of those small boxes (which were there earlier
when characters were less then 4000). When I retrieve this text in 2nd box it
shows question marks instead of Japanese characters. I explained it in bit
detail so that you know what I am exactly doing.
Junaid Rehman
"Dan Guzman" wrote:
> Are you observing this behavior from Query Analyzer or your application
> program?
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "rehmanjr" <rehmanjr@.discussions.microsoft.com> wrote in message
> news:29958380-55A3-4BC7-9383-5DE2738B0120@.microsoft.com...
> >I am storing text in sql server 2000. DataType for the field is ntext. I am
> > storing a string which has characters both in english and in Japanese. If
> > the
> > number of characters in string are upto 4000 then every thing works fine.
> > If
> > I retrieve the data it shows me exactly the string which I stored. But the
> > moment chracters exceed 4000(even 4001) the japanese characters are
> > converted
> > to question mark("?") . Collation for the database is
> > SQL_Latin1_General_CP1_Cl_AS. Please help me.
> > Thank you.
> >
> > Junaid Rehman
>
>|||Below is a code snippet that properly stores unicode values as described in
your narrative. Also, I used a font that properly rendered the unicode
characters. You might check this against your code. If you still have
problems, please post your code.
Dim mySqlConnection As New SqlConnection(connectionString)
mySqlConnection.Open()
Dim mySqlCommand As New SqlCommand
mySqlCommand.Connection = mySqlConnection
'create test table
mySqlCommand.CommandText = "CREATE TABLE #MyTable(MyData ntext)"
mySqlCommand.ExecuteNonQuery()
'create unicode value from form
mySqlCommand.CommandText = "INSERT INTO #MyTable VALUES(@.MyData)"
Dim myDataParamter As New SqlParameter("@.MyData", SqlDbType.NText)
myDataParamter.Value = Me.TextBox1.Text
mySqlCommand.Parameters.Add(myDataParamter)
mySqlCommand.ExecuteNonQuery()
'retrieve inserted value
mySqlCommand.CommandText = "SELECT MyData FROM #MyTable"
Dim SqlDataReader As SqlDataReader = mySqlCommand.ExecuteReader
SqlDataReader.Read()
Me.TextBox2.Text = SqlDataReader.GetString(0)
SqlDataReader.Close()
'cleanup
mySqlCommand.CommandText = "DROP TABLE #MyTable"
mySqlCommand.ExecuteNonQuery()
mySqlConnection.Close()
--
Hope this helps.
Dan Guzman
SQL Server MVP
"rehmanjr" <rehmanjr@.discussions.microsoft.com> wrote in message
news:6C3267D6-DD99-417A-9B65-D40FE6217DF2@.microsoft.com...
>I made a simple page in vb.net which has two textboxes and a submit button.
>I
> enter the text in first textbox and when I submit the form data is
> inserted
> into database. When the characters entered in textbox are less then 4000
> the
> data which is inserted in database has japanese characters represented as
> small boxes. Then I retrieve the the data stored in database in 2nd
> textbox
> and it appears fine. But when characters entered in first textbox exceed
> 4000
> the data which is inserted into database has japanese characters converted
> to
> question mark("?") instead of those small boxes (which were there earlier
> when characters were less then 4000). When I retrieve this text in 2nd box
> it
> shows question marks instead of Japanese characters. I explained it in bit
> detail so that you know what I am exactly doing.
> Junaid Rehman
> "Dan Guzman" wrote:
>> Are you observing this behavior from Query Analyzer or your application
>> program?
>> --
>> Hope this helps.
>> Dan Guzman
>> SQL Server MVP
>> "rehmanjr" <rehmanjr@.discussions.microsoft.com> wrote in message
>> news:29958380-55A3-4BC7-9383-5DE2738B0120@.microsoft.com...
>> >I am storing text in sql server 2000. DataType for the field is ntext. I
>> >am
>> > storing a string which has characters both in english and in Japanese.
>> > If
>> > the
>> > number of characters in string are upto 4000 then every thing works
>> > fine.
>> > If
>> > I retrieve the data it shows me exactly the string which I stored. But
>> > the
>> > moment chracters exceed 4000(even 4001) the japanese characters are
>> > converted
>> > to question mark("?") . Collation for the database is
>> > SQL_Latin1_General_CP1_Cl_AS. Please help me.
>> > Thank you.
>> >
>> > Junaid Rehman
>>

Don't want escape characters in results

Hi, I have a varchar column containing text which is actually fragments of
HTML.
eg:
<p>sometext</p>
When I retrieve the data using FOR XML I get results with escaped
characters:
<p>sometext</p>
Is there any way to turn off the escaping and just return the actual data?
Thanks!Can you give an example of the query you are using?
You may simply be able to explicitly cast your varchar
column to xml.|||Nice Sunday.
First of all, your HTML string should be well-formed in XML perspective. If
not, resultant XML will be broken. If you have no problem for your string,
just try this script, and see if this makes any sense for you. You may make
some UDF to make the job more convenient.
drop table t1
go
create table t1 (t varchar(10))
insert into t1 values (N'<a/>')
declare @.x xml
set @.x=(select top 1 t from t1)
select @.x
Pohwan Han. Seoul. Have a nice day.
"Paul Robinson" <robinsonpr@.aol.com> wrote in message
news:uCpDPbddGHA.4128@.TK2MSFTNGP05.phx.gbl...
> Hi, I have a varchar column containing text which is actually fragments of
> HTML.
> eg:
> <p>sometext</p>
> When I retrieve the data using FOR XML I get results with escaped
> characters:
> <p>sometext</p>
>
> Is there any way to turn off the escaping and just return the actual data?
> Thanks!
>|||Or convert(),
select convert(xml, t) from t1
Optionally, if your HTML is not well-formed and just want to show the HTML
in browser as HTML, you can use some mid-tier like XSLT with
disable-output-escaping attribute.
Pohwan Han. Seoul. Have a nice day.
"Han" <hp4444@.kornet.net.korea> wrote in message
news:%23hNpSPydGHA.2416@.TK2MSFTNGP03.phx.gbl...
> Nice Sunday.
> First of all, your HTML string should be well-formed in XML perspective.
> If not, resultant XML will be broken. If you have no problem for your
> string, just try this script, and see if this makes any sense for you. You
> may make some UDF to make the job more convenient.
> drop table t1
> go
> create table t1 (t varchar(10))
> insert into t1 values (N'<a/>')
> declare @.x xml
> set @.x=(select top 1 t from t1)
> select @.x
> --
> Pohwan Han. Seoul. Have a nice day.
> "Paul Robinson" <robinsonpr@.aol.com> wrote in message
> news:uCpDPbddGHA.4128@.TK2MSFTNGP05.phx.gbl...
>|||I'm using SQLServer2000.
An example query is below (there are more columns but I've just cut it down
to one to illustrate the problem:
select 1 AS [Tag], 0 AS [Parent],
varMemo AS [memo!1!!element],
from memo
FOR XML EXPLICIT
Result:
<memo><p>my test data.</p></memo>
The data column which is a varchar contains this:
<p>my test data.</p>
What I want out is:
<memo><p>my test data.</p></memo>
<markc600@.hotmail.com> wrote in message
news:1147450841.895258.275160@.i39g2000cwa.googlegroups.com...
> Can you give an example of the query you are using?
> You may simply be able to explicitly cast your varchar
> column to xml.
>|||Ah slight problem with the xml data type - we're using SQLServer2000. I
just posted the example query in another part of the thread!
Thanks...
"Han" <hp4444@.kornet.net.korea> wrote in message
news:%23hNpSPydGHA.2416@.TK2MSFTNGP03.phx.gbl...
> Nice Sunday.
> First of all, your HTML string should be well-formed in XML perspective.
If
> not, resultant XML will be broken. If you have no problem for your string,
> just try this script, and see if this makes any sense for you. You may
make
> some UDF to make the job more convenient.
> drop table t1
> go
> create table t1 (t varchar(10))
> insert into t1 values (N'<a/>')
> declare @.x xml
> set @.x=(select top 1 t from t1)
> select @.x
> --
> Pohwan Han. Seoul. Have a nice day.
> "Paul Robinson" <robinsonpr@.aol.com> wrote in message
> news:uCpDPbddGHA.4128@.TK2MSFTNGP05.phx.gbl...
of
data?
>|||Try changing
varMemo AS [memo!1!!element],
to
varMemo AS [memo!1!!xml],|||That's got it! Many thanks, I appreciate the help!!
<markc600@.hotmail.com> wrote in message
news:1147684296.310383.20930@.u72g2000cwu.googlegroups.com...
> Try changing
> varMemo AS [memo!1!!element],
> to
> varMemo AS [memo!1!!xml],
>