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

Tuesday, March 27, 2012

Changing column from nvarchar to int

I am upgrading an Access database and need to convert some of the fields
from text to a foreign key from another table. This is no problem and I
already have the query batch to do this. I would like to know if it is
possible to change a column type from nvarchar to int.
Thanks,
Drew LaingAs long as all the NVARCHAR values can be converted to an INT, sure.
ALTER TABLE tablename ALTER COLUMN columnname INT
http://www.aspfaq.com/
(Reverse address to reply.)
"Drew" <drew.laing@.NOswvtc.dmhmrsas.virginia.SPMgov> wrote in message
news:uMwE9OZJFHA.3184@.TK2MSFTNGP10.phx.gbl...
> I am upgrading an Access database and need to convert some of the fields
> from text to a foreign key from another table. This is no problem and I
> already have the query batch to do this. I would like to know if it is
> possible to change a column type from nvarchar to int.
> Thanks,
> Drew Laing
>|||Drew,
You can do it if the values are numeric or null. If the value can not be
casted, then you will get an error.
Example:
use northwind
go
create table t (
colA varchar(15)
)
go
insert into t values('1')
insert into t values('2')
insert into t values(null)
go
select * from t
go
alter table t
alter column colA int
go
select * from t
go
alter table t
alter column colA varchar(15)
go
insert into t values ('a')
go
-- will fail
alter table t
alter column colA int
go
select * from t
go
drop table t
go
AMB
"Drew" wrote:

> I am upgrading an Access database and need to convert some of the fields
> from text to a foreign key from another table. This is no problem and I
> already have the query batch to do this. I would like to know if it is
> possible to change a column type from nvarchar to int.
> Thanks,
> Drew Laing
>
>|||Thanks to both!
Thanks,
Drew
"Drew" <drew.laing@.NOswvtc.dmhmrsas.virginia.SPMgov> wrote in message
news:uMwE9OZJFHA.3184@.TK2MSFTNGP10.phx.gbl...
>I am upgrading an Access database and need to convert some of the fields
>from text to a foreign key from another table. This is no problem and I
>already have the query batch to do this. I would like to know if it is
>possible to change a column type from nvarchar to int.
> Thanks,
> Drew Laing
>

Sunday, March 25, 2012

changing all fonts

Any idea how come selecting a matrix and changing the font size does not
affect all of the text? It seems like I have to select each row and to make
this type of change.
Do other people have this same problem?
TIA
DeanOn Jul 27, 6:10 am, "Dean" <deanl...@.hotmail.com.nospam> wrote:
> Any idea how come selecting a matrix and changing the font size does not
> affect all of the text? It seems like I have to select each row and to make
> this type of change.
> Do other people have this same problem?
> TIA
> Dean
This seems to be a common occurrence. This is also true for table
controls. Sorry that I cannot offer any further assistance.
Regards,
Enrique Martinez
Sr. Software Consultant

Thursday, March 22, 2012

Changing a Text To a Date

I have a field in a table that contains date data in the following format:
20040301
what is the best, low impact method for converting this to a useable date
field?
Sorry, wrong group...
"Atley" <atley_1@.homtmail.com> wrote in message
news:euhlpsnEEHA.3788@.TK2MSFTNGP10.phx.gbl...
> I have a field in a table that contains date data in the following
format:
> 20040301
> what is the best, low impact method for converting this to a useable date
> field?
>

Changing a db logical file name

This is a multi-part message in MIME format.
--=_NextPart_000_0017_01C3D93B.E53A31C0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Good day all,
Does anyone have any ideas on how I can change the Logical File Name = from 'IA_Dev_Data' to 'BDOpp_Data' for a database? If the graphic isn't = visible, I'm referring to the Logical name in the File name file on the = General Tab when viewing a database's properties in EM. We're running = SQL 7.
-- Any and all contributions are greatly appreciated ...
Regards TJ
--=_NextPart_000_0017_01C3D93B.E53A31C0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&
Good day all,
Does anyone have any ideas on how I can change the Logical File Name = from 'IA_Dev_Data' to 'BDOpp_Data' for a database? If the graphic isn't = visible, I'm referring to the Logical name in the File name file on the General Tab = when viewing a database's properties in EM. We're running SQL 7.

-- Any and all contributions are = greatly appreciated ...Regards TJ


--=_NextPart_000_0017_01C3D93B.E53A31C0--Hi TJ,
Thank you for using MSDN Newsgroup! It's my pleasure to assist you with
your issue.
From your information, you are running SQL 7 and want to change the logical
file name of a database, right?
Based on my experience, it is possible to change the physical file name by
using sp_detach_db and sp_attatch_db. But for logical file name, there is
no way to change that now.
In SQL Server 2000, it could be possible, which is described in the
following article:
http://support.microsoft.com/?id=814576
Hope this helps! If you still have questions on this issue, please feel
free to post new message here and I am ready to help!
Best regards
Baisong Wei
Microsoft Online Support
----
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only. Thanks.|||Thanks so much Baisong. Have a good one!
"Baisong Wei[MSFT]" <v-baiwei@.online.microsoft.com> wrote in message
news:YR7WMSb2DHA.2900@.cpmsftngxa07.phx.gbl...
> Hi TJ,
> Thank you for using MSDN Newsgroup! It's my pleasure to assist you with
> your issue.
> From your information, you are running SQL 7 and want to change the
logical
> file name of a database, right?
> Based on my experience, it is possible to change the physical file name by
> using sp_detach_db and sp_attatch_db. But for logical file name, there is
> no way to change that now.
> In SQL Server 2000, it could be possible, which is described in the
> following article:
> http://support.microsoft.com/?id=814576
> Hope this helps! If you still have questions on this issue, please feel
> free to post new message here and I am ready to help!
> Best regards
> Baisong Wei
> Microsoft Online Support
> ----
> Get Secure! - www.microsoft.com/security
> This posting is provided "as is" with no warranties and confers no rights.
> Please reply to newsgroups only. Thanks.
>
>

Tuesday, March 20, 2012

changes to bcp arguments in sql server 2005

Hello All
Seems the arguments have changed for bcp in sql server 2005(CTP). -T use to
be for the trusted connection now it is text or image size. There are new
arguments like -V[security_option] and -Z[security_mechanism]. Does any one
know how to use these new parameters and if you can still do trusted
connections for logining in with BCPShelly,
Please see:
http://www.aspfaq.com/sql2005/show.asp?id=1
For your question however, it looks as -T is still to specify a Trusted
Connection.
Please see:
http://msdn2.microsoft.com/en-us/library/ms162802
HTH
Jerry
"shelly" <shelly@.discussions.microsoft.com> wrote in message
news:9161D896-CFC7-4F5D-A16F-E5B109227AA4@.microsoft.com...
> Hello All
> Seems the arguments have changed for bcp in sql server 2005(CTP). -T use
> to
> be for the trusted connection now it is text or image size. There are new
> arguments like -V[security_option] and -Z[security_mechanism]. Does any
> one
> know how to use these new parameters and if you can still do trusted
> connections for logining in with BCPsql

Wednesday, March 7, 2012

Change the forecolor of the field on the report.

Hi,

I trying to change the color of the text based on a condition using sql server 2005 reporting services. Some thing like this.IIF(Fields!OrderYear.Value < 2000,"Red","Black"). But not able to achieve this.. how can I do that?

Where are you putting this expression? Make sure the expression is on the font color property, not on value.

|||

Yes, you are right. Thank You.

Change the color on a piece of text

Below is the pice of code that I use to produce results that look like this

[4] [5] [1]

what I would like to do is is make it look like this:

[4] [5] [1]

Basically anything that >3 = Green

= "[" & CStr(Count(IIf (Trim(Fields!NOB_Pickup_L_D_T.Value) = "Y", 1, Nothing))) &

"] [" & CStr(Count(IIf (Trim(Fields!NOB_Pickup_L_D_T.Value) = "N", 1, Nothing))) &

"] [" & CStr(Count(IIf (Trim(Fields!NOB_Pickup_L_D_T.Value) = "NA", 1, Nothing)))& "]"

Thanks,

Rick

Is that output text all within the same textbox? If so, you can't change the colour of just part of it, you have to change the colour of all the text within the textbox.

|||

Yes the result is in one text box. Yes, I do know how to change all the text via an expression. But I just wanted to change a piece as shown in the example

Thanks!

|||

That was what i said in my reply: you *cannot* change only a subset of the text in a textbox. To achieve what you want, you will have to have multiple textboxes to make up your string and change the text in the appropriate one.

Saturday, February 25, 2012

Change Text to a date

I have a text field that I need to display in a data format
currently the text field is shown as this yyyymmdd
I need to display it in a date format as mm/dd/yyyy
I have tried just using the date format, but it is not recognized as a date.
Any suggestions how to write an expression to manipulate the field? I know
how to do it in Access & excel either of the folowing works:
=Mid([promise_dt],5,2) & "/" & Right([promise_dt],2) & "/" &
Left([promise_dt],4)
=(DATE(LEFT(A3,4),MID(A3,5,2),RIGHT(A3,2)))
any suggestions would be great.
thanks
--
Jeanne Conde, MCPJeanne:
Try to use SQL standard command:
declare @.InputStringDate varchar(10)
set @.InputStringDate ='20060314'
select convert(datetime, @.InputStringDate)
select convert(varchar,convert(datetime, @.InputStringDate),101)
Good luck!!
Waikiki Frog
Jeanne Conde wrote:
>I have a text field that I need to display in a data format
>currently the text field is shown as this yyyymmdd
>I need to display it in a date format as mm/dd/yyyy
>I have tried just using the date format, but it is not recognized as a date.
>Any suggestions how to write an expression to manipulate the field? I know
>how to do it in Access & excel either of the folowing works:
>=Mid([promise_dt],5,2) & "/" & Right([promise_dt],2) & "/" &
>Left([promise_dt],4)
>=(DATE(LEFT(A3,4),MID(A3,5,2),RIGHT(A3,2)))
>any suggestions would be great.
>thanks
>
--
Message posted via http://www.sqlmonster.com|||Thanks.
i will give it a try
--
Jeanne Conde, MCP
"WaikikiFrog via SQLMonster.com" wrote:
> Jeanne:
> Try to use SQL standard command:
> declare @.InputStringDate varchar(10)
> set @.InputStringDate ='20060314'
> select convert(datetime, @.InputStringDate)
> select convert(varchar,convert(datetime, @.InputStringDate),101)
> Good luck!!
> Waikiki Frog
>
> Jeanne Conde wrote:
> >I have a text field that I need to display in a data format
> >currently the text field is shown as this yyyymmdd
> >
> >I need to display it in a date format as mm/dd/yyyy
> >I have tried just using the date format, but it is not recognized as a date.
> >Any suggestions how to write an expression to manipulate the field? I know
> >how to do it in Access & excel either of the folowing works:
> >=Mid([promise_dt],5,2) & "/" & Right([promise_dt],2) & "/" &
> >Left([promise_dt],4)
> >=(DATE(LEFT(A3,4),MID(A3,5,2),RIGHT(A3,2)))
> >
> >any suggestions would be great.
> >thanks
> >
> --
> Message posted via http://www.sqlmonster.com
>

change text of msg 547,level 16

Hi
I've SQL Server 2000,now I want to change the default
text message of msg number 547,level 16.
how is it possible?
any help would be greatly appreiciated.
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/RM wrote:
> Hi
> I've SQL Server 2000,now I want to change the default
> text message of msg number 547,level 16.
> how is it possible?
If all you want is localize the message, you may try the suggestions from
this article
INF: How to Install Localized SQL Server Error Messages
http://support.microsoft.com/defaul...kb;en-us;277535
sincerely,
--
Sebastian K. Zaklada
Skilled Software
http://www.skilledsoftware.com
This posting is provided "AS IS" with no warranties, and confers no rights.

Change text color

Dear all,

May I know how can I change a text color if the data meet certain condition?

Thanks in advance

Levine

You can set this in the properties window.
Click on the textbox you want to change and then click in the "Color" box.. select the dropdown in that field and clickon "Expression..".

Then use a formula such as:

=IIF( Sum(Fields!Hours.Value)>=7 , "Black", "Crimson")

The expression builder can assist you with your own data fields etc.