Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

nvarchar -int Expand / Collapse
Author
Message
Posted Friday, September 19, 2008 5:27 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, May 15, 2009 3:19 AM
Points: 7, Visits: 50
In the query below:
FieldValueID-nvarchar(50) [since it can hv comma separated values 1,2]
ID - int
Select CountryName from MasterCountry where ID in (FieldValueID)

but this give an error...how do i read the values..pls lemme kno
Post #572415
Posted Friday, September 19, 2008 5:40 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 8:29 AM
Points: 6,781, Visits: 13,987
For better, quicker answers, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/ (Thanks Jeff)

You could CAST the [ID] as a varchar.


“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Exploring Recursive CTEs by Example Dwain Camps
Post #572422
Posted Friday, September 19, 2008 7:57 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, May 23, 2014 5:59 AM
Points: 329, Visits: 470
avani104 (9/19/2008)

In the query below:
FieldValueID-nvarchar(50) [since it can hv comma separated values 1,2]
ID - int
Select CountryName from EYARDMasterCountry where ID in (FieldValueID)

but this give an error...how do i read the values..pls lemme kno



Search for Array+SQL Server in google




Madhivanan

Failing to plan is Planning to fail
Post #572537
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse