Showing posts with label number. Show all posts
Showing posts with label number. Show all posts

Friday, March 30, 2012

Resource Limits ?

In Oracle & Sybase you can set login resource limits to restrict, time of day, number of i-o's, cpu use etc for any login, at the login method. All actions done from a resource limit constrained login inherit the constraints.

Is there any way to implment this with any MS SQL Server version from 200-2005/SP2?

Before anyone answers, please do not suggest set rowcount etc.
thanks.I don't see this kind of feature available yet in any of the versions of SQL Server, however workaround are the only possible methods like the one you have suggested.sql

Resolving

Hello!

I am having trouble connection to my SQL 2000 SP4 using TCP IP.

I can only connect specifying the port number in for instance query analyzer. What do I need to do to get it connecting without port number? Do I unblock the resolution protocol UDP 1434 in my firewall?

Carl
Norway

What is error message. If the error is something close to ""Error Locating Server/Instance Specified", you need to enable the sql browser and make sure the udp port 1434 is not blocked by the firewall.

The following link have plenty of the content on troubleshooting connectivity issues.

http://blogs.msdn.com/sql_protocols/archive/2005/10/22/483684.aspx

cheers,

|||

Thanks!

But that was concerning SQL2005. My server is 2000 SP4.

But UDP in the firewall is the only possible thing? Because I can connect spesifying the port.

Carl

|||You need connectivity to sqlbrowser in order to resolve the port number for each instance. It applies to both 2000 and 2005.|||

How can I identify the Browser Service?

I have two servers running. One where everything works fine, and this newly installed one where port resolution does not work.

As of now I can not see any difference in the configuration.

sql

Resolving

Hello!

I am having trouble connection to my SQL 2000 SP4 using TCP IP.

I can only connect specifying the port number in for instance query analyzer. What do I need to do to get it connecting without port number? Do I unblock the resolution protocol UDP 1434 in my firewall?

Carl
Norway

What is error message. If the error is something close to ""Error Locating Server/Instance Specified", you need to enable the sql browser and make sure the udp port 1434 is not blocked by the firewall.

The following link have plenty of the content on troubleshooting connectivity issues.

http://blogs.msdn.com/sql_protocols/archive/2005/10/22/483684.aspx

cheers,

|||

Thanks!

But that was concerning SQL2005. My server is 2000 SP4.

But UDP in the firewall is the only possible thing? Because I can connect spesifying the port.

Carl

|||You need connectivity to sqlbrowser in order to resolve the port number for each instance. It applies to both 2000 and 2005.|||

How can I identify the Browser Service?

I have two servers running. One where everything works fine, and this newly installed one where port resolution does not work.

As of now I can not see any difference in the configuration.

Resolving

Hello!

I am having trouble connection to my SQL 2000 SP4 using TCP IP.

I can only connect specifying the port number in for instance query analyzer. What do I need to do to get it connecting without port number? Do I unblock the resolution protocol UDP 1434 in my firewall?

Carl
Norway

What is error message. If the error is something close to ""Error Locating Server/Instance Specified", you need to enable the sql browser and make sure the udp port 1434 is not blocked by the firewall.

The following link have plenty of the content on troubleshooting connectivity issues.

http://blogs.msdn.com/sql_protocols/archive/2005/10/22/483684.aspx

cheers,

|||

Thanks!

But that was concerning SQL2005. My server is 2000 SP4.

But UDP in the firewall is the only possible thing? Because I can connect spesifying the port.

Carl

|||You need connectivity to sqlbrowser in order to resolve the port number for each instance. It applies to both 2000 and 2005.|||

How can I identify the Browser Service?

I have two servers running. One where everything works fine, and this newly installed one where port resolution does not work.

As of now I can not see any difference in the configuration.

Wednesday, March 28, 2012

Resize Report Column Width when Hidden

I have a report that has a certain number of columns that are hidden and when hidden they leave a lot of white space. Is there a way to detect when they are hidden and set the width property to 0 and then reverse the value when they are visible?I used a list box with embedded list boxes to control the column widths automatically. Now the problem is that If I give column headers in the list they do not shrink and I don't want the data repeated above each group either. Any ideas?sql

Resize rectangle

I am putting a rectangle around my table. Table's height can grow alone with
a number of rows.
Can I resize a height of the rectangle accordingly?
ThanksOn Apr 4, 12:12 pm, "Mark Goldin" <mgol...@.ufandd.com> wrote:
> I am putting a rectangle around my table. Table's height can grow alone with
> a number of rows.
> Can I resize a height of the rectangle accordingly?
> Thanks
If I'm understanding you correctly, the rectangle will automatically
grow w/the size of the table.
Regards,
Enrique Martinez
Sr. Software Consultant

Resetting the pagenumber at new every group

I need to print multi-paged invoices. Therefore I'd like to
reset the page number to 1 whenever the customer changes
(i.e. pagenumbering on group-level). The whole print-job
encompasses hundreds of pages.
How can I do this?This cannot be done in the current release.
--
Ravi Mumulla (Microsoft)
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Daniel Aebi" <maus2001@.bluewin.ch> wrote in message
news:Ompzea5eEHA.2544@.TK2MSFTNGP10.phx.gbl...
> I need to print multi-paged invoices. Therefore I'd like to
> reset the page number to 1 whenever the customer changes
> (i.e. pagenumbering on group-level). The whole print-job
> encompasses hundreds of pages.
> How can I do this?
>
>

Resetting Page Number in SQL Reporting Services

Does anyone know of a way to reset page numbering when the group changes?
Thanks,
DennyDenny:
Try this blog that I found on this same group.
http://blogs.msdn.com/bwelcker/archive/2005/05/19/420046.aspx
Sher
Denny wrote:
> Does anyone know of a way to reset page numbering when the group changes?
> Thanks,
> Denny

Monday, March 26, 2012

Reset Total page number in a group

I know how to reset the page numbers with each group, but how do you reset the total page number within each group.

EX. Code for page of total pages

="Page " & Globals.PageNumber & " of " & Globals.TotalPages

EX. Code to reset within a group

Custom Code:

Shared offset as Integer

Shared currentgroup as object

Public Function GetGroupPageNumber(group as Object, pagenumber as Integer) as Object

If not (group = currentgroup)

offset = pagenumber - 1

currentgroup= group

end if

return pagenumber - offset

end function

=Code.GetGroupPageNumber(ReportItems!Category.Value(grouping),Globals!PageNumber)

What I need is code for a combination of the two...to display code for page of total pages that resets within a group.

Any help is greatly appreciated.

Thanks!

Hello,

I am facing the exact same need. Anyone solve this?

Reset Total page number in a group

I know how to reset the page numbers with each group, but how do you reset the total page number within each group.

EX. Code for page of total pages

="Page " & Globals.PageNumber & " of " & Globals.TotalPages

EX. Code to reset within a group

Custom Code:

Shared offset as Integer

Shared currentgroup as object

Public Function GetGroupPageNumber(group as Object, pagenumber as Integer) as Object

If not (group = currentgroup)

offset = pagenumber - 1

currentgroup= group

end if

return pagenumber - offset

end function

=Code.GetGroupPageNumber(ReportItems!Category.Value(grouping),Globals!PageNumber)

What I need is code for a combination of the two...to display code for page of total pages that resets within a group.

Any help is greatly appreciated.

Thanks!

Hello,

I am facing the exact same need. Anyone solve this?

Reset The Auto Generated Numbers

How can I reset an auto generated number back to start from 1 again.
I made a test table, now to implement the table I need to start the counter back from 1.

The field that I am trying to reset is CustID
It is a primary key for a table and it is set as an Indentity with Increment 1.

Thanks
Taimur"Truncate table" will reset the identity counter to the original seed value.|||or you could use the following (where TestTable is the name of the table):

DBCC CHECKIDENT (jobs, TestTable, 1)|||Sorry... just to correct the previous posting:

DBCC CHECKIDENT (TestTable, RESEED, 1)|||Thanks Iwaker. This worked perfect. :)

Originally posted by lwaker
Sorry... just to correct the previous posting:

DBCC CHECKIDENT (TestTable, RESEED, 1)sql

Reset tables

I

use Microsoft SQL Server and also I have several tables. One table has

ID like PK, and name. ID use autoincrement number mode, and now when I

want start form one but not from 156 or like that. I don't know how?

And also when I delete all data from table an run my apllication and

add something in table, it starts form last number, not from one.

Maybe can I do it from SQL menagement studio?

How I can reset table and start from 1?Make sure the table is empty or else this won't work. Go to SQL management studio. Go to modify table. Select the identity column. Look in the column properties window under identity specification. There you see the Identitiy Seed. Change the value (for instance to 2) and save it. Change it back to 1 and save is again. This should do the trick.|||Hi,

have a look in the BOL for the following command:

DBCC CHECKIDENT ('HumanResources.Employee', RESEED, 30)

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

reset sql 2000 sequential number

Hello, I have a table where I'm deleting the contents before populating the table with new data. I have an ID column that is autogenerating a sequential number. I would like to reset this number back to 1 when I delete the contents of the table. How can this be accomplished?you could TRUNCATE the table. check out Books On Line for more info.|||Hey ndinakar! Thanks for responding. That's what I came up with too. But, I've heard that truncating a table was bad news; not a best practice. All I know is that it works so I will go with it. Have a good one.|||If TRUNCATE TABLE had not worked in your scenario (and in somescenarios it will not), you can delete all of the records in the tableand then runDBCC CHECKIDENT to reset the identity value.

Friday, March 23, 2012

Reset PageNumber On Group Change

I need to reset the page number when a group changes. The group is controlled
in a list. PageNumber works well for overall numbering, but not inside the
group, furthermore, I cannot access the current pagenumber from inside the
group.
I am using RS 2005.Add this to your report code:
Shared offset as Integer
Public Function GrpPN(reset As Boolean, pagenumber As Integer) As Integer
If reset
offset = pagenumber - 1
End if
Return pagenumber - offset
End Function
Then place a text box in the page footer with this expression - assuming you
have the group set with page break at end and have labeled your Group cell.
="Page " & Code.GrpPN(Not(ReportItems!txtGroup.Value Is Nothing),
Globals!PageNumber)
Hope that helps (this was in 2000)
--
Allison
"Rick" wrote:
> I need to reset the page number when a group changes. The group is controlled
> in a list. PageNumber works well for overall numbering, but not inside the
> group, furthermore, I cannot access the current pagenumber from inside the
> group.
> I am using RS 2005.

Reset Page Numbering Total

I am wanting to reset the page number on the break of each group.
For example
Group A - 3 pages
Group B - 4 pages
So for group B on the 4th page it will start with 1, using the following
code this does this fine
Shared offset As Integer
Public Function GetPN(reset As Boolean, pagenumber As Integer) As Integer
If reset
offset = pagenumber - 1
End If
Return pagenumber - offset
End Function
I am wanting to do this for the total of the pages as well so for example
page 4 would show as 1 of 4 instead of 1 of 7
How do I get this working for the total pages as well as the individual pagesI have the same problem, did you come up with any solution?
"Mark Stanley" wrote:
> I am wanting to reset the page number on the break of each group.
> For example
> Group A - 3 pages
> Group B - 4 pages
> So for group B on the 4th page it will start with 1, using the following
> code this does this fine
> Shared offset As Integer
> Public Function GetPN(reset As Boolean, pagenumber As Integer) As Integer
> If reset
> offset = pagenumber - 1
> End If
> Return pagenumber - offset
> End Function
> I am wanting to do this for the total of the pages as well so for example
> page 4 would show as 1 of 4 instead of 1 of 7
> How do I get this working for the total pages as well as the individual pages|||Jim,
See my earlier posting in this thread.
It's not a simple solution but it might help.
Chris
JIM.H. wrote:
> I have the same problem, did you come up with any solution?
> "Mark Stanley" wrote:
> > I am wanting to reset the page number on the break of each group.
> >
> > For example
> >
> > Group A - 3 pages
> > Group B - 4 pages
> >
> > So for group B on the 4th page it will start with 1, using the
> > following code this does this fine
> >
> > Shared offset As Integer
> >
> > Public Function GetPN(reset As Boolean, pagenumber As Integer) As
> > Integer If reset
> > offset = pagenumber - 1
> > End If
> > Return pagenumber - offset
> > End Function
> >
> > I am wanting to do this for the total of the pages as well so for
> > example page 4 would show as 1 of 4 instead of 1 of 7
> >
> > How do I get this working for the total pages as well as the
> > individual pages|||Hi Chris,
Did you mean you attached something in the previous message, I am using web
interface and do not know how to see attachments.
"Chris McGuigan" wrote:
> Jim,
> See my earlier posting in this thread.
> It's not a simple solution but it might help.
> Chris
>
> JIM.H. wrote:
> > I have the same problem, did you come up with any solution?
> >
> > "Mark Stanley" wrote:
> >
> > > I am wanting to reset the page number on the break of each group.
> > >
> > > For example
> > >
> > > Group A - 3 pages
> > > Group B - 4 pages
> > >
> > > So for group B on the 4th page it will start with 1, using the
> > > following code this does this fine
> > >
> > > Shared offset As Integer
> > >
> > > Public Function GetPN(reset As Boolean, pagenumber As Integer) As
> > > Integer If reset
> > > offset = pagenumber - 1
> > > End If
> > > Return pagenumber - offset
> > > End Function
> > >
> > > I am wanting to do this for the total of the pages as well so for
> > > example page 4 would show as 1 of 4 instead of 1 of 7
> > >
> > > How do I get this working for the total pages as well as the
> > > individual pages
>|||Jim,
Here is the contents of the file;
----
Unfortunately, there's currently no good way to build a table of
contents.
And even adding defined execution order isn't going to help, since
pagination happens as a completely separate step from the rest of the
report. This is because you can request the same report with different
page
size/margin settings (and even an entirely different rendering target,
which
could radically change pagination). Under normal circumstances, we don't
want to force reexecution of the entire report just because you change
your
margins.
To handle table of contents type operations, we're going to (eventually)
have to implement an entirely new mode wherein we know that the body of
the
report contains references to page numbers, which will force the entire
report to reexecute if pagination information changes.
In the mean time, there's no general solution for the table of contents
problem.
But... Since you're doing this in a batch once a month, you may not
need a
fully general solution.
Without further ado, here's Sleazy Hack #792 ("Simulating Table of
Contents
in Batch Reporting Scenarios"):
1. Write a custom assembly containing a class that can write rows to a
TableOfContents table in your database.
Have shared methods for both initializing the TOC and writing a new
row
to the TOC.
Note: Don't forget to give it database permissions in the CAS file
when
you deploy it to your server.
See the documentation for details on custom assemblies.
2. In the Code section of the report, call the TOC initialization in
the
OnInit() event.
3. At the start of each section you want to appear in your TOC, put a
hidden textbox that contains the label you want to appear in your TOC.
4. In the page header, put a hidden textbox with something like the
following expression:
=Code.MyTOCClass.AddToTOC(Globals.PageNumber,ReportItems!Textbox1.Value
& ReportItems!Textbox2.Value & ReportItems!Textbox3.Value)
Texbox1, Textbox2 and Textbox3 are the names of the hidden textboxes
from step 3 (since only one will appear on any given page, the rest
will be
empty)
5. Add a dataset to your report which selects from the TableOfContents
table
6. Display the results of the TOC data set in a table at the end of
your
report*
7. Run the report twice. The first time will initialize the TOC. The
second time will use the values from the previous run.
* If you want it at the beginning, you'll either need to run the report
three times (the first to get some rows into the TOC table, the second
to
get the numbers populated correctly and the third to use those numbers)
or
you'll need to make sure the TOC table has the right number of rows to
begin
with (perhaps by not emptying it from the previous month) otherwise your
page numbers will be incorrect due to the TOC pushing things around.
This
isn't an issue if your TOC is only one page long and has PageBreakAtEnd,
however.
JIM.H. wrote:
> Hi Chris,
> Did you mean you attached something in the previous message, I am
> using web interface and do not know how to see attachments.
> "Chris McGuigan" wrote:
> > Jim,
> > See my earlier posting in this thread.
> > It's not a simple solution but it might help.
> >
> > Chris
> >
> >
> > JIM.H. wrote:
> >
> > > I have the same problem, did you come up with any solution?
> > >
> > > "Mark Stanley" wrote:
> > >
> > > > I am wanting to reset the page number on the break of each
> > > > group.
> > > >
> > > > For example
> > > >
> > > > Group A - 3 pages
> > > > Group B - 4 pages
> > > >
> > > > So for group B on the 4th page it will start with 1, using the
> > > > following code this does this fine
> > > >
> > > > Shared offset As Integer
> > > >
> > > > Public Function GetPN(reset As Boolean, pagenumber As Integer)
> > > > As Integer If reset
> > > > offset = pagenumber - 1
> > > > End If
> > > > Return pagenumber - offset
> > > > End Function
> > > >
> > > > I am wanting to do this for the total of the pages as well so
> > > > for example page 4 would show as 1 of 4 instead of 1 of 7
> > > >
> > > > How do I get this working for the total pages as well as the
> > > > individual pages
> >
> >|||Yes there was an attachment. You'll need a "proper" newsreader - I
recommend XanaNews, which can be downloaded at
http://www.wilsonc.demon.co.uk/d9xananews.htm
I've put the contents in another post for you.
Chris
JIM.H. wrote:
> Hi Chris,
> Did you mean you attached something in the previous message, I am
> using web interface and do not know how to see attachments.
> "Chris McGuigan" wrote:
> > Jim,
> > See my earlier posting in this thread.
> > It's not a simple solution but it might help.
> >
> > Chris
> >
> >
> > JIM.H. wrote:
> >
> > > I have the same problem, did you come up with any solution?
> > >
> > > "Mark Stanley" wrote:
> > >
> > > > I am wanting to reset the page number on the break of each
> > > > group.
> > > >
> > > > For example
> > > >
> > > > Group A - 3 pages
> > > > Group B - 4 pages
> > > >
> > > > So for group B on the 4th page it will start with 1, using the
> > > > following code this does this fine
> > > >
> > > > Shared offset As Integer
> > > >
> > > > Public Function GetPN(reset As Boolean, pagenumber As Integer)
> > > > As Integer If reset
> > > > offset = pagenumber - 1
> > > > End If
> > > > Return pagenumber - offset
> > > > End Function
> > > >
> > > > I am wanting to do this for the total of the pages as well so
> > > > for example page 4 would show as 1 of 4 instead of 1 of 7
> > > >
> > > > How do I get this working for the total pages as well as the
> > > > individual pages
> >
> >

Reset Page count, use distinctcount() for page number, or SPROC cursor to reset page numbe

I have a report that will come back as 20 pages.
What the user wants is on the beginning of another unique ID, which causes a new page to be started, to have the page count restart to 1.
So, if I have 3 UniqueIDs for all 20 pages, and the first, IDAA, is 10 pages long, the second, IDBB, is 4 pages long, and the third, IDCC, is 6 pages long, then the page numbering would be as:
1-10 for IDAA
1-4 for IDBB
1-6 for IDCC
I've been told to set a cursor in a SP that determines what page I'm on and then passses this to the result set as a column. This is then set in a group to control page breaks. How could I do this? I'm not very familiar with SPROC cursors.
I know how to do this scenario in Crystal Reports, but am trying to figure it out here with either a page count formula, or some type of distinct count().
Thanks!

This is what I've tried so far, but it resets on every page.
So, each page is 1 even if the Unique ID spans 2-3 pages.
I only need it to reset on a new field grouping of the list object.

Here's the VB code for the report:

Shared offset As Integer

Public Function GetPN(reset As Boolean, pagenumber As Integer) As Integer
If reset
offset = pagenumber - 1
End If
Return pagenumber - offset
End Function

***************************

In the header, I have a textbox named "tag"

In the footer, I've got the following expression:
="Unique ID Page: " & Code.GetPN(Not(ReportItems!tag.Value Is Nothing),Globals!PageNumber)

|||

Blank

|||

My fault...I had the textbox "tag" in the page header and not in the list object itself.

It works!

Thanks!

Reset identity column

A number of records were written to a table with an identity column that has an identity seed.
These records had to be deleted, and I would like to begin the numeric sequence at a point as if the records had never been added. E.g., before the incorrect records were added, the value of this column was 2500. Two hundred records were added, then remov
ed. I would like the next value to be 2501, however new records are starting at 2701, after the incorrect records were removed.
Is DBCC CHECKIDENT the only way to correct this? Do I have to reseed the value, or is there another way?
Thanks for any assistance on this.
Never mind, I have answered my own question: dbcc checkident is the solution...
Thanks
"TomT" wrote:

> A number of records were written to a table with an identity column that has an identity seed.
> These records had to be deleted, and I would like to begin the numeric sequence at a point as if the records had never been added. E.g., before the incorrect records were added, the value of this column was 2500. Two hundred records were added, then rem
oved. I would like the next value to be 2501, however new records are starting at 2701, after the incorrect records were removed.
> Is DBCC CHECKIDENT the only way to correct this? Do I have to reseed the value, or is there another way?
> Thanks for any assistance on this.

Reset identity column

A number of records were written to a table with an identity column that has
an identity seed.
These records had to be deleted, and I would like to begin the numeric seque
nce at a point as if the records had never been added. E.g., before the inco
rrect records were added, the value of this column was 2500. Two hundred rec
ords were added, then remov
ed. I would like the next value to be 2501, however new records are starting
at 2701, after the incorrect records were removed.
Is DBCC CHECKIDENT the only way to correct this? Do I have to reseed the val
ue, or is there another way?
Thanks for any assistance on this.Never mind, I have answered my own question: dbcc checkident is the solution
...
Thanks
"TomT" wrote:

> A number of records were written to a table with an identity column that h
as an identity seed.
> These records had to be deleted, and I would like to begin the numeric sequence at
a point as if the records had never been added. E.g., before the incorrect records
were added, the value of this column was 2500. Two hundred records were added, then
rem
oved. I would like the next value to be 2501, however new records are starting at 2701, afte
r the incorrect records were removed.
> Is DBCC CHECKIDENT the only way to correct this? Do I have to reseed the v
alue, or is there another way?
> Thanks for any assistance on this.

Reset identity column

A number of records were written to a table with an identity column that has an identity seed.
These records had to be deleted, and I would like to begin the numeric sequence at a point as if the records had never been added. E.g., before the incorrect records were added, the value of this column was 2500. Two hundred records were added, then removed. I would like the next value to be 2501, however new records are starting at 2701, after the incorrect records were removed.
Is DBCC CHECKIDENT the only way to correct this? Do I have to reseed the value, or is there another way?
Thanks for any assistance on this.Never mind, I have answered my own question: dbcc checkident is the solution...
Thanks
"TomT" wrote:
> A number of records were written to a table with an identity column that has an identity seed.
> These records had to be deleted, and I would like to begin the numeric sequence at a point as if the records had never been added. E.g., before the incorrect records were added, the value of this column was 2500. Two hundred records were added, then removed. I would like the next value to be 2501, however new records are starting at 2701, after the incorrect records were removed.
> Is DBCC CHECKIDENT the only way to correct this? Do I have to reseed the value, or is there another way?
> Thanks for any assistance on this.

reset Identity

I have an integer field set identity ON. How can I reset the identity number
to 1? Thanks Anyway!You need to use the DBCC CHECKIDENT command. DBCC CHECKIDENT(TableName,
RESEED, IdentityValue)
ie. To reseed the Identity of the Employees table to 0:
DBCC CHECKIDENT(employees, RESEED, 0)
- Peter Ward
WARDY IT Solutions
"kinloan" wrote:
> I have an integer field set identity ON. How can I reset the identity number
> to 1? Thanks Anyway!
>