Friday, March 9, 2012
Need Page break for Every Odd Page
I have a table with group which populated on multiple pages. If the group
ended with odd page then I need an extra page break (1 blank page).
pls get me the details on that.
Thanks & Regards
Gopi RHi,
I expecting some Suggestion but no one answer to this question. pls give
the suggestion.
Thanks & Regards
Gopi R
"Gopala Krishnan" <Gopal@.photoninfotech.com> wrote in message
news:uhB83VCYFHA.3356@.TK2MSFTNGP15.phx.gbl...
> Hi,
> I have a table with group which populated on multiple pages. If the group
> ended with odd page then I need an extra page break (1 blank page).
> pls get me the details on that.
> Thanks & Regards
> Gopi R
>
>
>
Wednesday, March 7, 2012
need information for "Before Select" Trigger
Currently i'm facing a bit odd situation. i cant modify my code so i
have to make changes in SQL Server.
the problem is, i've modified one table by adding new column and now i
want only those row which has not null value in that column whenever
the select statement gets fire. i mean in every select statement only
those rows should be returned which has NOT NULL value in the newly
added column.
for this i've created one view and tried to run the application but the
i'm facing some problem as my application is developed in .net 2.0,
i've used lots of .net functionalities and now i cant make any changes
in Code.
another solution i think is triggers. if i can fire a trigger before
any select statements, my problem can be solved instantly but i'm
afraid i can not write andy "before select" trigger.
if anyone has any idea or any other solution to my problem, please let
me know.
all suggestions are welcomed.
thanks,
LuckyLucky (tushar.n.patel@.gmail.com) writes:
> Currently i'm facing a bit odd situation. i cant modify my code so i
> have to make changes in SQL Server.
> the problem is, i've modified one table by adding new column and now i
> want only those row which has not null value in that column whenever
> the select statement gets fire. i mean in every select statement only
> those rows should be returned which has NOT NULL value in the newly
> added column.
> for this i've created one view and tried to run the application but the
> i'm facing some problem as my application is developed in .net 2.0,
> i've used lots of .net functionalities and now i cant make any changes
> in Code.
> another solution i think is triggers. if i can fire a trigger before
> any select statements, my problem can be solved instantly but i'm
> afraid i can not write andy "before select" trigger.
There are no BEFORE SELECT triggers. (In fact, there are no BEFORE triggers
at all in SQL Server.)
The way to handle this would be define a view, which includs a filter on
this column.
However, personally, I would not add a view for such a simple condition,
but rather add it as needed.
If you real problem is that this table is referred to in lots of places
(lots => more than 20), and you want this column to take effect every
where, you could renamed the table, and then create a view with that
carries on the original name of the table.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Hi Pal,
i did the same way but as i said i'm using .net 2.0's dataset which
seems doesnt understands the view. As i've added "Enforced Constraints"
in the Dataset, may be that could not allowed the View to be considered
with foriegn key, unique value, not null constraint.
to avoid this situation i need to some other way. and yes it is true.
i'm reffering it in more then 20 webpages so i cant modifiy it.
anyways thanks for help.
Lucky
Erland Sommarskog wrote:
> Lucky (tushar.n.patel@.gmail.com) writes:
> > Currently i'm facing a bit odd situation. i cant modify my code so i
> > have to make changes in SQL Server.
> > the problem is, i've modified one table by adding new column and now i
> > want only those row which has not null value in that column whenever
> > the select statement gets fire. i mean in every select statement only
> > those rows should be returned which has NOT NULL value in the newly
> > added column.
> > for this i've created one view and tried to run the application but the
> > i'm facing some problem as my application is developed in .net 2.0,
> > i've used lots of .net functionalities and now i cant make any changes
> > in Code.
> > another solution i think is triggers. if i can fire a trigger before
> > any select statements, my problem can be solved instantly but i'm
> > afraid i can not write andy "before select" trigger.
> There are no BEFORE SELECT triggers. (In fact, there are no BEFORE triggers
> at all in SQL Server.)
> The way to handle this would be define a view, which includs a filter on
> this column.
> However, personally, I would not add a view for such a simple condition,
> but rather add it as needed.
> If you real problem is that this table is referred to in lots of places
> (lots => more than 20), and you want this column to take effect every
> where, you could renamed the table, and then create a view with that
> carries on the original name of the table.
>
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/pr...oads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodin...ions/books.mspx|||Lucky wrote:
> Hi Pal,
> i did the same way but as i said i'm using .net 2.0's dataset which
> seems doesnt understands the view. As i've added "Enforced Constraints"
> in the Dataset, may be that could not allowed the View to be considered
> with foriegn key, unique value, not null constraint.
> to avoid this situation i need to some other way. and yes it is true.
> i'm reffering it in more then 20 webpages so i cant modifiy it.
> anyways thanks for help.
> Lucky
I don't think I understand what your problem is but you can obtain the
same effect as a "before" trigger by referring to the virtual table
called Deleted within the trigger. The Deleted table contains the state
of the changed rows before the statement was executed.
--
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/...US,SQL.90).aspx
--|||Lucky (tushar.n.patel@.gmail.com) writes:
> i did the same way but as i said i'm using .net 2.0's dataset which
> seems doesnt understands the view. As i've added "Enforced Constraints"
> in the Dataset, may be that could not allowed the View to be considered
> with foriegn key, unique value, not null constraint.
> to avoid this situation i need to some other way. and yes it is true.
> i'm reffering it in more then 20 webpages so i cant modifiy it.
Looks like you have to modify 20+ web pages one way or another.
I don't really know how your .Net looks like, but permit me to point
out that had you retrieved the data with stored procedures, the change
would have been snap.
Then again, not even that should be necessary. Had you defined the
SelectCommand for the adapter in one place, it would also have been
a simple thing.
So when you modify your 20+ web pages, you strive to find a strategy
so that it does not happen again.
You may also want to visit microsoft.public.dotnet.framework.adonet for
better advice for the ADO .Net side of things.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx
Saturday, February 25, 2012
Need Help. Please
I know it is a bit odd to ask questions on my first posting. I'm new at setting up a MS SQL 2000 Server. I would really appreciate if you can help clarify a few of my questions :) .
I'm considering to buy SQL 2000 Ent. Ed and Windows Server 2003 Ent. Ed. for my two new Servers. I've tried to contact MS customer support, but they are not very helpful :( . I've searched many articles, most of them are not very helpful in helping me make the decision :( .
I would like to set up a cluster with two Windows 2003 Server Ent. Ed. One for active SQL2000 Ent. Ed. and another one for passive. Can this work?
For the Server running the passive SQL 2000. I'll be running a java networking application. I would like to know if the passive windows server 2003 fails, will the Windows Server 2003 be able to handle the failover and transfer my java application to the other server. :confused:
Thanks a lot in advance. Any help is appreciated.
Best Regards,
Keen HonTypically, Microsoft prefers the customer to engage either an OEM or a Microsoft Solutions Provider for this kind of pre-sales support, but that is no reason for them to ignore your request. How did you try to contact customer support?
-PatP|||I called the Customer Care Centre (Microsoft Careline) for my Country in Singapore. I also called some of the Resellers. Maybe I will call the OEM to try my luck.
- KH|||You do know what you're configuring will be a lot of cash...
And you should probably get another box for the app server...
You do know that clustering is NOT for load balancing...right....and don't you want another box for shared Disk?|||Of course your application will be failed over...only if you make it a cluster-aware service.
Need Help, fast
using to to return several different queries in the SP. The first
query gets the value of the int based on a date, @.minsess. @.minsess is
then used in multiple queries in the SP. For some reason if I replace
@.minsess with a value say 656 then query plan changes and the entire sp
executes in seconds, with @.minsess each query takes much longer
resulting in the SP taking more than a minute to execute.
A dumbed down version of this would be like this.
Select @.minsess = min(sessionid) from table1 where FileDate >=
CONVERT(varchar(10), getdate() - 3, 112)
Select * FRom table2 where sessionid >= @.minsess
Select * FRom table2 where sessionid >= 656
In this example @.minsess would equal 656. Both are INTs, why in the
world would the first table2 hit take multiple times longer to return
than the second?For a parameter to a stored procedure, the optimizer picks up the value for
when the execution plan
is created ("first execution") and put into cache. This is the value the opt
imize base its execution
plan on.
For a constant, then the optimize know the value.
For a variable, the optimizer doesn't know the value and have to guess the s
electivity (number of
rows that matches).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Paul Moore" <ptmoore@.gmail.com> wrote in message
news:1108047830.104598.326620@.o13g2000cwo.googlegroups.com...
>I have a SP which is having an odd problem. There is an int which I am
> using to to return several different queries in the SP. The first
> query gets the value of the int based on a date, @.minsess. @.minsess is
> then used in multiple queries in the SP. For some reason if I replace
> @.minsess with a value say 656 then query plan changes and the entire sp
> executes in seconds, with @.minsess each query takes much longer
> resulting in the SP taking more than a minute to execute.
> A dumbed down version of this would be like this.
> Select @.minsess = min(sessionid) from table1 where FileDate >=
> CONVERT(varchar(10), getdate() - 3, 112)
> Select * FRom table2 where sessionid >= @.minsess
>
> Select * FRom table2 where sessionid >= 656
> In this example @.minsess would equal 656. Both are INTs, why in the
> world would the first table2 hit take multiple times longer to return
> than the second?
>|||You get this problem because you use a variable in a WHERE clause. Because
the Query Optimizer doesn't know at compile time what the value of the
variable will be, it decides on a query plan based on an estimate of the
number of rows that will be returned. For a >= comparison it assumes 30% of
the rows will be returned IIRC.
If you change your code to:
Select * FRom table2 where sessionid >= (Select min(sessionid) from table1
where FileDate >=
CONVERT(varchar(10), getdate() - 3, 112))
the Query Optimizer will come up with a faster execution plan.
Jacco Schalkwijk
SQL Server MVP
"Paul Moore" <ptmoore@.gmail.com> wrote in message
news:1108047830.104598.326620@.o13g2000cwo.googlegroups.com...
>I have a SP which is having an odd problem. There is an int which I am
> using to to return several different queries in the SP. The first
> query gets the value of the int based on a date, @.minsess. @.minsess is
> then used in multiple queries in the SP. For some reason if I replace
> @.minsess with a value say 656 then query plan changes and the entire sp
> executes in seconds, with @.minsess each query takes much longer
> resulting in the SP taking more than a minute to execute.
> A dumbed down version of this would be like this.
> Select @.minsess = min(sessionid) from table1 where FileDate >=
> CONVERT(varchar(10), getdate() - 3, 112)
> Select * FRom table2 where sessionid >= @.minsess
>
> Select * FRom table2 where sessionid >= 656
> In this example @.minsess would equal 656. Both are INTs, why in the
> world would the first table2 hit take multiple times longer to return
> than the second?
>|||Thanks