javierfh
asked on
Sql Server 2005
How to convert the integer field to string a view sql?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
CREATE VIEW my_view
AS
select cast(id as sysname), -- this is the int field and you could use varchar or nvarchar instead of sysname
name
FROM my_table
GO
http://msdn.microsoft.com/en-us/library/ms187928.aspx
Check implicit conversion chart at the end of above article.
AS
select cast(id as sysname), -- this is the int field and you could use varchar or nvarchar instead of sysname
name
FROM my_table
GO
http://msdn.microsoft.com/en-us/library/ms187928.aspx
Check implicit conversion chart at the end of above article.
Open in new window
CREATE VIEW <yourView> AS
SELECT CAST(... )
See MSDN