Converting an Int to a String in SQL

Is there (is there) a command in t-sql to convert an Integer value to a string value?

 Thank you, in advance for your help.

0
Siberlee
8/5/2008 6:48:06 PM
asp.net.sql-datasource 29906 articles. 0 followers. Follow

3 Replies
880 Views

Similar Articles

[PageSpeed] 39
Get it on Google Play
Get it on Apple App Store

select convert(nvarchar, intfield)


Brian

"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
0
bmains
8/5/2008 7:03:05 PM
Syntax for CAST:
CAST ( expression AS data_type [ (length ) ])

Syntax for CONVERT:
CONVERT ( data_type [ ( length ) ] , expression [ , style ] )
http://msdn.microsoft.com/en-us/library/ms187928.aspx

A fine is a tax for doing wrong. A tax is a fine for doing well.
__________________________________________________
Please remember to click “Mark as Answer” on the post that helps you.
0
etariq
8/5/2008 7:10:35 PM

 Try

select convert(nvarchar(20), intfield)

or 

select convert(varchar(20), intfield) 

or

select convert(nchar(20), intfield)

or 

select convert(char(20), intfield) 

 


Don't forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
0
TATWORTH
8/5/2008 8:16:11 PM
Reply:

Similar Artilces:

Converting a gridView using an Sql Datasource to a gridview who is not using an SQL DataSource
How can i rewrite this page so that i doesnt make use of an SqlDataSource?  <%@ Control Language="C#" AutoEventWireup="true" CodeFile="LoginHistory.ascx.cs" Inherits="Private_UserControls_WebUserControl" %> <html> <head> <%--<link rel="stylesheet" href="BaldwinPortal.css" mce_href="BaldwinPortal.css" type="text/css" />--%> <title>Login History</title> </head> <body style="margin:0 0 0 0;padding:0 0 0 0"> ...

Convert int to string in a sql data source
Im getting a value out of a table its not the primary key, its just an integer and this worked fine in my simple select statement :  SELECT ItemID from Items WHERE ItemCat = '1'but when i tryed to get out values from two tables it went wrong, this is becuase in table one 'itemid' is an integer, and in table two the first value out is a items name 'itemname' ie a string. :SELECT itemID AS ONE from Items WHERE ItemCat='1'UNIONSelect ItemName AS ONE from ItemNames WHERE Cat='1'is there a way of converting an integer to a string in the sql dataso...

converting sql to MS SQL
I'm trying to unload a SQL Anywhere database to a MS SQL 6.5 database. The SQL produced from SQL Anywhere is not at all compatible. Is there an easy way of moving a database from SQLA to MS SQL darrell@texas.net Look at PowerDesigner from Powersoft. I can reverse engineer SQLA and create the MSSQL Server DDL for you. Dave Wolf Sybase Professional Services Darrell Fuller wrote: > I'm trying to unload a SQL Anywhere database to a MS SQL 6.5 database. > The > SQL produced from SQL Anywhere is not at all compatible. Is there an easy > way of moving...

Is is possible to run a .SQL file on SQL Server without converting file contents to a string?
Is it possible to run a .SQL file without converting the contents of the file to a string and then executing the string? Is it possible to run or execute the file? Thanks You can use the .sql file as an input file to ISQL using the -i switch "Kevin Wiebe" <kevin.wiebe@riseinc.com> wrote in message news:BjSh5G7GCHA.196@forums.sybase.com... > Is it possible to run a .SQL file without converting the contents of the > file to a string and then executing the string? Is it possible to run or > execute the file? > Thanks > > ...

what's difference between Accesss DataBase and Sql Sever about Sql String(or Command),Sql StoreProcedure ?
i am being dirty to Access DataBase from Sql Sever Database for my new work.But the sql string of Access sounds like a little different,can i use  the sql string of SqlSever for Access database,too?another question is: Does Access DataBase support Sql StoreProcedure??? when i worked in Access2000 ,did not see any about StoreProcedure,but i download a file named AccessHelper.cs  , some function of it looks like support StoreProcedure,Does it?  i want to fly ... Hi dkzeng ,Your first question     The string of both sqlsever and acce...

viewing sql string passed into sql server
I have a stored proc that has several parameters. (using SQL server) i call this proc and add the parameters etc and execute it etc the problem is that how can i see the string that is being passed to the db? eg the calling command? cheers Use the SQL Profiler. You can set it to monitor, and set filters as to what gets monitored. You can save the output in a file or a database as well.Starting with ASP.NET 2.0? Look at:Programming Microsoft Web Forms My Blog hi douglas.reilly i did think of that, i was woundering if there a way of viewing it in the debug envir...

Convert SQL Express to SQL server or Access
Is there anyway to convert an SQL Express database to SQL server or Access format? From one SQL Server to another is called moving a database and I have covered all the ways you can do in the FAQ below, sorry I don't use Access but you could use DTS to move it to Access, how to get the limited DTS is covered in the second FAQ.  Hope this helps. http://forums.asp.net/thread/1454694.aspxhttp://forums.asp.net/thread/1458004.aspxKind regards,Gift Peddie...

SQL Server Reporting Services for SQL SERVER 2000 AND Visual Studio.NET 2005 .NET 2.0
Hi, Which version of SQl Server Reporting Services will work with SQL SERVER 2000 in pararrel with ASP.NET 2.0 (.NET 2.0 framework)?  Thanks, Azam HighOnCodingWanna get high! Hi, Okay I got the answer. Yes, we can use the SQL SERVER 2005 Reporting Services with SQL SERVER 2000. HighOnCodingWanna get high! ...

Converting MDF files (SQL Server Express) to SQL Server 2005 WITHOUT having to buy SQL Server 2005 (I have Express). Personal WebSite Starter Kit
Hi (and HELP!),   I downloaded the Personal WebSite Starter Kit and got it working no problem on my local machine.  But I've had nothing but frustration trying to get it up and running on a webhosting site.  I picked hostmysite.com which uses SQL Server 2005.  I was under the impression that it wouldn't be that big a deal to convert the .MDF files that Sql Server Express uses to a SQL Server 2005 database.  I tried using SQL Server Management Studio Express.  I was able to "see" my remote database on hostmysite.com, but I was not able to import the .mdf files ...

Converting MDF files (SQL Server Express) to SQL Server 2005 WITHOUT having to buy SQL Server 2005 (I have Express). Personal WebSite Starter Kit
Hi,Basically i built a webpage with Login and it's working well from my local machine.Right now, i'm using Database Publishing Wizard. the problem is how do i convert.MDF files to .SQL 2005 to get my database publish in the internet? thanks  Place your .MDF file in the App_Data directory, change the connection string accordingly and then publish your web site. ----------------------------------------------------------Please click Mark As Answer if this helped in solving your problem.  Please click "Mark As Answer" if this hepled in solving your problem. ...

Converting MDF files (SQL Server Express) to SQL Server 2005 WITHOUT having to buy SQL Server 2005 (I have Express). Personal WebSite Starter Kit
Hi (and HELP!),   I downloaded the Personal WebSite Starter Kit and got it working no problem on my local machine.  But I've had nothing but frustration trying to get it up and running on a webhosting site.  I picked hostmysite.com which uses SQL Server 2005.  I was under the impression that it wouldn't be that big a deal to convert the .MDF files that Sql Server Express uses to a SQL Server 2005 database.  I tried using SQL Server Management Studio Express.  I was able to "see" my remote database on hostmysite.com, but I was not able to import the .mdf file...

sql or my sql query
hi,in my database  i have the two tables...1)programs                                2)reservedin the programs...two fields 1)program id           2)maxseats................these details wil be entered by adminin the reserved table  two fileds ..1)PRogramid        2)statusmy requirement is .. i need the available seats..meansif any body is intersted in  any program...they wil select the program...then status becomes approved(1)..then i need the o/p as ...

How to convert Int to string and string to Int in Java Script
 How to convert Int to string and string to Int in Java Script 1:var strVar='23' ;var intVar=parseInt(strVar); any other method for this2:var intVar= 23;var strVar=intVar+''; any other method for this conversion please help me? thanks   Those methods work for what you need them to do.  Are you looking for alternatives?  I never lose, some people are just better than me at winning. 1: var strVar='23' ; var intVar=parseInt(strVar); any other method for this var intVar=strVar-0; var intVar=strVar*1; var intVar=strVar/1; var in...

Convert Sql Server 2005 to Sql Server 2000
I have to downgrade a eCommerce database from Sql Server 2005 to Sql Server 2000 due to hosting server's support compatibility. Almost all features in the original (2005) version are available in 2000. Any recommendations as on an easy conversion? Thanks a lot. -Yubo It's not possible to easily/directly convert a SQL Server 2005 database to SQL Server 2000.  I learned this the very hard way.  My suggestion would be to find a new host.Terri MortonEngagement Manager, NeudesicHow to ask a question I have the same issue, in that I developed an ASP.Net 2.0 application using SQL Se...

Web resources about - Converting an Int to a String in SQL - asp.net.sql-datasource

Facebook Begins Converting Users To HTTPS
Are you willing to sacrifice a little bit of speed for a lot more safety? Facebook is asking that very question with its announcement that it ...

Facebook No Longer Converting Groups Into Pages
Back when Facebook first launched Facebook Pages, many businesses and brands who had built up substantial audiences in their Facebook Groups ...

Vert - simply converting for iPhone, iPad, and iPod touch on the iTunes App Store
Get Vert - simply converting on the App Store. See screenshots and ratings, and read customer reviews.

Converting SIM Card to Micro SIM Card - Flickr - Photo Sharing!
Place new Micro SIM into the iPhone SIM card tray

Ayaan Hirsi Ali on Converting Muslims to Christianity - YouTube
Complete video at: http://fora.tv/2010/07/29/Nomad_From_Islam_to_America_with_Ayaan_Hirsi_Ali Ayaan Hirsi Ali explains her support of missionary ...

Click go fears of converting print files
Is there a way to convert a print queue item to a .RTF or .PDF file? I like to save or email them. - The Sydney Morning Herald

Sudanese woman ordered to hang under sharia law for converting to Christianity gives birth
Khartoum, Sudan: A Christian Sudanese woman sentenced to hang for apostasy has given birth in jail, a Western diplomat said on Tuesday.

Imams warn against radicalism to Aboriginal inmates converting to Islam
The prison system has enlisted the help of ASIO to crack down on radicalisation behind bars amid revelations that Aboriginals are converting ...

Converting the world's companies one by one - The Science Show - ABC Radio National (Australian Broadcasting ...
Image: Trucks carrying logs make their way up a road in Jambi, Indonesia. A vast area of the Sumatran forest, and orangutan habitat, is being ...

Converting Churches Into Homes Is The Latest Hollywood Trend
You don't have to be a believer to be moved by the beauty of a church.

Resources last updated: 12/25/2015 1:41:01 PM