I can't get a table to return top n rows. The sorting tab works fine. Can
anyone provide a syntax example?
Thanks,
Dave=Fields!MyField.Value TopN =10
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Microsoft PrivateNews" <Dave.Troyer@.cliftoncpa.com> wrote in message
news:O4CS54noEHA.3464@.TK2MSFTNGP14.phx.gbl...
>I can't get a table to return top n rows. The sorting tab works fine. Can
> anyone provide a syntax example?
> Thanks,
> Dave
>|||That's what I have but it doesn't return any rows. There is data in the
dataset.
"Lev Semenets [MSFT]" <levs@.microsoft.com> wrote in message
news:u7DeYfsoEHA.536@.TK2MSFTNGP11.phx.gbl...
> =Fields!MyField.Value TopN =10
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> "Microsoft PrivateNews" <Dave.Troyer@.cliftoncpa.com> wrote in message
> news:O4CS54noEHA.3464@.TK2MSFTNGP14.phx.gbl...
> >I can't get a table to return top n rows. The sorting tab works fine.
Can
> > anyone provide a syntax example?
> >
> > Thanks,
> > Dave
> >
> >
>|||I was able to get this to work. Something went flaky at one point. Thanks
again.
"Microsoft PrivateNews" <Dave.Troyer@.cliftoncpa.com> wrote in message
news:uNfExIMpEHA.644@.tk2msftngp13.phx.gbl...
> That's what I have but it doesn't return any rows. There is data in the
> dataset.
> "Lev Semenets [MSFT]" <levs@.microsoft.com> wrote in message
> news:u7DeYfsoEHA.536@.TK2MSFTNGP11.phx.gbl...
> > =Fields!MyField.Value TopN =10
> >
> > --
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> >
> >
> > "Microsoft PrivateNews" <Dave.Troyer@.cliftoncpa.com> wrote in message
> > news:O4CS54noEHA.3464@.TK2MSFTNGP14.phx.gbl...
> > >I can't get a table to return top n rows. The sorting tab works fine.
> Can
> > > anyone provide a syntax example?
> > >
> > > Thanks,
> > > Dave
> > >
> > >
> >
> >
>
2012年3月22日星期四
2012年3月11日星期日
Any Thoughts!
Hi All,
I know there can be lot better ways to do the same thing
(Finding all the childs of a given parent) . Please Provide some
insight to improve my understanding of the topic .Trees and
Hierarchies.
Create Table ParentChild
(
Pid varchar(20),
Child varchar(20)
)
Insert into ParentChild values('Jatinder','k')
Insert into ParentChild values('Jatinder','B')
Insert into ParentChild values('Jatinder','C')
Insert into ParentChild values('Jatinder','D')
Insert into ParentChild values('Jatinder','E')
Insert into ParentChild values('Jatinder','F')
Insert into ParentChild values('Jatinder','G')
Insert into ParentChild values('B','aa')
Insert into ParentChild values('C','dd')
Insert into ParentChild values('D','ee')
Insert into ParentChild values('E','ff')
Insert into ParentChild values('F','gg')
Insert into ParentChild values('G',null)
Insert into ParentChild values('aa','xx')
Declare @.cnt int
Declare @.done int
Declare @.Lev int
Set @.Lev = 1
Create Table AllChilds ( Child varchar(20) unique,Lev int)
Insert Into AllChilds Select Child , @.Lev From ParentChild Where PID =
'jatinder'
Set @.cnt = 1
While @.@.rowcount > 0
Begin
Insert Into AllChilds
Select P.Child , (@.Lev + 1) From ParentChild P , AllChilds A
Where P.PID = A.Child And Lev = @.Lev And P.Child is Not Null
If @.@.RowCount = 0
Break
Set @.Lev = @.Lev + 1
End
Select * From AllChilds
Drop Table AllChilds
Drop Table ParentChild
With Warm Regards
Jatinder SinghTake a look at Itzik's example posted sometimes ago
create table users (userID Int, parentID Int)
insert into users select 1, 0 union all select 2, 1
union all select 3, 2 union all select 4, 3 union all
select 5, 4 union all select 6, 4 union all select 7, 5
union all select 8, 6 union all select 9, 7 union all select 10, 8
create function dbo.fn_getpath(@.uid as int) returns varchar(8000)
as
begin
declare @.path as varchar(8000);
set @.path = cast(@.uid as varchar(10));
while @.uid <> 0
begin
set @.uid = (select parentid from users where userid = @.uid);
set @.path = @.path + ',' + cast(@.uid as varchar(10));
end
return @.path;
end
go
select dbo.fn_getpath(5)
"jsfromynr" <jatinder.singh@.clovertechnologies.com> wrote in message
news:1134572287.593693.239090@.g44g2000cwa.googlegroups.com...
> Hi All,
> I know there can be lot better ways to do the same thing
> (Finding all the childs of a given parent) . Please Provide some
> insight to improve my understanding of the topic .Trees and
> Hierarchies.
> Create Table ParentChild
> (
> Pid varchar(20),
> Child varchar(20)
> )
> Insert into ParentChild values('Jatinder','k')
> Insert into ParentChild values('Jatinder','B')
> Insert into ParentChild values('Jatinder','C')
> Insert into ParentChild values('Jatinder','D')
> Insert into ParentChild values('Jatinder','E')
> Insert into ParentChild values('Jatinder','F')
> Insert into ParentChild values('Jatinder','G')
> Insert into ParentChild values('B','aa')
> Insert into ParentChild values('C','dd')
> Insert into ParentChild values('D','ee')
> Insert into ParentChild values('E','ff')
> Insert into ParentChild values('F','gg')
> Insert into ParentChild values('G',null)
> Insert into ParentChild values('aa','xx')
> Declare @.cnt int
> Declare @.done int
> Declare @.Lev int
> Set @.Lev = 1
> Create Table AllChilds ( Child varchar(20) unique,Lev int)
> Insert Into AllChilds Select Child , @.Lev From ParentChild Where PID =
> 'jatinder'
> Set @.cnt = 1
> While @.@.rowcount > 0
> Begin
> Insert Into AllChilds
> Select P.Child , (@.Lev + 1) From ParentChild P , AllChilds A
> Where P.PID = A.Child And Lev = @.Lev And P.Child is Not Null
> If @.@.RowCount = 0
> Break
> Set @.Lev = @.Lev + 1
> End
> Select * From AllChilds
> Drop Table AllChilds
> Drop Table ParentChild
> With Warm Regards
> Jatinder Singh
>|||"jsfromynr" <jatinder.singh@.clovertechnologies.com> wrote in message
news:1134572287.593693.239090@.g44g2000cwa.googlegroups.com...
> Hi All,
> I know there can be lot better ways to do the same thing
> (Finding all the childs of a given parent) . Please Provide some
> insight to improve my understanding of the topic .Trees and
> Hierarchies.
Go get a copy of Celko's book on Trees and hierarchies
ISBN: 1558609202
Excellent stuff in there.
Rick Sawtell
MCT, MCSD, MCDBA|||There's also a typo in one of the functions. Google for it to find Joe
Celko's first-hand errata corrige.
ML
http://milambda.blogspot.com/
I know there can be lot better ways to do the same thing
(Finding all the childs of a given parent) . Please Provide some
insight to improve my understanding of the topic .Trees and
Hierarchies.
Create Table ParentChild
(
Pid varchar(20),
Child varchar(20)
)
Insert into ParentChild values('Jatinder','k')
Insert into ParentChild values('Jatinder','B')
Insert into ParentChild values('Jatinder','C')
Insert into ParentChild values('Jatinder','D')
Insert into ParentChild values('Jatinder','E')
Insert into ParentChild values('Jatinder','F')
Insert into ParentChild values('Jatinder','G')
Insert into ParentChild values('B','aa')
Insert into ParentChild values('C','dd')
Insert into ParentChild values('D','ee')
Insert into ParentChild values('E','ff')
Insert into ParentChild values('F','gg')
Insert into ParentChild values('G',null)
Insert into ParentChild values('aa','xx')
Declare @.cnt int
Declare @.done int
Declare @.Lev int
Set @.Lev = 1
Create Table AllChilds ( Child varchar(20) unique,Lev int)
Insert Into AllChilds Select Child , @.Lev From ParentChild Where PID =
'jatinder'
Set @.cnt = 1
While @.@.rowcount > 0
Begin
Insert Into AllChilds
Select P.Child , (@.Lev + 1) From ParentChild P , AllChilds A
Where P.PID = A.Child And Lev = @.Lev And P.Child is Not Null
If @.@.RowCount = 0
Break
Set @.Lev = @.Lev + 1
End
Select * From AllChilds
Drop Table AllChilds
Drop Table ParentChild
With Warm Regards
Jatinder SinghTake a look at Itzik's example posted sometimes ago
create table users (userID Int, parentID Int)
insert into users select 1, 0 union all select 2, 1
union all select 3, 2 union all select 4, 3 union all
select 5, 4 union all select 6, 4 union all select 7, 5
union all select 8, 6 union all select 9, 7 union all select 10, 8
create function dbo.fn_getpath(@.uid as int) returns varchar(8000)
as
begin
declare @.path as varchar(8000);
set @.path = cast(@.uid as varchar(10));
while @.uid <> 0
begin
set @.uid = (select parentid from users where userid = @.uid);
set @.path = @.path + ',' + cast(@.uid as varchar(10));
end
return @.path;
end
go
select dbo.fn_getpath(5)
"jsfromynr" <jatinder.singh@.clovertechnologies.com> wrote in message
news:1134572287.593693.239090@.g44g2000cwa.googlegroups.com...
> Hi All,
> I know there can be lot better ways to do the same thing
> (Finding all the childs of a given parent) . Please Provide some
> insight to improve my understanding of the topic .Trees and
> Hierarchies.
> Create Table ParentChild
> (
> Pid varchar(20),
> Child varchar(20)
> )
> Insert into ParentChild values('Jatinder','k')
> Insert into ParentChild values('Jatinder','B')
> Insert into ParentChild values('Jatinder','C')
> Insert into ParentChild values('Jatinder','D')
> Insert into ParentChild values('Jatinder','E')
> Insert into ParentChild values('Jatinder','F')
> Insert into ParentChild values('Jatinder','G')
> Insert into ParentChild values('B','aa')
> Insert into ParentChild values('C','dd')
> Insert into ParentChild values('D','ee')
> Insert into ParentChild values('E','ff')
> Insert into ParentChild values('F','gg')
> Insert into ParentChild values('G',null)
> Insert into ParentChild values('aa','xx')
> Declare @.cnt int
> Declare @.done int
> Declare @.Lev int
> Set @.Lev = 1
> Create Table AllChilds ( Child varchar(20) unique,Lev int)
> Insert Into AllChilds Select Child , @.Lev From ParentChild Where PID =
> 'jatinder'
> Set @.cnt = 1
> While @.@.rowcount > 0
> Begin
> Insert Into AllChilds
> Select P.Child , (@.Lev + 1) From ParentChild P , AllChilds A
> Where P.PID = A.Child And Lev = @.Lev And P.Child is Not Null
> If @.@.RowCount = 0
> Break
> Set @.Lev = @.Lev + 1
> End
> Select * From AllChilds
> Drop Table AllChilds
> Drop Table ParentChild
> With Warm Regards
> Jatinder Singh
>|||"jsfromynr" <jatinder.singh@.clovertechnologies.com> wrote in message
news:1134572287.593693.239090@.g44g2000cwa.googlegroups.com...
> Hi All,
> I know there can be lot better ways to do the same thing
> (Finding all the childs of a given parent) . Please Provide some
> insight to improve my understanding of the topic .Trees and
> Hierarchies.
Go get a copy of Celko's book on Trees and hierarchies
ISBN: 1558609202
Excellent stuff in there.
Rick Sawtell
MCT, MCSD, MCDBA|||There's also a typo in one of the functions. Google for it to find Joe
Celko's first-hand errata corrige.
ML
http://milambda.blogspot.com/
2012年2月13日星期一
Any backup vendor can provide?
Some of my customers ask for backup their databases, mainly MSSQL & MS Exchange.
I search for any of backup vendor; there are 2 choices, service provider and software publisher. Service provider eliminates my technical support on backing up my clients databases:cool: ; software publisher offer a chance for me to create new business line:rolleyes: .
What would your gurus prefer and why?
Any admirable company you can name?I back up MSSQL using MSSQL backup procedures.
MS Exchange is not a database server, so I don't know the best way to back it up.|||Thanks blindman.
How about the servers are Windows-based, some are Linux-based?|||As Blindman says, the easiest and best way to back up SQL databases is by using the built-in backup utilities that come with SQL Server.
Your server support team might want to include SQL Server boxes as part of their backup routine, in which case there are various applications that typically use an Agent to backup SQL Server databases either at a database or filesystem level, e.g. Veritas, Legato, Litespeed.
Bottom line; you as a DBA should be in charge of your database backups.
Lempster|||I have the same issue. However, FreeBSD adds to my heterogeneous environment.|||I was sourcing for such a solution earlier. I gathered info from other forums and identified some data backup solutions targeting ISPs and web hosting businesses like ours. Heres a list which Ive evaluated:
1. NovaNet (www.novastor.com)
2. Ahsay (www.ahsay.com)
3. Storgrid (www.vembu.com)
4. RBS (www.remote-backup.com)
Only Storegrid and Ahsay are multi-platform. I was lured into NovaNet with its attractive look. However, once I tested it on my server, I was disappointed with its instability. RBS is another piece of crappy software.
In the end I went with Ahsay and was pretty satisfied with it. Back up and restore worked as it says on the tin.
I search for any of backup vendor; there are 2 choices, service provider and software publisher. Service provider eliminates my technical support on backing up my clients databases:cool: ; software publisher offer a chance for me to create new business line:rolleyes: .
What would your gurus prefer and why?
Any admirable company you can name?I back up MSSQL using MSSQL backup procedures.
MS Exchange is not a database server, so I don't know the best way to back it up.|||Thanks blindman.
How about the servers are Windows-based, some are Linux-based?|||As Blindman says, the easiest and best way to back up SQL databases is by using the built-in backup utilities that come with SQL Server.
Your server support team might want to include SQL Server boxes as part of their backup routine, in which case there are various applications that typically use an Agent to backup SQL Server databases either at a database or filesystem level, e.g. Veritas, Legato, Litespeed.
Bottom line; you as a DBA should be in charge of your database backups.
Lempster|||I have the same issue. However, FreeBSD adds to my heterogeneous environment.|||I was sourcing for such a solution earlier. I gathered info from other forums and identified some data backup solutions targeting ISPs and web hosting businesses like ours. Heres a list which Ive evaluated:
1. NovaNet (www.novastor.com)
2. Ahsay (www.ahsay.com)
3. Storgrid (www.vembu.com)
4. RBS (www.remote-backup.com)
Only Storegrid and Ahsay are multi-platform. I was lured into NovaNet with its attractive look. However, once I tested it on my server, I was disappointed with its instability. RBS is another piece of crappy software.
In the end I went with Ahsay and was pretty satisfied with it. Back up and restore worked as it says on the tin.
订阅:
博文 (Atom)