Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 AllUserData - sharepoint

Author  Topic 

inbs
Aged Yak Warrior

860 Posts

Posted - 2011-07-03 : 01:12:43
i run query on sharepoint DB,and i get no rsesult

SELECT 	*
FROM dbo.AllUserData WHERE nvarchar1='the bigger'


so i try this query ,and get wrong result

SELECT 	*
FROM dbo.AllUserData WHERE CONVERT(VARCHAR(10),nvarchar1)='the bigger'


the type on nvarchar1 is nvarchar(255), what else can i do?

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-07-03 : 10:42:40
Are you querying the sharepoint DB from sharepoint? In SSMS, either of these seem to work right. What is the wrong result you are getting and what do you expect to get? Post some sample data? In the example below all of the selects return a row.
create table #tmp (nvarchar1 nvarchar(255));
insert into #tmp values (N'the bigger');

select * from #tmp WHERE nvarchar1 = 'the bigger'
select * from #tmp WHERE CONVERT(VARCHAR(10),nvarchar1) ='the bigger';
select * from #tmp WHERE CONVERT(VARCHAR(10),nvarchar1) = convert(nvarchar(10),'the bigger');
drop table #tmp;
Go to Top of Page
   

- Advertisement -