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

Friday, March 30, 2012

how can i connect to sqlserver express manually when i use text boxed

hi guys,


i am very happy that i found this forum which discuss ASP.net.
i am new to ASP.net 2.0 and some need serious help. when i debug my application and try to insert data an error occur saying:

"Cannot open database "ecb" requested by the login. The login failed. Login failed for user 'HOME-USER\user'."

the code that i have used to submit data is as follow:

Imports System.Data.SqlClient
...
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click

Dim objConn As SqlConnection
Dim objCmd As SqlCommand

objconn =New SqlConnection("data source= localhost\sqlexpress; initial catalog =ecb; persist security info =true; trusted_connection=true")

objCmd = New SqlCommand("INSERT INTO staff (firstname, surname) VALUES (@.firstname, @.surname,)", objConn)

objCmd.Parameters.Add("@.FirstName", Data.SqlDbType.VarChar).Value = txtFirstName.Text
objCmd.Parameters.Add("@.Surname", Data.SqlDbType.VarChar).Value = txtSurname.Text

objConn.Open()
objCmd.ExecuteNonQuery()
objConn.Close()

i also used this data connection but didn't help:
objconn = New SqlConnection("Server=localhost; Database=ecb;user ID=' ';Password=' ' ") when i use this data

connection i get this message: Login failed for user ''. The user is not associated with a trusted SQL Server connection.

as far as i can remember i have used windows authentication when creating my database in sql server 200 express edition.

the funny thing is that when i use datagrid wizard or dataform the connection is fine ( i mean is automatically done for me but i don't know when i like to do it manually does not work).

can anyone help? thank you in advanced

Hi!

My guess is going to be that you have selected Mixed Authentication mode when you installed the server. Try specifying login details in your connection string. My guess is going to be 'ASPNET' for username and "" for password.

Something else:

What i could recommend you to do is to have a look at this link:http://www.asp.net/default.aspx?tabindex=4&tabid=3000. See Working with "Gridview and Formview"

If you are only updating Firstname and Surnames fields and other basic tasks, then you might rather want to make use of the visual tools in VWD to accomplish this.

|||

hi again:

thank you for your help. Anyway it sounds like is not working. i have tried many many solutions but all failed. however my question here can i uninstall SQL server express edition while keeping hold of the tables that i have done (is quite important)? and then reinstall the application just to make sure that the authentication level i will use is correct ( because i can't remember whether i have used sql server authentication or windows based authentication.!!!

do you thing is a good solution? if yes would you please tell me how to keep the tables and uninstall the application?

Many thanks saif44

|||

If you have created the website in your file system then its all fine. If you really want to then just make a back up of the folder.

You can go ahead and do a re-installation.

It really hard to say if its a good solution. I cant say. It's def worth a tryWink [;)]

|||

Hello Saif,

This might help, I was having the same issue and this is one way to figure out your connection string.

Use your datagrid wizard and create a valid connection and make sure it works, then go back to your datagrid and go to configure data source.

This takes you to choose your data connection menu and the current connection that your datagid is using will be selected in the drop down list. Below the drop down list is a box with a + and the words connection string across from it. Click the + button and the connection string that was generated by the wizard will be shown. That should be your valid connection string that works.

A nicer way of doing it is to create the connection string in the web.config file and then reference the connection string name in your code.

for example in my web.config file I have this connection string:

<connectionStrings>

<removename="LocalSqlServer"/>

<addname="LocalSqlServer"connectionString="Server=[your server name];Database=[ur dbase name];User ID=;Password=;Trusted_Connection=False"/>

</connectionString>

Now I can reference the connection string programatical in my code as such:

Using connectionAsNew SqlConnection(ConfigurationManager.ConnectionStrings"LocalSqlServer").ConnectionString)

....[my code here]

end using

Of course this is just a short explanation, hopefully it gets you in the right direction.

The best resource I have found for asp.net is from 4guysfromRolla.com, this is their article on connection to a database:

http://aspnet.4guysfromrolla.com/articles/022206-1.aspx

thanks,

manny

|||Thank you very very much Manny. the problem is sloved. However, there is another problem with

objCmd.ExecuteNonQuery() it triggers a message saying "Invalid object name 'staff ' ". i don't know why this is happening?' Staff ' is the name of my table i am using and its syntax is correct.

please can you review this code for me and tell me what's wrong with it:

............

objconn =New SqlConnection(ConfigurationManager.ConnectionStrings("localsqlserver").ConnectionString)

objCmd =New SqlCommand("INSERT INTO staff(staffno, FirstName, Surname, DateRegistered) _

values (@.staffno, @.firstname, @.surname, @.dateregistered)", objconn

objCmd.Parameters.Add("@.StaffNo", Data.SqlDbType.Int).Value = txtStaffNo.Text

objCmd.Parameters.Add("@.FirstName", Data.SqlDbType.VarChar).Value = txtFirstName.Text

objCmd.Parameters.Add("@.Surname", Data.SqlDbType.VarChar).Value = txtSurname.Text

objCmd.Parameters.Add("@.DateRegistered", Data.SqlDbType.SmallDateTime).Value = txtRegDate.Text

objConn.Open()

objCmd.ExecuteNonQuery()

objConn.Close()

Response.Redirect("addstaff.aspx")

I have to say here that i am using an automatic insertion of the StaffNo when i first created the data definition table. do you think the code above is correct for the StaffNo? and what do you think it does cause the above error message to be trigged.

thank you very much for your help

Monday, March 26, 2012

How can I change the default location of full text catalog?

Our current full text catalog default location is C:\Program Files\Microsoft SQL Server\MSSQL.5\MSSQL\FTData, we want change the default location to c:\data\MSSQL.5\FTData, so all the FT catalog will be created in this new location. Can anyone tell me how to do it?

Thanks

ShihChao

See SQL Server 2005 Books Online topic:

CREATE FULLTEXT CATALOG (Transact-SQL)

If you use T-SQL you can specify the path.

The topic states “IN PATH 'rootpath'

Is the root directory for the catalog. If rootpath is not specified, the new catalog will be located in the default directory specified at setup.”

Full-text catalogs must be created on a local hard disk drive associated with an instance of SQL Server. rootpath cannot be a relative path; it must reside on a drive on the same computer.

As you probably know you can specify the path when you use the UI. It does not default to any path.

|||

Also…you can use regedit at your own risk to change the default fulltext path

HKEY_LOCAL_MACHINE/Software/Microsoft/Microsoft SQL Server/MSSQL.x/MSSQLServer/FullTextDefaultPath – specify path

The restart SQL Server service

|||Thanks all all the replies

How can I change a column with datatype "text" to "int"?

I made a mistake when I first created the column and just found out when I
tried to calculate. I tried using the design feature on Enterprise Manager,
but got an error message that this couldn't be done. Any help is deeply
appreciate.Don't use Enterprise Manager for this. Open Query Analyzer and connect to
the correct database.
-- add a new column to the table;
ALTER TABLE tablename ADD temp_column INT;
-- copy the data from the text column;
UPDATE tablename SET temp_column = text_column WHERE ISNUMERIC(text_column)
= 1;
-- drop the text column;
ALTER TABLE tablename DROP COLUMN text_column;
-- rename the new column;
EXEC sp_rename 'tablename.temp_column', 'real_column', 'COLUMN';
Of course, you'll want to put in the correct names for tablename,
text_column, real_column, etc.
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006
"Karolus" <Karolus@.discussions.microsoft.com> wrote in message
news:3B1473BD-7C92-4D18-80FF-F0DEE26C408F@.microsoft.com...
>I made a mistake when I first created the column and just found out when I
> tried to calculate. I tried using the design feature on Enterprise
> Manager,
> but got an error message that this couldn't be done. Any help is deeply
> appreciate.|||Thank you, Aaaron. I will use what you provided and make the change. Thanks
mucho. karolus
"Aaron Bertrand [SQL Server MVP]" wrote:
> Don't use Enterprise Manager for this. Open Query Analyzer and connect to
> the correct database.
> -- add a new column to the table;
> ALTER TABLE tablename ADD temp_column INT;
> -- copy the data from the text column;
> UPDATE tablename SET temp_column = text_column WHERE ISNUMERIC(text_column)
> = 1;
> -- drop the text column;
> ALTER TABLE tablename DROP COLUMN text_column;
> -- rename the new column;
> EXEC sp_rename 'tablename.temp_column', 'real_column', 'COLUMN';
> Of course, you'll want to put in the correct names for tablename,
> text_column, real_column, etc.
>
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.sqlblog.com/
> http://www.aspfaq.com/5006
> "Karolus" <Karolus@.discussions.microsoft.com> wrote in message
> news:3B1473BD-7C92-4D18-80FF-F0DEE26C408F@.microsoft.com...
> >I made a mistake when I first created the column and just found out when I
> > tried to calculate. I tried using the design feature on Enterprise
> > Manager,
> > but got an error message that this couldn't be done. Any help is deeply
> > appreciate.
>
>

How can I change a column with datatype "text" to "int"?

I made a mistake when I first created the column and just found out when I
tried to calculate. I tried using the design feature on Enterprise Manager,
but got an error message that this couldn't be done. Any help is deeply
appreciate.
Don't use Enterprise Manager for this. Open Query Analyzer and connect to
the correct database.
-- add a new column to the table;
ALTER TABLE tablename ADD temp_column INT;
-- copy the data from the text column;
UPDATE tablename SET temp_column = text_column WHERE ISNUMERIC(text_column)
= 1;
-- drop the text column;
ALTER TABLE tablename DROP COLUMN text_column;
-- rename the new column;
EXEC sp_rename 'tablename.temp_column', 'real_column', 'COLUMN';
Of course, you'll want to put in the correct names for tablename,
text_column, real_column, etc.
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006
"Karolus" <Karolus@.discussions.microsoft.com> wrote in message
news:3B1473BD-7C92-4D18-80FF-F0DEE26C408F@.microsoft.com...
>I made a mistake when I first created the column and just found out when I
> tried to calculate. I tried using the design feature on Enterprise
> Manager,
> but got an error message that this couldn't be done. Any help is deeply
> appreciate.
|||Thank you, Aaaron. I will use what you provided and make the change. Thanks
mucho. karolus
"Aaron Bertrand [SQL Server MVP]" wrote:

> Don't use Enterprise Manager for this. Open Query Analyzer and connect to
> the correct database.
> -- add a new column to the table;
> ALTER TABLE tablename ADD temp_column INT;
> -- copy the data from the text column;
> UPDATE tablename SET temp_column = text_column WHERE ISNUMERIC(text_column)
> = 1;
> -- drop the text column;
> ALTER TABLE tablename DROP COLUMN text_column;
> -- rename the new column;
> EXEC sp_rename 'tablename.temp_column', 'real_column', 'COLUMN';
> Of course, you'll want to put in the correct names for tablename,
> text_column, real_column, etc.
>
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.sqlblog.com/
> http://www.aspfaq.com/5006
> "Karolus" <Karolus@.discussions.microsoft.com> wrote in message
> news:3B1473BD-7C92-4D18-80FF-F0DEE26C408F@.microsoft.com...
>
>

How can I change a column with datatype "text" to "int"?

I made a mistake when I first created the column and just found out when I
tried to calculate. I tried using the design feature on Enterprise Manager,
but got an error message that this couldn't be done. Any help is deeply
appreciate.Don't use Enterprise Manager for this. Open Query Analyzer and connect to
the correct database.
-- add a new column to the table;
ALTER TABLE tablename ADD temp_column INT;
-- copy the data from the text column;
UPDATE tablename SET temp_column = text_column WHERE ISNUMERIC(text_column)
= 1;
-- drop the text column;
ALTER TABLE tablename DROP COLUMN text_column;
-- rename the new column;
EXEC sp_rename 'tablename.temp_column', 'real_column', 'COLUMN';
Of course, you'll want to put in the correct names for tablename,
text_column, real_column, etc.
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006
"Karolus" <Karolus@.discussions.microsoft.com> wrote in message
news:3B1473BD-7C92-4D18-80FF-F0DEE26C408F@.microsoft.com...
>I made a mistake when I first created the column and just found out when I
> tried to calculate. I tried using the design feature on Enterprise
> Manager,
> but got an error message that this couldn't be done. Any help is deeply
> appreciate.|||Thank you, Aaaron. I will use what you provided and make the change. Thank
s
mucho. karolus
"Aaron Bertrand [SQL Server MVP]" wrote:

> Don't use Enterprise Manager for this. Open Query Analyzer and connect to
> the correct database.
> -- add a new column to the table;
> ALTER TABLE tablename ADD temp_column INT;
> -- copy the data from the text column;
> UPDATE tablename SET temp_column = text_column WHERE ISNUMERIC(text_column
)
> = 1;
> -- drop the text column;
> ALTER TABLE tablename DROP COLUMN text_column;
> -- rename the new column;
> EXEC sp_rename 'tablename.temp_column', 'real_column', 'COLUMN';
> Of course, you'll want to put in the correct names for tablename,
> text_column, real_column, etc.
>
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.sqlblog.com/
> http://www.aspfaq.com/5006
> "Karolus" <Karolus@.discussions.microsoft.com> wrote in message
> news:3B1473BD-7C92-4D18-80FF-F0DEE26C408F@.microsoft.com...
>
>

Friday, March 23, 2012

how can I bold the text in the sumtotal panel

I have a matrix report with sumtotal.

I can change the font color etc' in the sumTotal title, but I want to change the color in the values that it not seem like the regular data with no success.

here the report that i talking about

(the black row is the sumTotal)


Hi,

From your description, it seems that you want to modify the value's color in your report, right?
If so, I think you can achieve that by using the expressions. You can design a report so that different styles are applied to items based on the data in the report. For example, you can display negative numbers in red or change the background colors on a table.

To make styles conditional, use an expression instead of a static value for the style properties of the item. For example, to make a text box render negative values in red for a field called Profit, open the Properties Window and use the following expression in the Color property:

For font:
=Iif(Fields!TotalDue.Value < 10000,"Red","Black")
For background color:
=iif(RowNumber(Nothing) Mod 2, "PaleGreen", "White")

For more information, see
http://technet.microsoft.com/en-us/library/ms156400.aspx
http://technet.microsoft.com/en-us/library/ms159238.aspx

Thanks.

Wednesday, March 21, 2012

How can I assign a value to a textbox programmatically in a report?

For example: If I want to display the date today, txtDate.Text = DateToday;Type
=System.DateTime.Now
into the Textbox and set the Format (right-click->properties) to dd.MM.yyyy or your corresponding date-format
|||that's design time, what i'm trying to do is at run-time I want to assign a value to a particular textbox in the report. ΓΌ|||There is no way other than assigning a expression to the Textbox. The "MS Access way" doesn't work anymore ;(
You can do something like:
=iif( some_condition = true, System.DateTime.Now, "No Date")

or create your own function:
Add
Public Function myFunction(val as Object)
if val is Nothing then return System.DateTime.Now
return "Empty"
End Funcion

to Report-Properties->Code
and call it by
=Code.myFunction(Fields!ConditionColumn.Value)

|||ok thanks, i'll try your solution later. sql

How can I always close a text file from a CLR Stored Procedure even when the process is killed?

I have a C# SQL 2005 .net stored procedure which scrubs a text file looking for characters not in a range of characters and replacing them with another character. This works fine except when the process is killed. When this happens the file handle of the file being scrubbed is not released. I use a try catch finally block when opening the file and the output file. The finally section fiushes the output file and closes all files and streams but still when I go to access the file again or use the file in explorer it says the file is still in use. Should I be handling this some other way? How do I know the files will always be closed correctly.

This behavior could happen because that when you kill the process, your finally section may not be called. Eventually, the file handle will be released when garbage collector kicks in.

Friday, March 9, 2012

How are text fields stored.. ?

Greetings..
Please help prove I'm right about something. Text fields
in SQL 2000 ~ do text and vchar fields truncate all
whitespace, if the data does not fill up the declared
field length?
E.G.:
vchar Fullname (255)
Put some data into it:
Dr. Jones Warnabe
Will the field in memory be 255 characters or about 17
characters?
Also ~ where would such information BE?
Thank you in advance!
"Mike rucker" <ruckerm@.emaseniorcare.org> wrote in message
news:300301c51e8c$745b1c70$a601280a@.phx.gbl...
> Greetings..
> Please help prove I'm right about something. Text fields
> in SQL 2000 ~ do text and vchar fields truncate all
> whitespace, if the data does not fill up the declared
> field length?
> E.G.:
> vchar Fullname (255)
> Put some data into it:
> Dr. Jones Warnabe
> Will the field in memory be 255 characters or about 17
> characters?
Per BOL, for varchar [(n)], storage size is the actual length in bytes of
the data entered, not "n" bytes.

> Also ~ where would such information BE?
SQL Books Online > Index > varchar data type / text data type

> Thank you in advance!
>
|||thank you! When in doubt... dig deeper in tfm.. ?
>--Original Message--
>
....

How are text fields stored.. ?

Greetings..
Please help prove I'm right about something. Text fields
in SQL 2000 ~ do text and vchar fields truncate all
whitespace, if the data does not fill up the declared
field length?
E.G.:
vchar Fullname (255)
Put some data into it:
Dr. Jones Warnabe
Will the field in memory be 255 characters or about 17
characters?
Also ~ where would such information BE?
Thank you in advance!"Mike rucker" <ruckerm@.emaseniorcare.org> wrote in message
news:300301c51e8c$745b1c70$a601280a@.phx.gbl...
> Greetings..
> Please help prove I'm right about something. Text fields
> in SQL 2000 ~ do text and vchar fields truncate all
> whitespace, if the data does not fill up the declared
> field length?
> E.G.:
> vchar Fullname (255)
> Put some data into it:
> Dr. Jones Warnabe
> Will the field in memory be 255 characters or about 17
> characters?
Per BOL, for varchar [(n)], storage size is the actual length in bytes o
f
the data entered, not "n" bytes.

> Also ~ where would such information BE?
SQL Books Online > Index > varchar data type / text data type

> Thank you in advance!
>|||thank you! When in doubt... dig deeper in tfm.. ?
>--Original Message--
>
...

How are text fields stored.. ?

Greetings..
Please help prove I'm right about something. Text fields
in SQL 2000 ~ do text and vchar fields truncate all
whitespace, if the data does not fill up the declared
field length?
E.G.:
vchar Fullname (255)
Put some data into it:
Dr. Jones Warnabe
Will the field in memory be 255 characters or about 17
characters?
Also ~ where would such information BE?
Thank you in advance!"Mike rucker" <ruckerm@.emaseniorcare.org> wrote in message
news:300301c51e8c$745b1c70$a601280a@.phx.gbl...
> Greetings..
> Please help prove I'm right about something. Text fields
> in SQL 2000 ~ do text and vchar fields truncate all
> whitespace, if the data does not fill up the declared
> field length?
> E.G.:
> vchar Fullname (255)
> Put some data into it:
> Dr. Jones Warnabe
> Will the field in memory be 255 characters or about 17
> characters?
Per BOL, for varchar [(n)], storage size is the actual length in bytes of
the data entered, not "n" bytes.
> Also ~ where would such information BE?
SQL Books Online > Index > varchar data type / text data type
> Thank you in advance!
>|||thank you! When in doubt... dig deeper in tfm.. ?
>--Original Message--
>
...

How Alter text column length?

How can I change the length of a Data Type text column? All I've found in BOL
is that you can't do it!
Thanks -
Can you be more specific? Text can hold up to 2GB data, and you do not specify that length, as you
do with varchar.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Bil Click" <BilClick@.discussions.microsoft.com> wrote in message
news:691FEB50-310C-4DB5-91B2-D28822BA252B@.microsoft.com...
> How can I change the length of a Data Type text column? All I've found in BOL
> is that you can't do it!
> Thanks -
|||Tibor, Looks like Bil needs to see the entire contents of text column while
querying (SELECT).
Bil,
See the command SET TEXTSIZE in books online.
Thanks
Hari
SQL Server MVP
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:Oq2JDiSmFHA.2860@.TK2MSFTNGP15.phx.gbl...
> Can you be more specific? Text can hold up to 2GB data, and you do not
> specify that length, as you do with varchar.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Bil Click" <BilClick@.discussions.microsoft.com> wrote in message
> news:691FEB50-310C-4DB5-91B2-D28822BA252B@.microsoft.com...
>
|||The column was created with Length = 16. I am trying to store a text stream
which is being truncated at aprox 88 characters. Sample:
<BR>*** TOP OF REPORT ***<BR> NORTH CAROLINA DIVISION OF MOTOR VEHICLES<BR>  
I don't get the correlation between 16 and 88, if I am counting those chars
correctly.
OBJECTPROPERTY TableTextInRowLimit = 0 indicates text in row option is not
set.
- Bil Click
"Tibor Karaszi" wrote:

> Can you be more specific? Text can hold up to 2GB data, and you do not specify that length, as you
> do with varchar.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Bil Click" <BilClick@.discussions.microsoft.com> wrote in message
> news:691FEB50-310C-4DB5-91B2-D28822BA252B@.microsoft.com...
>
|||The length16 is just Enterprise Manager's rather stupid way to tell you that the pointer used in the
internal handling of the text datatype is 16 bytes. It has nothing to do with what you can actually
store (which is 2GB, nothing that you configure in any way). The truncation either happens at input
or output of the data. Try checking the length using the DATALENGTH function.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Bil Click" <BilClick@.discussions.microsoft.com> wrote in message
news:57F1B4D3-9B8B-43F4-BDB9-F5D2057AEFD2@.microsoft.com...[vbcol=seagreen]
> The column was created with Length = 16. I am trying to store a text stream
> which is being truncated at aprox 88 characters. Sample:
> <BR>*** TOP OF REPORT ***<BR> NORTH CAROLINA DIVISION OF MOTOR VEHICLES<BR>
>  
> I don't get the correlation between 16 and 88, if I am counting those chars
> correctly.
> OBJECTPROPERTY TableTextInRowLimit = 0 indicates text in row option is not
> set.
> - Bil Click
>
> "Tibor Karaszi" wrote:
|||Turns out to be a Query Analyzer "gotcha", truncated the displayed field.
When I used the Datalength function I could see there really was more data
than being displayed in QA. EM only says <Long Text>. I finally opeded up
osql and see that the full text is being stored.
Thanks for the tips! Cheers!
- Bil
"Tibor Karaszi" wrote:

> The length16 is just Enterprise Manager's rather stupid way to tell you that the pointer used in the
> internal handling of the text datatype is 16 bytes. It has nothing to do with what you can actually
> store (which is 2GB, nothing that you configure in any way). The truncation either happens at input
> or output of the data. Try checking the length using the DATALENGTH function.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Bil Click" <BilClick@.discussions.microsoft.com> wrote in message
> news:57F1B4D3-9B8B-43F4-BDB9-F5D2057AEFD2@.microsoft.com...
>

How Alter text column length?

How can I change the length of a Data Type text column? All I've found in BO
L
is that you can't do it!
Thanks -Can you be more specific? Text can hold up to 2GB data, and you do not speci
fy that length, as you
do with varchar.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Bil Click" <BilClick@.discussions.microsoft.com> wrote in message
news:691FEB50-310C-4DB5-91B2-D28822BA252B@.microsoft.com...
> How can I change the length of a Data Type text column? All I've found in
BOL
> is that you can't do it!
> Thanks -|||Tibor, Looks like Bil needs to see the entire contents of text column while
querying (SELECT).
Bil,
See the command SET TEXTSIZE in books online.
Thanks
Hari
SQL Server MVP
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:Oq2JDiSmFHA.2860@.TK2MSFTNGP15.phx.gbl...
> Can you be more specific? Text can hold up to 2GB data, and you do not
> specify that length, as you do with varchar.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Bil Click" <BilClick@.discussions.microsoft.com> wrote in message
> news:691FEB50-310C-4DB5-91B2-D28822BA252B@.microsoft.com...
>|||The column was created with Length = 16. I am trying to store a text stream
which is being truncated at aprox 88 characters. Sample:
<BR>*** TOP OF REPORT ***<BR> NORTH CAROLINA DIVISION OF
MOTOR VEHICLES<BR>  
I don't get the correlation between 16 and 88, if I am counting those chars
correctly.
OBJECTPROPERTY TableTextInRowLimit = 0 indicates text in row option is not
set.
- Bil Click
"Tibor Karaszi" wrote:

> Can you be more specific? Text can hold up to 2GB data, and you do not spe
cify that length, as you
> do with varchar.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Bil Click" <BilClick@.discussions.microsoft.com> wrote in message
> news:691FEB50-310C-4DB5-91B2-D28822BA252B@.microsoft.com...
>|||The length16 is just Enterprise Manager's rather stupid way to tell you that
the pointer used in the
internal handling of the text datatype is 16 bytes. It has nothing to do wit
h what you can actually
store (which is 2GB, nothing that you configure in any way). The truncation
either happens at input
or output of the data. Try checking the length using the DATALENGTH function
.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Bil Click" <BilClick@.discussions.microsoft.com> wrote in message
news:57F1B4D3-9B8B-43F4-BDB9-F5D2057AEFD2@.microsoft.com...[vbcol=seagreen]
> The column was created with Length = 16. I am trying to store a text strea
m
> which is being truncated at aprox 88 characters. Sample:
> <BR>*** TOP OF REPORT ***<BR> NORTH CAROLINA DIVISION O
F MOTOR VEHICLES<BR>
>  
> I don't get the correlation between 16 and 88, if I am counting those char
s
> correctly.
> OBJECTPROPERTY TableTextInRowLimit = 0 indicates text in row option is no
t
> set.
> - Bil Click
>
> "Tibor Karaszi" wrote:
>|||Turns out to be a Query Analyzer "gotcha", truncated the displayed field.
When I used the Datalength function I could see there really was more data
than being displayed in QA. EM only says <Long Text>. I finally opeded up
osql and see that the full text is being stored.
Thanks for the tips! Cheers!
- Bil
"Tibor Karaszi" wrote:

> The length16 is just Enterprise Manager's rather stupid way to tell you th
at the pointer used in the
> internal handling of the text datatype is 16 bytes. It has nothing to do w
ith what you can actually
> store (which is 2GB, nothing that you configure in any way). The truncatio
n either happens at input
> or output of the data. Try checking the length using the DATALENGTH functi
on.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Bil Click" <BilClick@.discussions.microsoft.com> wrote in message
> news:57F1B4D3-9B8B-43F4-BDB9-F5D2057AEFD2@.microsoft.com...
>

How Alter text column length?

How can I change the length of a Data Type text column? All I've found in BOL
is that you can't do it!
Thanks -Can you be more specific? Text can hold up to 2GB data, and you do not specify that length, as you
do with varchar.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Bil Click" <BilClick@.discussions.microsoft.com> wrote in message
news:691FEB50-310C-4DB5-91B2-D28822BA252B@.microsoft.com...
> How can I change the length of a Data Type text column? All I've found in BOL
> is that you can't do it!
> Thanks -|||Tibor, Looks like Bil needs to see the entire contents of text column while
querying (SELECT).
Bil,
See the command SET TEXTSIZE in books online.
Thanks
Hari
SQL Server MVP
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:Oq2JDiSmFHA.2860@.TK2MSFTNGP15.phx.gbl...
> Can you be more specific? Text can hold up to 2GB data, and you do not
> specify that length, as you do with varchar.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Bil Click" <BilClick@.discussions.microsoft.com> wrote in message
> news:691FEB50-310C-4DB5-91B2-D28822BA252B@.microsoft.com...
>> How can I change the length of a Data Type text column? All I've found in
>> BOL
>> is that you can't do it!
>> Thanks -
>|||The column was created with Length = 16. I am trying to store a text stream
which is being truncated at aprox 88 characters. Sample:
<BR>*** TOP OF REPORT ***<BR> NORTH CAROLINA DIVISION OF MOTOR VEHICLES<BR>  
I don't get the correlation between 16 and 88, if I am counting those chars
correctly.
OBJECTPROPERTY TableTextInRowLimit = 0 indicates text in row option is not
set.
- Bil Click
"Tibor Karaszi" wrote:
> Can you be more specific? Text can hold up to 2GB data, and you do not specify that length, as you
> do with varchar.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Bil Click" <BilClick@.discussions.microsoft.com> wrote in message
> news:691FEB50-310C-4DB5-91B2-D28822BA252B@.microsoft.com...
> > How can I change the length of a Data Type text column? All I've found in BOL
> > is that you can't do it!
> >
> > Thanks -
>|||The length16 is just Enterprise Manager's rather stupid way to tell you that the pointer used in the
internal handling of the text datatype is 16 bytes. It has nothing to do with what you can actually
store (which is 2GB, nothing that you configure in any way). The truncation either happens at input
or output of the data. Try checking the length using the DATALENGTH function.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Bil Click" <BilClick@.discussions.microsoft.com> wrote in message
news:57F1B4D3-9B8B-43F4-BDB9-F5D2057AEFD2@.microsoft.com...
> The column was created with Length = 16. I am trying to store a text stream
> which is being truncated at aprox 88 characters. Sample:
> <BR>*** TOP OF REPORT ***<BR> NORTH CAROLINA DIVISION OF MOTOR VEHICLES<BR>
>  
> I don't get the correlation between 16 and 88, if I am counting those chars
> correctly.
> OBJECTPROPERTY TableTextInRowLimit = 0 indicates text in row option is not
> set.
> - Bil Click
>
> "Tibor Karaszi" wrote:
>> Can you be more specific? Text can hold up to 2GB data, and you do not specify that length, as
>> you
>> do with varchar.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>> Blog: http://solidqualitylearning.com/blogs/tibor/
>>
>> "Bil Click" <BilClick@.discussions.microsoft.com> wrote in message
>> news:691FEB50-310C-4DB5-91B2-D28822BA252B@.microsoft.com...
>> > How can I change the length of a Data Type text column? All I've found in BOL
>> > is that you can't do it!
>> >
>> > Thanks -
>>|||Turns out to be a Query Analyzer "gotcha", truncated the displayed field.
When I used the Datalength function I could see there really was more data
than being displayed in QA. EM only says <Long Text>. I finally opeded up
osql and see that the full text is being stored.
Thanks for the tips! Cheers!
- Bil
"Tibor Karaszi" wrote:
> The length16 is just Enterprise Manager's rather stupid way to tell you that the pointer used in the
> internal handling of the text datatype is 16 bytes. It has nothing to do with what you can actually
> store (which is 2GB, nothing that you configure in any way). The truncation either happens at input
> or output of the data. Try checking the length using the DATALENGTH function.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Bil Click" <BilClick@.discussions.microsoft.com> wrote in message
> news:57F1B4D3-9B8B-43F4-BDB9-F5D2057AEFD2@.microsoft.com...
> > The column was created with Length = 16. I am trying to store a text stream
> > which is being truncated at aprox 88 characters. Sample:
> >
> > <BR>*** TOP OF REPORT ***<BR> NORTH CAROLINA DIVISION OF MOTOR VEHICLES<BR>
> >
> >
> > I don't get the correlation between 16 and 88, if I am counting those chars
> > correctly.
> >
> > OBJECTPROPERTY TableTextInRowLimit = 0 indicates text in row option is not
> > set.
> >
> > - Bil Click
> >
> >
> > "Tibor Karaszi" wrote:
> >
> >> Can you be more specific? Text can hold up to 2GB data, and you do not specify that length, as
> >> you
> >> do with varchar.
> >>
> >> --
> >> Tibor Karaszi, SQL Server MVP
> >> http://www.karaszi.com/sqlserver/default.asp
> >> http://www.solidqualitylearning.com/
> >> Blog: http://solidqualitylearning.com/blogs/tibor/
> >>
> >>
> >> "Bil Click" <BilClick@.discussions.microsoft.com> wrote in message
> >> news:691FEB50-310C-4DB5-91B2-D28822BA252B@.microsoft.com...
> >> > How can I change the length of a Data Type text column? All I've found in BOL
> >> > is that you can't do it!
> >> >
> >> > Thanks -
> >>
> >>
>

Wednesday, March 7, 2012

How about a Rich Text or HTML Text TextBox

Come one guys how about a rich text or HTML text box in RS2005, this is a
glaring omission. I know there are some workarounds, but for some items this
is just necessary. How hard can this be?
Lets consider an example. I have a report that I send out that is really
quite complex. To help understand the report I have a page of documentation
built right into the report. Only problem is it needs some text in bold,
some in color, other not, tables, etc. Well, lets try some workarounds.
First, I tried linking to an HTML document, but this is distributed all over
the world via e-mail and is expected to be able to be read offline. Next, I
have tried using a combination of all the toolbox items to make part of the
"report" that looks like my documentation but that didn't work out too well
as its a real pain to try to make formatted text out of many independently
formatted textboxes, tables, etc. The last thing I have been trying is to
take my HTML page and run it through a HTML to image conversion and then
insert the image into the report. This works for online browsing, etc, but
when I save the report off to excel I get hit with a max column height of
409. This I get about 3/4 of my image.
Anyway, I'm just venting but please, even given the late date, please
consider adding a rich text or html text box to RS 2005.
Thanks,Here is something I do which might solve at least some of your needs. Create
an html document somewhere (I just start it out in Word and save it as
html). Then do a right mouse click, add, add existing item. Go to the
directory that has the document and select it. It will not be part of your
project. You deploy it like normal. You can do a jump to report, etc. You
can not have it be a subreport (I just tried that).
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"asnewbie+rs=argh" <asnewbiersargh@.discussions.microsoft.com> wrote in
message news:48EE359B-939F-4EB6-AB39-3C4400A05F9D@.microsoft.com...
> Come one guys how about a rich text or HTML text box in RS2005, this is a
> glaring omission. I know there are some workarounds, but for some items
> this
> is just necessary. How hard can this be?
> Lets consider an example. I have a report that I send out that is really
> quite complex. To help understand the report I have a page of
> documentation
> built right into the report. Only problem is it needs some text in bold,
> some in color, other not, tables, etc. Well, lets try some workarounds.
> First, I tried linking to an HTML document, but this is distributed all
> over
> the world via e-mail and is expected to be able to be read offline.
> Next, I
> have tried using a combination of all the toolbox items to make part of
> the
> "report" that looks like my documentation but that didn't work out too
> well
> as its a real pain to try to make formatted text out of many independently
> formatted textboxes, tables, etc. The last thing I have been trying is to
> take my HTML page and run it through a HTML to image conversion and then
> insert the image into the report. This works for online browsing, etc,
> but
> when I save the report off to excel I get hit with a max column height of
> 409. This I get about 3/4 of my image.
> Anyway, I'm just venting but please, even given the late date, please
> consider adding a rich text or html text box to RS 2005.
> Thanks,