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
 General SQL Server Forums
 New to SQL Server Programming
 Wrapping a column

Author  Topic 

werhardt
Constraint Violating Yak Guru

270 Posts

Posted - 2009-09-02 : 10:23:08
I am not sure if I can create something SQL or I have to do this in Visual Studios developer.

I have a phone directory that contains name and ext and I would like to the list to continue accross the page.

Is this possible?

Thanks!

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-09-02 : 10:26:17
the paging can be done in sql as well as in your front end. which front end app are you using?
Go to Top of Page

werhardt
Constraint Violating Yak Guru

270 Posts

Posted - 2009-09-02 : 10:46:22
I am using Visual Studios 2008. Can this also be done in 2005.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-09-02 : 10:49:51
yup..it can be done...is it web or win form?
Go to Top of Page

werhardt
Constraint Violating Yak Guru

270 Posts

Posted - 2009-09-02 : 11:10:32
I think web because I deploy it to the sharepoint site. So how can this be done?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-09-02 : 11:15:55
so is it a sql report developed using reporting services tool?
Go to Top of Page

werhardt
Constraint Violating Yak Guru

270 Posts

Posted - 2009-09-02 : 11:17:51
Yes it is a SQL devloped using reporting services (Microsoft Visual Studios).
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-09-02 : 11:19:19
then you can do paging in code behind (query or procedure)
Go to Top of Page

werhardt
Constraint Violating Yak Guru

270 Posts

Posted - 2009-09-02 : 11:55:25
okay, thanks. Now I am going to have to figure out how to do that, haha.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-09-02 : 12:58:14
hint: use ROW_NUMBER() function
Go to Top of Page

werhardt
Constraint Violating Yak Guru

270 Posts

Posted - 2009-09-02 : 15:00:46
thanks for the hint

Well, I created this, but it is not working correctly for me.....



create table #temp
(Name varchar(100),
Ext varchar(4),
Name1 varchar(100),
Ext1 varchar(4),
Name2 varchar(100),
Ext2 varchar(4)
)

SELECT
ROW_NUMBER() OVER (ORDER BY FullName) AS RowNumber,
FullName as Name , Ext into #temp1
FROM dbo.PhoneDirectory

Select * from #temp1

insert into #temp (Name,Ext)
SELECT Name,Ext from #temp1
WHERE RowNumber < = 33


update #temp set Name1 = t1.Name,Ext1 = t1.Ext
from #temp1 t1 where t1.rownumber between 34 and 66


update #temp set Name2 = t1.Name,Ext2 = t1.Ext
from #temp1 t1 where t1.rownumber > 66

select * from #temp
Go to Top of Page
   

- Advertisement -