|
do a ORDER BY on the 'H' (date) column.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
This will work when I select the data and showed in DataGridView example
but I want to rearrangement inside the Table of DB.
|
|
|
|
|
Performance wise there shouldn't be much of a hit for performance. If performance goes down the dumper, add a WHERE clause or an index.
For whatever odd reason, if you really wanted to resort the data based on the data column. Create a temp copy of the table, copy the data into it, delete the data from the orig, and then insert the databack into the orig and use the order by. Again, why you would want to do this is beyond me and really isn't needed.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Hey guys i am in confusion for VS 2008
i was using VS 2005 before
now i move to make new enhancement
please help me for making a student database for the timetable
|
|
|
|
|
download and setup SQL express
Create your database
create your tables
create your relationships
create your CRUD procedures
Nothing to do with VS
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Are you doing a Homework ?
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswam@its.co.za
|
|
|
|
|
hello
SQL Profiler been replaced in SQL 2005?
Thanks
dev
|
|
|
|
|
Nope look under tools, first menu item!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
That's SQL2000
What about 2005? I go Management Studio there's nothing there except:
1. External Tools
2. Customize
3. Options
Where is it in 2005?
dev
|
|
|
|
|
The very first item under Tools menu is Profiler.
C isn't that hard: void (*(*f[])())() defines f as an array of unspecified size, of pointers to functions that return pointers to functions that return void
"Always program as if the person who will be maintaining your program is a violent psychopath that knows where you live." - Martin Golding
|
|
|
|
|
I suggest you have a dodgy installation, it is there for both 2005 and 08.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Trace Start...
Yes.......profiler is in 2005.....agreed with Holmes that your install is probably hosed if you don't see it there.
Run the setup again and add it.
Trace Paused...
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Do you have Express Edition of the Management Studio. If I remember correctly, profiler isn't included in that version.
|
|
|
|
|
o darn... that's the reason!! Many thanks!
dev
|
|
|
|
|
|
Hi all,
Iam Using Sql reporting Services and I want to keep a page break for each 10 records in a group...from 11 th record it should come in next page...How to do tat..i gave searched in net and wrote a expression in formula field of group
Int((RowNumber(Nothing)-1)/1)..it is displaying only one record in each page ..
how to do tat??Can anyone Help me..
|
|
|
|
|
If you're using Tablix you could try to modify your formula to define page break point to something like:
=Ceiling(RowNumber(Nothing) / 10)
|
|
|
|
|
I gave the formula in page break ..but also it is displaying only one record in eachpage
|
|
|
|
|
Try this one...
=(RowNumber(Nothing) - (RowNumber(Nothing) Mod 10)) / 10
It should produce a group number for each 10 records; it's basically the same as DivRem, but since DivRem requires a variable by reference to hold the remainder I don't know of a way to use it in SSRS. Anyhow, for records 1 - 10 this should produce 1, 11 - 20, 2, etc. RowNumber(Nothing) Mod 10 gives you the remainder, in this case the number in the ones position (if it's RowNumber 24, it will give you 4) which you then subtract from row number to give you the tens position (24 - 4 = 20) which is then divided by 10 to give the group number (20 / 10 = 2).
Keep It Simple Stupid! (KISS)
|
|
|
|
|
One other thing, I've never done this before so I cannot say for sure that you can do it in SSRS. If you cannot get it to work; add a column to your result set to hold the group number and populate it in the query that produces the data and then just group on the group number column in the report. I've had to use that approach for other complex things that I just couldn't get to work directly in the SSRS report.
Keep It Simple Stupid! (KISS)
|
|
|
|
|
Ok thank u..I tried using tat formula..But it is displaying one record in every page...
|
|
|
|
|
Hi Guys
I Have A function to select Parent rows And child of the specific id.
my function have been worked properly but Suddenly its generate this Error :
Maximum stored procedure, function, trigger, or view nesting level exceeded (limit 32)
My Function Is :
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER FUNCTION [dbo].[fn_EmpRec]
(
@TemplatesID int,
@depth int
)
RETURNS @Templates TABLE
(
TemplatesID bigint,
[Name] nvarchar(50),
ParentID bigint,
depth int,
Weight float
)
AS
BEGIN
-- insert current Template into working table
INSERT INTO @Templates
SELECT TemplatesID,
[Name],
ParentID,
@depth
,Weight
FROM [Assessment].[Template]
WHERE TemplatesID = @TemplatesID
-- holding variable to keep track of current child
DECLARE @curTemplatesID int
-- get the first child
SELECT @curTemplatesID = MIN(TemplatesID)
FROM [Assessment].[Template]
WHERE ParentID = @TemplatesID
-- iterate each child and make the recursive call
WHILE @curTemplatesID IS NOT NULL
BEGIN
INSERT INTO @Templates
SELECT *
FROM dbo.fn_EmpRec(@curTemplatesID, @depth + 1)
SELECT @curTemplatesID = MIN(TemplatesID)
FROM [Assessment].[Template]
WHERE TemplatesID > @curTemplatesID AND
ParentID = @TemplatesID
END
RETURN
END
Any Sujestions?
|
|
|
|
|
It looks like the recursion amount in your function is dependent on the data, so perhaps you now have data which ends up to more than 32 recursions levels.
Use for example PRINT statement and print out different information from the function when executing it. Info like:
- @depth
- @TemplatesID
- @curTemplatesID etc.
That info might explain the situation and/or logic problems for you when you see the actual data that's being used.
|
|
|
|
|
This most definitely is the problem. The usual alternative to recursion is to introduce a stack structure. Essentially, you're using a stack with recursion: the call stack. However, when you run into these types of issues you usually have to create your own stack. It's pretty easy to do in SQL Server, a temp table will be your stack and you'll have an integer column that represents the nest level. As you go through your loop you will select from the temp table records with max nest level. If those items have children, you will create a new nest level, if not you have reached the end of that level of nesting and will work back through the earlier nest levels. Also, with a stack you usually have to pre-fill it with a single root record to get the whole process going. I've seen an article or two about doing this type of thing with Common Table Expressions, but have never tried that approach myself, but it may end up being easier that way.
Keep It Simple Stupid! (KISS)
|
|
|
|
|
Ben Fair wrote: I've seen an article or two about doing this type of thing with Common Table Expressions, but have never tried that approach myself, but it may end up being easier that way
Yes, actually a normal tree structure is very easy to handle with CTE with or without recursion limits (configurable). If the data describes a net it's more complicated and also limited, but I don't believe that's the case in here.
|
|
|
|