Showing posts with label created. Show all posts
Showing posts with label created. Show all posts

Tuesday, March 27, 2012

Binding Datatable to Report

Hi,

I have created a datatable which is filled by the result of stored procedure. So I need to know like how to bind this datatable with the report using report viewer.

Apoorva

First you have to make sure you have a dataset. Also that the data set is connecting to this table.

If this is your first time creating a report I would suggest finding a walk through on a simple report creation

Here is a pretty good wak through

http://www.codeproject.com/dotnet/HowToReport.asp

good luck

Bind multi-table dataset to a datagrid

I have created a SQL procedure that returns a dataset with a varying number of tables like the following example:

RepID-- PhoneUPS
---- ----
3---- 3

RepID-- PhoneUPS
---- ----
4---- 0

RepID-- PhoneUPS
---- ----
5---- 2

No more results.
(9 row(s) returned)
@.RETURN_VALUE = 0

All of the tables have the same header row, but are a seperate table. From my experience, I am not able to bind more than one table to a datagrid. Does anyone have any suggestions on how I can go about displaying this full dataset on my aspx page? I've been going in circles on this for two days, so I'm open to any suggestions :)

Cheers,
AndrewCan you create a UNION query in the stored procedure, rather then seperate resultsets?

Failing that, you can manually add each row of each resultset to the Items collection of the Datagrid.|||Thanks for the tip. I've been working on my SQL procedure trying to incorporate the UNION in the SELECT statement. I am having problems with the logic of working it in, though. Here is the original SQL procedure I've created:

/*BEGIN Procedure */

ALTER PROCEDURE Rep_Status_Array

AS

/* Build array or ID numbers to cycle through */
DECLARE RepIDs_cursor CURSOR
FOR SELECT UserID
FROM TBL_Users
WHERE (TBL_Users.DepartmentID > 0)

OPEN RepIDs_cursor
DECLARE @.userID int
FETCH NEXT FROM RepIDs_cursor INTO @.userID

/* Begin WHILE loop to collect data for each ID */
WHILE (@.@.FETCH_STATUS <> -1)
BEGIN
SELECT
RepID=@.userID,

PhoneUPS=(SELECT Count(*) FROM TBL_UpEntry WHERE (TypeID = 11) AND (SalesmanID = @.userID)),

LOTUPS=(SELECT Count(*) FROM TBL_UpEntry WHERE (TypeID = 1) AND (SalesmanID = @.userID)),

CVR=(SELECT Count(*) FROM TBL_UpEntry WHERE (TypeID = 1) AND (SalesmanID = @.userID)),

FETCH NEXT FROM RepIDs_cursor INTO @.userID
END
/* END WHILE loop */

CLOSE RepIDs_cursor
DEALLOCATE RepIDs_cursor

/* END Procedure */

The problem I'm having with this is that each time through the WHILE loop creates a new table in the dataset that is returned by the procedure. Any suggestions?|||Is it even possible to use UNION or UNION ALL within a WHILE loop?|||To the best of my knowledge, it is not possible to use the UNION statement in conjunction with a WHILE loop.

I'm going to go with Douglas' second recommendation and manually create a table within my page, adding each row one at a time.|||Another alternative:

Create a temporary table, and then INSERT all selected rows into the temp table, and then at the end of the SP,

SELECT * FROM #temp

(with any required ORDER BY).|||Thanks for the help, Douglas, much appreciated!

Andrew

Tuesday, March 20, 2012

big update problem!

I have a mini .net application that I have created to make some pretty
complex transformationsdatabase.
All the code, .net datatables and logic etc takes 3 minutes to run on the
entire database. However, when I put in the update statements the same
process takes
3 1/2 hours!
So I know its not becuase I am using datatables or that my select statements
are poor etc etc etc. Its 100% the update statements.
Any clues? is this normal? are updates statements the most expensive in time?ADDED:
I am also able to create and populate a fairly large table in a matter of
minutes however updating to this one table is costing a lot of time.
Now granted this table in question is much larger then most tables in the DB
and larger then the tables I create but not 10 times larger!
Also, this table gets a lot of activity. Could our problem be the table
itself?
"Sean" wrote:
> I have a mini .net application that I have created to make some pretty
> complex transformationsdatabase.
> All the code, .net datatables and logic etc takes 3 minutes to run on the
> entire database. However, when I put in the update statements the same
> process takes
> 3 1/2 hours!
> So I know its not becuase I am using datatables or that my select statements
> are poor etc etc etc. Its 100% the update statements.
> Any clues? is this normal? are updates statements the most expensive in time?|||Yes, and it could be a hardware problem or the phase of the moon. With no
information about what the table looks like, what you are trying to do and
what else is running, there's no way to tell. This is like calling your
mechanic and saying it takes to long for me to get to work, what should I
do? The main difference between update statements and select statements is
they take update locks and write to disk. I would look at blocking waiting
to lock something that's in use first but that's just idle speculation.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Sean" <Sean@.discussions.microsoft.com> wrote in message
news:6E7394B4-A544-4111-A35B-4661DF0C459C@.microsoft.com...
> ADDED:
> I am also able to create and populate a fairly large table in a matter of
> minutes however updating to this one table is costing a lot of time.
> Now granted this table in question is much larger then most tables in the
> DB
> and larger then the tables I create but not 10 times larger!
> Also, this table gets a lot of activity. Could our problem be the table
> itself?
> "Sean" wrote:
>> I have a mini .net application that I have created to make some pretty
>> complex transformationsdatabase.
>> All the code, .net datatables and logic etc takes 3 minutes to run on the
>> entire database. However, when I put in the update statements the same
>> process takes
>> 3 1/2 hours!
>> So I know its not becuase I am using datatables or that my select
>> statements
>> are poor etc etc etc. Its 100% the update statements.
>> Any clues? is this normal? are updates statements the most expensive in
>> time?|||Well there is currently only 3 people accessing the server and only one (me)
accessing this particular database.
by my estimations it is taking about 1-3 seconds to update a row and in this
context each row has to be updated seperately.
Having said all that I think the functionality we are gaining might not be
worth the dev time which is a subject I will have for our meeting.
"Roger Wolter[MSFT]" wrote:
> Yes, and it could be a hardware problem or the phase of the moon. With no
> information about what the table looks like, what you are trying to do and
> what else is running, there's no way to tell. This is like calling your
> mechanic and saying it takes to long for me to get to work, what should I
> do? The main difference between update statements and select statements is
> they take update locks and write to disk. I would look at blocking waiting
> to lock something that's in use first but that's just idle speculation.
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> "Sean" <Sean@.discussions.microsoft.com> wrote in message
> news:6E7394B4-A544-4111-A35B-4661DF0C459C@.microsoft.com...
> > ADDED:
> >
> > I am also able to create and populate a fairly large table in a matter of
> > minutes however updating to this one table is costing a lot of time.
> >
> > Now granted this table in question is much larger then most tables in the
> > DB
> > and larger then the tables I create but not 10 times larger!
> >
> > Also, this table gets a lot of activity. Could our problem be the table
> > itself?
> >
> > "Sean" wrote:
> >
> >> I have a mini .net application that I have created to make some pretty
> >> complex transformationsdatabase.
> >> All the code, .net datatables and logic etc takes 3 minutes to run on the
> >> entire database. However, when I put in the update statements the same
> >> process takes
> >> 3 1/2 hours!
> >> So I know its not becuase I am using datatables or that my select
> >> statements
> >> are poor etc etc etc. Its 100% the update statements.
> >>
> >> Any clues? is this normal? are updates statements the most expensive in
> >> time?
>
>|||Sean wrote:
> Well there is currently only 3 people accessing the server and only one (me)
> accessing this particular database.
> by my estimations it is taking about 1-3 seconds to update a row and in this
> context each row has to be updated seperately.
> Having said all that I think the functionality we are gaining might not be
> worth the dev time which is a subject I will have for our meeting.
>
1-3 seconds to update a record? How many indexes are on this table? Is
there a clustered index? Is the column you're updating part of the
clustered index key? Are there update triggers on the table?|||Basically none of the above and its safe to assume no optimization strategies
have been done for this database.
We have a primary key on this table but that is it really.
I have studied some on clustering because I wanted to go from MCAD to MCSD
but I dropped that database study so in short I am database stupid outside of
basic T-SQL statements.
If you guys think clustering etc will help a lot I will look into it because
this table is getting big.
Thanks
"Tracy McKibben" wrote:
> Sean wrote:
> > Well there is currently only 3 people accessing the server and only one (me)
> > accessing this particular database.
> > by my estimations it is taking about 1-3 seconds to update a row and in this
> > context each row has to be updated seperately.
> >
> > Having said all that I think the functionality we are gaining might not be
> > worth the dev time which is a subject I will have for our meeting.
> >
> 1-3 seconds to update a record? How many indexes are on this table? Is
> there a clustered index? Is the column you're updating part of the
> clustered index key? Are there update triggers on the table?
>|||and correction, its only .4 a second for updates per record.
Its just that at the point of production we will have
157,000 records which if this was all we were doing it would be fine. but
this one item is taking up more then 50% of the time for our data conversion.
"Sean" wrote:
> Basically none of the above and its safe to assume no optimization strategies
> have been done for this database.
> We have a primary key on this table but that is it really.
> I have studied some on clustering because I wanted to go from MCAD to MCSD
> but I dropped that database study so in short I am database stupid outside of
> basic T-SQL statements.
> If you guys think clustering etc will help a lot I will look into it because
> this table is getting big.
> Thanks
>
>
>
> "Tracy McKibben" wrote:
> > Sean wrote:
> > > Well there is currently only 3 people accessing the server and only one (me)
> > > accessing this particular database.
> > > by my estimations it is taking about 1-3 seconds to update a row and in this
> > > context each row has to be updated seperately.
> > >
> > > Having said all that I think the functionality we are gaining might not be
> > > worth the dev time which is a subject I will have for our meeting.
> > >
> >
> > 1-3 seconds to update a record? How many indexes are on this table? Is
> > there a clustered index? Is the column you're updating part of the
> > clustered index key? Are there update triggers on the table?
> >

Thursday, March 8, 2012

BI Development Studio: Crashes when viewing a Cube in the Browser

Hello, I created an Analysis Services project, defined the views and the cube itself. After I deployed the cube, I wanted to compare the results with the browser.

Everytime I try to open the browser, BIDS starts loading, but after a while it crashes.

Is this a known error?

Thanks in advance!

Are you running Office 2007 on the same machine as BIDS? Is it a beta version of Office 2007?

You have not told us about the sp for SQL Server 2005 or if you run a version of Office 2003 or later on the same machine.

Try downloading SP2 CTP3 (December 2006) from www.microsoft.com/sql and see if it helps.

Regards

Thomas Ivarsson

|||

Yes, I do run Office2003 on my machine, btw it is an Acer5102-notebook. I installed the SP2 CTP3, but the error still occurs.

Any other suggestions, it is really urgent?


Thanks in advance!

|||

I hope by the word "crash" you do not mean that you get a hour glass.

1. Do you run any Firewall? I have seen some issues with Integrity where one would not be able to browse the cube.

2. Did you try browsing the cube from any other application instead of VS? like Excel

3. Also are you trying to go to the Browse tab after the cube is completely deployed. I have some instances where if you try to shift tabs while the cube is being deployed the VS crashes (shuts down completely and launches again)

See, if it is related to any of the aboce behaviors?

|||

I have never had any problem with BIDS and Office2003 since SQL Server 2005 RTM.

Try to install this add in for Excel 2003 and connect to the cube: http://www.microsoft.com/downloads/details.aspx?FamilyId=DAE82128-9F21-475D-88A4-4B6E6C069FF0&displaylang=en

Have you runned windows update and especially office update lately?

Regards

Thomas Ivarsson

BI Development Studio: Crashes when viewing a Cube in the Browser

Hello, I created an Analysis Services project, defined the views and the cube itself. After I deployed the cube, I wanted to compare the results with the browser.

Everytime I try to open the browser, BIDS starts loading, but after a while it crashes.

Is this a known error?

Thanks in advance!

Are you running Office 2007 on the same machine as BIDS? Is it a beta version of Office 2007?

You have not told us about the sp for SQL Server 2005 or if you run a version of Office 2003 or later on the same machine.

Try downloading SP2 CTP3 (December 2006) from www.microsoft.com/sql and see if it helps.

Regards

Thomas Ivarsson

|||

Yes, I do run Office2003 on my machine, btw it is an Acer5102-notebook. I installed the SP2 CTP3, but the error still occurs.

Any other suggestions, it is really urgent?


Thanks in advance!

|||

I hope by the word "crash" you do not mean that you get a hour glass.

1. Do you run any Firewall? I have seen some issues with Integrity where one would not be able to browse the cube.

2. Did you try browsing the cube from any other application instead of VS? like Excel

3. Also are you trying to go to the Browse tab after the cube is completely deployed. I have some instances where if you try to shift tabs while the cube is being deployed the VS crashes (shuts down completely and launches again)

See, if it is related to any of the aboce behaviors?

|||

I have never had any problem with BIDS and Office2003 since SQL Server 2005 RTM.

Try to install this add in for Excel 2003 and connect to the cube: http://www.microsoft.com/downloads/details.aspx?FamilyId=DAE82128-9F21-475D-88A4-4B6E6C069FF0&displaylang=en

Have you runned windows update and especially office update lately?

Regards

Thomas Ivarsson

Wednesday, March 7, 2012

Between date problem

I have a SP that gets two dates passed to it. Those dates are then used to
pull records created between those dates. The problem is that the created
date is a timestamp and so when I pass 3/15/2006 and 3/15/2006 no rows are
returned. If I want today's records I have to pass 3/15/2006 and 3/16/2006.
This is my where clause WHERE CONVERT(VARCHAR(10),Created_TS,112) BETWEEN
@.strFromDate AND @.strToDate How can I fix this? Thanks.Don't use BETWEEN. And don't pass in a string in that format, use YYYYMMDD
and SMALLDATETIME parameters. Don't do any string conversions of the value
in the table. This will basically destroy performance and doesn't do a
whole lot for readability of the query, either. Finally, pass in the day
*after* the end of the range. So, for 3/15 -> 3/15, pass in 3/15 and 3/16.
Then, say:
CREATE PROCEDURE dbo.foo
@.rangeStart SMALLDATETIME,
@.rangeEnd SMALLDATETIME
AS
BEGIN
SET NOCOUNT ON;
SELECT ...
WHERE Created_TS >= @.rangeStart
AND Created_TS < @.rangeEnd;
END
GO
e.g.
EXEC dbo.foo @.rangeStart = '20060315', @.rangeEnd = '20060316';
"Phill" <Phill@.discussions.microsoft.com> wrote in message
news:2A9229F5-B2D5-4830-99D1-2C57FAF75D3C@.microsoft.com...
>I have a SP that gets two dates passed to it. Those dates are then used to
> pull records created between those dates. The problem is that the created
> date is a timestamp and so when I pass 3/15/2006 and 3/15/2006 no rows are
> returned. If I want today's records I have to pass 3/15/2006 and
> 3/16/2006.
> This is my where clause WHERE CONVERT(VARCHAR(10),Created_TS,112) BETWEEN
> @.strFromDate AND @.strToDate How can I fix this? Thanks.

Friday, February 24, 2012

best/fastest why to do this - high level

Hello
Here is table
FileID FileType DateCreated Active
1 Revised 1-Jan-06 1
1 Revised 2-Jan-06 1
1 Created 3-Jan-06 1
2 Created 4-Jan-06 1
2 Revised 5-Jan-06 1
3 Created 6-Jan-06 1
3 Revised 7-Jan-06 1
3 Revised 8-Jan-06 1
3 Revised 9-Jan-06 1
and i want to set old records Active column 0. An old record is defined as
sorting by FileID ASC, FileType DSC, DateCreated DSC. Any record beside the
first one is old. I.e.
FileID FileType DateCreated Active
1 Revised 2-Jan-06 1
1 Revised 1-Jan-06 0
1 Created 3-Jan-06 0
2 Revised 5-Jan-06 1
2 Created 4-Jan-06 0
3 Revised 9-Jan-06 1
3 Revised 8-Jan-06 0
3 Revised 7-Jan-06 0
3 Created 6-Jan-06 0
now this table will keep growing and growing so here is my idea.
1. Select FileID's that have a active count > 1 where active = 1. The reason
i do this is because if i have a fileID that has not been updated in awhile
then i do not want to waste time reupdating these records.
2. get the latest records for the FileID's found in step one. I would have
to use a subquery to get the latest FileID for each found in step 1.
3. update records that to not equal the records found in step 2 where active
= 1.
Wanted to know ppls thoughs on my approch and if there is a better way of
doing it.
ThanksTry,
update t1
set active = 0
where exists (
select *
from t1 as t2
where t2.FileID = t1.FileID and t2.DateCreated > t1.DateCreated
)
go
AMB
"John Smith" wrote:

> Hello
> Here is table
> FileID FileType DateCreated Active
> 1 Revised 1-Jan-06 1
> 1 Revised 2-Jan-06 1
> 1 Created 3-Jan-06 1
> 2 Created 4-Jan-06 1
> 2 Revised 5-Jan-06 1
> 3 Created 6-Jan-06 1
> 3 Revised 7-Jan-06 1
> 3 Revised 8-Jan-06 1
> 3 Revised 9-Jan-06 1
>
> and i want to set old records Active column 0. An old record is defined as
> sorting by FileID ASC, FileType DSC, DateCreated DSC. Any record beside th
e
> first one is old. I.e.
> FileID FileType DateCreated Active
> 1 Revised 2-Jan-06 1
> 1 Revised 1-Jan-06 0
> 1 Created 3-Jan-06 0
> 2 Revised 5-Jan-06 1
> 2 Created 4-Jan-06 0
> 3 Revised 9-Jan-06 1
> 3 Revised 8-Jan-06 0
> 3 Revised 7-Jan-06 0
> 3 Created 6-Jan-06 0
>
> now this table will keep growing and growing so here is my idea.
> 1. Select FileID's that have a active count > 1 where active = 1. The reas
on
> i do this is because if i have a fileID that has not been updated in awhil
e
> then i do not want to waste time reupdating these records.
> 2. get the latest records for the FileID's found in step one. I would have
> to use a subquery to get the latest FileID for each found in step 1.
> 3. update records that to not equal the records found in step 2 where acti
ve
> = 1.
>
> Wanted to know ppls thoughs on my approch and if there is a better way of
> doing it.
> Thanks
>
>|||On Wed, 24 May 2006 17:57:01 -0700, Alejandro Mesa
<AlejandroMesa@.discussions.microsoft.com> wrote:

>Try,
>update t1
>set active = 0
>where exists (
>select *
>from t1 as t2
>where t2.FileID = t1.FileID and t2.DateCreated > t1.DateCreated
> )
>go
That answer does not address the requirement to sequence on FileType
DESC before DateCreated.
Roy Harvey
Beacon Falls, CT|||How can a file be revised before it is created? Is this valid data, or a
typo? Are you concerned with the latest date for each FileID being the
active one, or do you really want to sort alphabetically descending on
FileType?
"John Smith" <zzaro@.excite.com> wrote in message
news:uo$j5G4fGHA.4784@.TK2MSFTNGP03.phx.gbl...
> Hello
> Here is table
> FileID FileType DateCreated Active
> 1 Revised 1-Jan-06 1
> 1 Revised 2-Jan-06 1
> 1 Created 3-Jan-06 1
> 2 Created 4-Jan-06 1
> 2 Revised 5-Jan-06 1
> 3 Created 6-Jan-06 1
> 3 Revised 7-Jan-06 1
> 3 Revised 8-Jan-06 1
> 3 Revised 9-Jan-06 1
>
> and i want to set old records Active column 0. An old record is defined as
> sorting by FileID ASC, FileType DSC, DateCreated DSC. Any record beside
the
> first one is old. I.e.
> FileID FileType DateCreated Active
> 1 Revised 2-Jan-06 1
> 1 Revised 1-Jan-06 0
> 1 Created 3-Jan-06 0
> 2 Revised 5-Jan-06 1
> 2 Created 4-Jan-06 0
> 3 Revised 9-Jan-06 1
> 3 Revised 8-Jan-06 0
> 3 Revised 7-Jan-06 0
> 3 Created 6-Jan-06 0
>
> now this table will keep growing and growing so here is my idea.
> 1. Select FileID's that have a active count > 1 where active = 1. The
reason
> i do this is because if i have a fileID that has not been updated in
awhile
> then i do not want to waste time reupdating these records.
> 2. get the latest records for the FileID's found in step one. I would have
> to use a subquery to get the latest FileID for each found in step 1.
> 3. update records that to not equal the records found in step 2 where
active
> = 1.
>
> Wanted to know ppls thoughs on my approch and if there is a better way of
> doing it.
> Thanks
>|||update t1
set active = 0
where active = 1 --just to avoid rows that do not need updating
and exists
(
select *
from t1 as t2
where t2.FileID = t1.FileID
and
(
(
t2.DateCreated > t1.DateCreated
and t2.FileType = t1.FileType
)
or
t2.FileType < t1.FileType
)
)
"Roy Harvey" <roy_harvey@.snet.net> wrote in message
news:n31a7259n1ndr6ounml4jbmqs5hkgtbadj@.
4ax.com...
> On Wed, 24 May 2006 17:57:01 -0700, Alejandro Mesa
> <AlejandroMesa@.discussions.microsoft.com> wrote:
>
> That answer does not address the requirement to sequence on FileType
> DESC before DateCreated.
>
as
the
> Roy Harvey
> Beacon Falls, CT|||Well there are two ppl that run a program to create a "revised" file or a
"created" file.
the person that creates a "created" file does not work on the wend and
cannot run the "created" file progarm. but the person that runs the revised
can run it 24/7.
this is why i sort by file type. because if i have a "revised" file i dont
care for the "created" file
so yes i need to sort by file type.
"Jim Underwood" <james.underwoodATfallonclinic.com> wrote in message
news:eYlpsOAgGHA.4940@.TK2MSFTNGP05.phx.gbl...
> How can a file be revised before it is created? Is this valid data, or a
> typo? Are you concerned with the latest date for each FileID being the
> active one, or do you really want to sort alphabetically descending on
> FileType?
> "John Smith" <zzaro@.excite.com> wrote in message
> news:uo$j5G4fGHA.4784@.TK2MSFTNGP03.phx.gbl...
> the
> reason
> awhile
> active
>|||I want to only deal with fileID that have count(active) > 1 where active = 1
is there a way to do this without a having?
the query you gave me will look at every fileID where its = 1. Every fileID
will always have one record set to one. I onley want to deal with fileID
that have more then one record set to active.
"Jim Underwood" <james.underwoodATfallonclinic.com> wrote in message
news:ODjrAVAgGHA.4940@.TK2MSFTNGP05.phx.gbl...
> update t1
> set active = 0
> where active = 1 --just to avoid rows that do not need updating
> and exists
> (
> select *
> from t1 as t2
> where t2.FileID = t1.FileID
> and
> (
> (
> t2.DateCreated > t1.DateCreated
> and t2.FileType = t1.FileType
> )
> or
> t2.FileType < t1.FileType
> )
> )
> "Roy Harvey" <roy_harvey@.snet.net> wrote in message
> news:n31a7259n1ndr6ounml4jbmqs5hkgtbadj@.
4ax.com...
> as
> the
>|||You have to look at every fileId to determine if it has a count > 1, my
approach attempts identifies the "Active Row" and update all the other
records by exclusion. In any case, you have to look at the rows with
count=1 in order to exclude them. You can't know how many rows you have
without looking at those rows first.
That said, adding another criteria to the main select may affect
performance. You would have to try it both ways to see which is faster. I
think it is simply redundant, and expect it to hurt performance, but it is
worth a try.
and fileID in (select t3.fileID
from t1 as t3
group by t3.fileID
having count(t3.fileID) >1)
or:
and exists (select t3.fileID from t1 as t3
where t3.fileID = t1.fileID
group by t3.fileID
having count(t3.fileID) >1)
or:
and not exists (select t3.fileID from t1 as t3
where t3.fileID = t1.fileID
group by t3.fileID
having count(t3.fileID) =1)
"John Smith" <zzaro@.excite.com> wrote in message
news:unuhs0AgGHA.1456@.TK2MSFTNGP04.phx.gbl...
> I want to only deal with fileID that have count(active) > 1 where active =
1
> is there a way to do this without a having?
> the query you gave me will look at every fileID where its = 1. Every
fileID
> will always have one record set to one. I onley want to deal with fileID
> that have more then one record set to active.
> "Jim Underwood" <james.underwoodATfallonclinic.com> wrote in message
> news:ODjrAVAgGHA.4940@.TK2MSFTNGP05.phx.gbl...
>

Best way to view reports from a webpage

I can view a report created in SSRS by using a url or by using an Reportviewer control in asp.net 2.0 what is the best way to view reports from a webpage?

you can use the report viewer control in your web page and render the reports throught it for more info read this article

http://www.gotreportviewer.com/

Sunday, February 19, 2012

best way to run 45 queries in a row?

Hi,
I have created 45 queries that I need to run which will seperate and
stratify data. Each one has to be run one after the other. Right now I sit
there and muanually run them in the SQL Query Analyzer screen. Is there
something I can create to run them automatically, one after the other?
Thanks
If you have to do this more than once you can create a multistep Job or a DTS
package
http://sqlservercode.blogspot.com/
"John Jasper" wrote:

> Hi,
> I have created 45 queries that I need to run which will seperate and
> stratify data. Each one has to be run one after the other. Right now I sit
> there and muanually run them in the SQL Query Analyzer screen. Is there
> something I can create to run them automatically, one after the other?
> Thanks
|||You could copy and paste them all into one stored procedure, with some error
handling thrown in to exit and alert you if one failed...
Kevin Hill
President
3NF Consulting
www.3nf-inc.com/NewsGroups.htm
"John Jasper" <JohnJasper@.discussions.microsoft.com> wrote in message
news:74DA6630-0986-4014-AE2E-DACEDF9200D9@.microsoft.com...
> Hi,
> I have created 45 queries that I need to run which will seperate and
> stratify data. Each one has to be run one after the other. Right now I
> sit
> there and muanually run them in the SQL Query Analyzer screen. Is there
> something I can create to run them automatically, one after the other?
> Thanks

best way to run 45 queries in a row?

Hi,
I have created 45 queries that I need to run which will seperate and
stratify data. Each one has to be run one after the other. Right now I sit
there and muanually run them in the SQL Query Analyzer screen. Is there
something I can create to run them automatically, one after the other?
ThanksIf you have to do this more than once you can create a multistep Job or a DT
S
package
http://sqlservercode.blogspot.com/
"John Jasper" wrote:

> Hi,
> I have created 45 queries that I need to run which will seperate and
> stratify data. Each one has to be run one after the other. Right now I si
t
> there and muanually run them in the SQL Query Analyzer screen. Is there
> something I can create to run them automatically, one after the other?
> Thanks|||You could copy and paste them all into one stored procedure, with some error
handling thrown in to exit and alert you if one failed...
Kevin Hill
President
3NF Consulting
www.3nf-inc.com/NewsGroups.htm
"John Jasper" <JohnJasper@.discussions.microsoft.com> wrote in message
news:74DA6630-0986-4014-AE2E-DACEDF9200D9@.microsoft.com...
> Hi,
> I have created 45 queries that I need to run which will seperate and
> stratify data. Each one has to be run one after the other. Right now I
> sit
> there and muanually run them in the SQL Query Analyzer screen. Is there
> something I can create to run them automatically, one after the other?
> Thanks

best way to run 45 queries in a row?

Hi,
I have created 45 queries that I need to run which will seperate and
stratify data. Each one has to be run one after the other. Right now I sit
there and muanually run them in the SQL Query Analyzer screen. Is there
something I can create to run them automatically, one after the other?
ThanksIf you have to do this more than once you can create a multistep Job or a DTS
package
http://sqlservercode.blogspot.com/
"John Jasper" wrote:
> Hi,
> I have created 45 queries that I need to run which will seperate and
> stratify data. Each one has to be run one after the other. Right now I sit
> there and muanually run them in the SQL Query Analyzer screen. Is there
> something I can create to run them automatically, one after the other?
> Thanks|||You could copy and paste them all into one stored procedure, with some error
handling thrown in to exit and alert you if one failed...
--
Kevin Hill
President
3NF Consulting
www.3nf-inc.com/NewsGroups.htm
"John Jasper" <JohnJasper@.discussions.microsoft.com> wrote in message
news:74DA6630-0986-4014-AE2E-DACEDF9200D9@.microsoft.com...
> Hi,
> I have created 45 queries that I need to run which will seperate and
> stratify data. Each one has to be run one after the other. Right now I
> sit
> there and muanually run them in the SQL Query Analyzer screen. Is there
> something I can create to run them automatically, one after the other?
> Thanks

Thursday, February 16, 2012

best way to preserve all dependencies

I know ive asked this before and created seperate publications for tables
and views,etc in order to avoid conflicts such as view being created before
the table,etc..
What do u guys prefer as the best method to handle this, especially if
reinitialize a publication that has tables in it and it results in error as
the table properties has a drop to it and hence would not be able to drop as
a view is present..
There must be better ways to handle all of this . If only I could create one
publication for all objects belonging to one database ..if only all of the
dependencies were ordered.
Hassan,
like you, I have separate publications - one for tables, one for views and
one for UDFs.
AFAIK, dropping a table should be fine unless the view has been created
using schemabinding.
For those cases where dependency info of views is incorrect, sp_refreshview
is sometimes useful; sometimes use sp_addscriptexec; sometimes just add the
view manually on the subscriber when there is connectivity and there is only
one subscriber.
HTH,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Friday, February 10, 2012

Best way for generating a Sequenzenumber

Hi
I'm interested to know what the besrt way would be to create a sequenze
number.
How can I prevent that a number will be created twice? What are your
thoughts?
Thank's
MichelHow about using an IDENTITY column?
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006
"Michel" <michel_mueller@.bluewin.ch> wrote in message
news:usU97m5oHHA.4424@.TK2MSFTNGP03.phx.gbl...
> Hi
> I'm interested to know what the besrt way would be to create a sequenze
> number.
> How can I prevent that a number will be created twice? What are your
> thoughts?
> Thank's
> Michel
>|||The number should start from 0 and we should be able to change the number in
some years to 0 again.
"Aaron Bertrand [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> schrieb im
Newsbeitrag news:uIxOgr5oHHA.4132@.TK2MSFTNGP02.phx.gbl...
> How about using an IDENTITY column?
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.sqlblog.com/
> http://www.aspfaq.com/5006
>
>
> "Michel" <michel_mueller@.bluewin.ch> wrote in message
> news:usU97m5oHHA.4424@.TK2MSFTNGP03.phx.gbl...
>|||Michael,
declare your column: MyKey int IDENTITY(0,1) and it will start at zero and
count by one.
TRUNCATE TABLE MyTable will clear all the data from the table and reset the
IDENTITY counter back to zero.
Thank you,
Daniel Jameson
SQL Server DBA
Children's Oncology Group
www.childrensoncologygroup.org
"Michel" <michel_mueller@.bluewin.ch> wrote in message
news:%239QX245oHHA.4032@.TK2MSFTNGP02.phx.gbl...
> The number should start from 0 and we should be able to change the number
> in some years to 0 again.
>
> "Aaron Bertrand [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> schrieb im
> Newsbeitrag news:uIxOgr5oHHA.4132@.TK2MSFTNGP02.phx.gbl...
>|||> The number should start from 0
IDENTITY can start at 0.

> and we should be able to change the number in some years to 0 again.
Do you mean in combination with deleting all of the existing data? If so,
then yes, you can truncate the table (which will also reseed the identity
back to 0) or you can delete manually (which you will need to do, and in a
certain order, if other tables reference this identity value through an FK
relationship) and then use DBCC CHECKIDENT with RESEED and/or drop the table
and re-create it.
If you need to keep the existing data, please explain how anyone can
distinguish between the first row with a value of 0 and a new row when you
start over.
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006

Best way for generating a Sequenzenumber

Hi
I'm interested to know what the besrt way would be to create a sequenze
number.
How can I prevent that a number will be created twice? What are your
thoughts?
Thank's
MichelHow about using an IDENTITY column?
--
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006
"Michel" <michel_mueller@.bluewin.ch> wrote in message
news:usU97m5oHHA.4424@.TK2MSFTNGP03.phx.gbl...
> Hi
> I'm interested to know what the besrt way would be to create a sequenze
> number.
> How can I prevent that a number will be created twice? What are your
> thoughts?
> Thank's
> Michel
>|||The number should start from 0 and we should be able to change the number in
some years to 0 again.
"Aaron Bertrand [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> schrieb im
Newsbeitrag news:uIxOgr5oHHA.4132@.TK2MSFTNGP02.phx.gbl...
> How about using an IDENTITY column?
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.sqlblog.com/
> http://www.aspfaq.com/5006
>
>
> "Michel" <michel_mueller@.bluewin.ch> wrote in message
> news:usU97m5oHHA.4424@.TK2MSFTNGP03.phx.gbl...
>> Hi
>> I'm interested to know what the besrt way would be to create a sequenze
>> number.
>> How can I prevent that a number will be created twice? What are your
>> thoughts?
>> Thank's
>> Michel
>|||Michael,
declare your column: MyKey int IDENTITY(0,1) and it will start at zero and
count by one.
TRUNCATE TABLE MyTable will clear all the data from the table and reset the
IDENTITY counter back to zero.
--
Thank you,
Daniel Jameson
SQL Server DBA
Children's Oncology Group
www.childrensoncologygroup.org
"Michel" <michel_mueller@.bluewin.ch> wrote in message
news:%239QX245oHHA.4032@.TK2MSFTNGP02.phx.gbl...
> The number should start from 0 and we should be able to change the number
> in some years to 0 again.
>
> "Aaron Bertrand [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> schrieb im
> Newsbeitrag news:uIxOgr5oHHA.4132@.TK2MSFTNGP02.phx.gbl...
>> How about using an IDENTITY column?
>> --
>> Aaron Bertrand
>> SQL Server MVP
>> http://www.sqlblog.com/
>> http://www.aspfaq.com/5006
>>
>>
>> "Michel" <michel_mueller@.bluewin.ch> wrote in message
>> news:usU97m5oHHA.4424@.TK2MSFTNGP03.phx.gbl...
>> Hi
>> I'm interested to know what the besrt way would be to create a sequenze
>> number.
>> How can I prevent that a number will be created twice? What are your
>> thoughts?
>> Thank's
>> Michel
>>
>|||> The number should start from 0
IDENTITY can start at 0.
> and we should be able to change the number in some years to 0 again.
Do you mean in combination with deleting all of the existing data? If so,
then yes, you can truncate the table (which will also reseed the identity
back to 0) or you can delete manually (which you will need to do, and in a
certain order, if other tables reference this identity value through an FK
relationship) and then use DBCC CHECKIDENT with RESEED and/or drop the table
and re-create it.
If you need to keep the existing data, please explain how anyone can
distinguish between the first row with a value of 0 and a new row when you
start over.
--
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006

Best way for generating a Sequenzenumber

Hi
I'm interested to know what the besrt way would be to create a sequenze
number.
How can I prevent that a number will be created twice? What are your
thoughts?
Thank's
Michel
How about using an IDENTITY column?
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006
"Michel" <michel_mueller@.bluewin.ch> wrote in message
news:usU97m5oHHA.4424@.TK2MSFTNGP03.phx.gbl...
> Hi
> I'm interested to know what the besrt way would be to create a sequenze
> number.
> How can I prevent that a number will be created twice? What are your
> thoughts?
> Thank's
> Michel
>
|||The number should start from 0 and we should be able to change the number in
some years to 0 again.
"Aaron Bertrand [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> schrieb im
Newsbeitrag news:uIxOgr5oHHA.4132@.TK2MSFTNGP02.phx.gbl...
> How about using an IDENTITY column?
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.sqlblog.com/
> http://www.aspfaq.com/5006
>
>
> "Michel" <michel_mueller@.bluewin.ch> wrote in message
> news:usU97m5oHHA.4424@.TK2MSFTNGP03.phx.gbl...
>
|||Michael,
declare your column: MyKey int IDENTITY(0,1) and it will start at zero and
count by one.
TRUNCATE TABLE MyTable will clear all the data from the table and reset the
IDENTITY counter back to zero.
Thank you,
Daniel Jameson
SQL Server DBA
Children's Oncology Group
www.childrensoncologygroup.org
"Michel" <michel_mueller@.bluewin.ch> wrote in message
news:%239QX245oHHA.4032@.TK2MSFTNGP02.phx.gbl...
> The number should start from 0 and we should be able to change the number
> in some years to 0 again.
>
> "Aaron Bertrand [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> schrieb im
> Newsbeitrag news:uIxOgr5oHHA.4132@.TK2MSFTNGP02.phx.gbl...
>
|||> The number should start from 0
IDENTITY can start at 0.

> and we should be able to change the number in some years to 0 again.
Do you mean in combination with deleting all of the existing data? If so,
then yes, you can truncate the table (which will also reseed the identity
back to 0) or you can delete manually (which you will need to do, and in a
certain order, if other tables reference this identity value through an FK
relationship) and then use DBCC CHECKIDENT with RESEED and/or drop the table
and re-create it.
If you need to keep the existing data, please explain how anyone can
distinguish between the first row with a value of 0 and a new row when you
start over.
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006