Showing posts with label working. Show all posts
Showing posts with label working. Show all posts

Tuesday, March 27, 2012

Create a Testing Database out of existing DB

Hello All,

I was wondering if anybody can help me with the following question:

I'm working on the application where the Database, it's table (2) and several stored procedures are involved. The database is SQL Server 2000. It's also very old and involves a lot of operations, stored proc and so on. I just need to re-write a piece of the app which is using existing stored proc. Most of them are DELETE, INSERT and so on. I don't want to work with real stage DB and need to make a copy of the Database to my Dev box. So I tried:

* Right click, All Tasks, Export Data into the newly created database on my dev box.

That doesn't work, every time I try doing it, it fails somewhere in the middle of the process. I'm thinking it happens because of complexity of the database. I tried several options there already. Still nothing. I need the whole databse to be copied because I'm not sure which stored proc the app is using so I need them all, and tables too. Is there another way of doing this?

Thank you,

Tatyana

If you make a backup of the database (or detach it) you can restore it (or re-attach it) under a different name and therefore create multiple instances of it.

|||

Mark,

Thank you very much! Your suggestion worked!

Tatyana

sql

Thursday, March 22, 2012

Create a graghicapl calendar using VFP 9.0

I'm working on a project where a user wants to show there scheduled events on a calendar.

The way they want to show it is, displaying a bar across the days that the event takes place.

They want this on a web page and in Word. I'm using VFP 9.0 and I know it has web tools, but I've never used them. Could someone please point me in the right direction of how to do all of this?

Thank!

Hi Bob,

YOu would do better by posting this in one of the Web related forums.

Create a custom webpage to edit/update a table in a SQL database.

Hi everyone, this is is my first post, so please replyStick out tongue and help.

I'm working on a project right now that uses asp 2.0 and SQL server 2005 express edition. This is a general idea of the project. In our company some of us receive ECO notifications (engineering change orders) for our products and we need to implement these to the test scripts that are on the production floor. So the project is about entering the new ECO into a database which will send an automatic notification to our test team. When they receive the notification they will have to sign in to the website and introduce their login and password to sign off the ECO (Following some checkpoints already defined by me, for example, Area ready, Test script modification necessary, new firmware introduction, comments, etc...) but I also need to record WHO and WHEN sign that ECO. We have 3 different test areas in our factory: Electrical, Functional and Systems, so all THREE areas must be signed off in order to the ECO go to a IMPLEMENTED state (at this point i need to send a new email saying that the eco has been implemented in all three areas).

So far I've completed the following things:

-users validation (logins, areas)

-New custom entry form for the ECOs and automatic email notification (part of what I did is described below).

Dim ECODataSourceAsNew SqlDataSource()ECODataSource.ConnectionString = ConfigurationManager.ConnectionStrings("ECO_ICSConnectionString1").ToString()

ECODataSource.InsertCommandType = SqlDataSourceCommandType.StoredProcedure

ECODataSource.InsertCommand ="EcoNew"

ECODataSource.InsertParameters.Add("EcoNumber", EcoNumberTextBox.Text)

ECODataSource.InsertParameters.Add("EcoDescription", EcoDescriptionTextBox.Text)

ECODataSource.InsertParameters.Add("EcoMandatory", EcoMandatoryDropDownList.Text)

-Depending on which test area is the the engineering from, I can filter the ECOs and just shows the ones that their test area is pending. (using GridView)

But I'm stuck right now when the engineers have to sign the ECO for their test areas. I was able to use the Gridview and DetailsView to EDIT most of the things that I need. But there are somethings that I don't like:

1. When using the EDIT option on Gridview or Detailsview, all fields can be edited including ECO number, description and mandatory, which I don't want them to change. If I set those columns to read only, when editing that row again. It gives me an error that says that the ECOnumber can't be NULL, but if I remove these 3 columns the Engineer will not know which ECO they have sign. They are only going to be able to see the EcoId, which doesn't say much.

2. Also I saw that I wasn't able to do is to enter the USER login and CURRENT system date and time automatically. I don't want them to manually enter the date and their login manually.

3. Finally, when the last area signs the ECO, I want to update that record and set a flag that tells me that the ECO has been completed.

So what I really want is to create some sort of form (textboxes, labels, checkboxes, etc.) that will UPDATE the selected ECO from the gridview for instance. So when I select the row from the GridView, It will show the data (Econumber, description and mandatory as READ ONLY) and use the rest of the things as INPUT for the engineer to complete. At the end an "update button" and when I click it, It will enter/update the data on that specific row, but including the time and user login as well.

Also to check if the other 2 areas have signed and if so, change the ECOReadiness flag to 1 and send the email.

Is there a code like the one I used above to do this ? Or if you think there a better way to do this, I'll be very glad to hear it.

I'm new using sql and asp, so If i'm asking some dumb questions please forgive me.Smile.

Here's my table definition for your reference:

EcoId - primary key.

EcoNumber

EcoDescription

EcoMandatory

EcoReadiness <- Flag for the entire ECO, when ALL 3 areas have signed, this will be 1.

ATE < - Flag for Electrical area.

ATEscripts < - Just a Yes/no input.

ATEengineer <- user login

ATEdatetimestamp <- Date.Now()

FAT < - Flag for functional.

FATscripts

FATengineer

FATdatetimestamp

SYSTEMS < - Flag for systems.

SYSTEMSscripts

SYSTEMSengineer

SYSTEMSdatetimestamp

THANKS IN ADVANCE,

Regards,

Jesus

dearjaguerrero, ur query#01 have been confusing me.. if possible send ur page.aspx and page.aspx.cs(code file) file...

Query#2:

USER LOGIN

if r u using ASP.NET built-in authentication feature than

In the Page_Load event handler, add the following line of code:

string  UserIdValue ;
UserIdValue = Membership.GetUser().ProviderUserKey.ToString()


CURRENT system date and time

at database set ATEdatetimestamp 's default value - getdate()

Query#3:

//after updating each area signing - write these code :
string strSQL = "";
string strCon = ConfigurationManager.ConnectionStrings["ConnectionStringNAME"].ConnectionString; //"Data Source=.;Initial Catalog=NorthWind;User ID=sa";
SqlConnection con = new SqlConnection(strCon);
con.Open();
strSQL = "Select ATE, FAT, SYSTEMS From tableName Where EcoNumber = 'E001'"; //insert all selecting conditions
SqlDataAdapter sda = new SqlDataAdapter(strSQL, con);
DataTable dt = new DataTable();
sda.Fill(dt);
//i guess ur ATE, FAT, SYSTEMS and EcoReadiness - fields are bit field
if (dt.Rows[0]["ATE"].ToString() == "True" && dt.Rows[0]["FAT"].ToString() == "True" && dt.Rows[0]["SYSTEMS"].ToString() == "True")
//if all three flags are true then final flag is set to true.. so EcoReadiness flag tells u that the ECO has been completed
{
strSQL = "Update tableName Set EcoReadiness = 1 Where EcoNumber = 'E001'"; //
SqlCommand cmdUpdate = new SqlCommand(strSQL, con);
cmdUpdate.ExecuteNonQuery();
cmdUpdate.Dispose();
}

con.Close();
con.Dispose();

|||

Hello Patuary! Thank you for your reply !...

I've checked your ideas.. but is your code c# ?.. because I've got a lot of errors.. I forgot to tell that I was using Visual Basic... I tried to change some of the parts but I keep getting errors when running the app... There are a couple of questions I have regarding your code...

For the user login.. I changed a little bit your code..

Sunday, March 11, 2012

CR10 & CR11 with lotus Notes R6

Hi all friends
does anyone know where i can download CR10 or CR11 even demo version?
does CR10 & CR11 working with lotus notes??Check out here
http://support.businessobjects.com/

CR Viewer Logon Failure

Hi Everbody,
I have developed a report in CR 9 and it is working perfectly well when run from CR. My problem is as follows:
I have developed a VB application containing a crystal report viewer. Here on click of a button I'm loading the CR by passing parameters to it.
But when I try to run the application its gives me an error as
Logon failed - Details:28000 [ODBC SQL Server Driver][SQL Server] Login failed for user "ab".
I have no code for database connection in VB, just the Openreport and viewReport commands.

Why am I getting such an error in VB when I 'm able to run the CR separately successfully with the same username/password?

Please help its really urgent.Do you have a DSN pointing to your database?|||Yes, I have a system DSN configured with SQL authentication to my required database server and I'm able to successfully connect to it.This DSN I'm using to create the crystal report.
Any reasons why I'm not able to run the VB application????|||How are you referencing your DSN in your code? Can you paste that function?

CR 8.5 to CR 10 in Visual C++

Hello,

I have an application in Visual C++ working with CR 8.5. To do it, I'm using crpe.h, cpre32m.lib,... but in CR10 these files don't exist.
In CR 10, the print engine is replaced by RDC.
My question is , can I use RDC without use managed code? All samples on Crystal work with managed code but I can't use in my application !!!!
How can I link my application to the new print engine?

Thanks a lot for your helpDid you ever find the answer to this question?? I have the same issue.|||See if you find solution here
http://support.businessobjects.com/|||how do i refresh crystal report data through codes|||CR.Refresh

where CR is the Crystal Reports component

Thursday, March 8, 2012

CPU usage 90%

hi
My site has become tremendous slow..cpu usage for normal transcationsalso showing 90%..day beefore it was working fine..
any hints wot can be the problems.Look at your indexes. As data gets added, and you do not have appropriate
indexes, the amount of data SQL has to scan through increases. This results
in high CPU usage.
Regards
--
--
Mike Epprecht, Microsoft SQL Server MVP
Epprecht Consulting (PTY) LTD
Johannesburg, South Africa
Mobile: +27-82-552-0268
IM: mike@.NOSPAMepprecht.net
Specialist SQL Server Solutions and Consulting
"sanjay" <anonymous@.discussions.microsoft.com> wrote in message
news:1582C1EB-6E00-4369-94D6-B047B067550F@.microsoft.com...
> hi
> My site has become tremendous slow..cpu usage for normal transcationsalso
showing 90%..day beefore it was working fine..
> any hints wot can be the problems.
>

Wednesday, March 7, 2012

CPU Time

I have a SQL server 2000 standard version installed on a window 2000 server.
It has been working well. Recently, SQL server process sqlservr.exe consume
50%-99% of the CPU time even I didn't issue any SQL server related
operation. There is not any backup or maintain job was set up in the server.
The memory usage doesn't change. I once waited for more than one hour to
complete the process, however it didn't.
Did anyone know what's happened? My computer become really slow and hardly
do anything.
Thanks
YingHi
Is SQL Server 2000 Service Pack 3 or 4 applied. If not, it sounds like the
Slammer Virus that came out 3 years ago.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Ying" <Ying@.discussions.microsoft.com> wrote in message
news:D712A471-053F-448E-A8CA-4A85CCB1EB1C@.microsoft.com...
>I have a SQL server 2000 standard version installed on a window 2000
>server.
> It has been working well. Recently, SQL server process sqlservr.exe
> consume
> 50%-99% of the CPU time even I didn't issue any SQL server related
> operation. There is not any backup or maintain job was set up in the
> server.
> The memory usage doesn't change. I once waited for more than one hour to
> complete the process, however it didn't.
> Did anyone know what's happened? My computer become really slow and hardly
> do anything.
> Thanks
> Ying

CPU Time

I have a SQL server 2000 standard version installed on a window 2000 server.
It has been working well. Recently, SQL server process sqlservr.exe consume
50%-99% of the CPU time even I didn't issue any SQL server related
operation. There is not any backup or maintain job was set up in the server.
The memory usage doesn't change. I once waited for more than one hour to
complete the process, however it didn't.
Did anyone know what's happened? My computer become really slow and hardly
do anything.
Thanks
Ying
Hi
Is SQL Server 2000 Service Pack 3 or 4 applied. If not, it sounds like the
Slammer Virus that came out 3 years ago.
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Ying" <Ying@.discussions.microsoft.com> wrote in message
news:D712A471-053F-448E-A8CA-4A85CCB1EB1C@.microsoft.com...
>I have a SQL server 2000 standard version installed on a window 2000
>server.
> It has been working well. Recently, SQL server process sqlservr.exe
> consume
> 50%-99% of the CPU time even I didn't issue any SQL server related
> operation. There is not any backup or maintain job was set up in the
> server.
> The memory usage doesn't change. I once waited for more than one hour to
> complete the process, however it didn't.
> Did anyone know what's happened? My computer become really slow and hardly
> do anything.
> Thanks
> Ying

CPU Time

I have a SQL server 2000 standard version installed on a window 2000 server.
It has been working well. Recently, SQL server process sqlservr.exe consume
50%-99% of the CPU time even I didn't issue any SQL server related
operation. There is not any backup or maintain job was set up in the server.
The memory usage doesn't change. I once waited for more than one hour to
complete the process, however it didn't.
Did anyone know what's happened? My computer become really slow and hardly
do anything.
Thanks
YingHi
Is SQL Server 2000 Service Pack 3 or 4 applied. If not, it sounds like the
Slammer Virus that came out 3 years ago.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Ying" <Ying@.discussions.microsoft.com> wrote in message
news:D712A471-053F-448E-A8CA-4A85CCB1EB1C@.microsoft.com...
>I have a SQL server 2000 standard version installed on a window 2000
>server.
> It has been working well. Recently, SQL server process sqlservr.exe
> consume
> 50%-99% of the CPU time even I didn't issue any SQL server related
> operation. There is not any backup or maintain job was set up in the
> server.
> The memory usage doesn't change. I once waited for more than one hour to
> complete the process, however it didn't.
> Did anyone know what's happened? My computer become really slow and hardly
> do anything.
> Thanks
> Ying

Sunday, February 19, 2012

country city area ..... help

hi all :

i am working in HR system , the user table is linked to the counter table and the city and the area tables . i want to fill this tables with all the country and cities and its area all over the world , i think that i could find such data on the internet , can any one help me how to find this tables and the data . beside the nationality table .... any help please

I am not sure you will get it on single location. May be wikipedia help you.. http://en.wikipedia.org/wiki/List_of_countries|||

And...

http://en.wikipedia.org/wiki/List_of_cities

Counting rows ?

Hi,
Using SQL Server 2000 on Windows 2000 Server, i'm working on a 2 milion rows
database, in one table. The data are document and the column of my table are
"authors", "organisation", "title","abstract" (these four ones are fulltext
indexed) and other column with references number.
A web application provide a fulltext search on these four column (author,
affiliation, title and abstract). It provide the result in two step :
- First one : give the number of result
- Second one : give a link to the documents extracted from the database
(Because if there is too much document, the user can change his query to
have less.)
So my problem is the first step is too long : 30 to 60 seconds. I use this
query :
Code:
select count(*) from import
where (CONTAINS ( Title,'"tube" AND "heat"')
OR CONTAINS ( Abstract,'"tube" AND "heat"'))
AND (CONTAINS ( Organisation,'"CIA" OR "FNSEA"'))
and cast(PY as integer)>=2004
and cast(PY as integer)<=2006Is there a better solution ?
Thanks,
Jean-Michel
There is no real way to optimize this search. You might get some improvement
by rearranging this clause
and cast(PY as integer)>=2004
and cast(PY as integer)<=2006
I am not sure what the data type for PY is, but the cast operation will be
expensive for you as you are doing it against each row returned from the
contains results sets.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Famille Careil" <careil04@.tele2.fr> wrote in message
news:Ob6X1A0aFHA.3280@.TK2MSFTNGP09.phx.gbl...
> Hi,
> Using SQL Server 2000 on Windows 2000 Server, i'm working on a 2 milion
rows
> database, in one table. The data are document and the column of my table
are
> "authors", "organisation", "title","abstract" (these four ones are
fulltext
> indexed) and other column with references number.
> A web application provide a fulltext search on these four column (author,
> affiliation, title and abstract). It provide the result in two step :
> - First one : give the number of result
> - Second one : give a link to the documents extracted from the database
> (Because if there is too much document, the user can change his query to
> have less.)
> So my problem is the first step is too long : 30 to 60 seconds. I use this
> query :
>
> Code:
> select count(*) from import
> where (CONTAINS ( Title,'"tube" AND "heat"')
> OR CONTAINS ( Abstract,'"tube" AND "heat"'))
> AND (CONTAINS ( Organisation,'"CIA" OR "FNSEA"'))
> and cast(PY as integer)>=2004
> and cast(PY as integer)<=2006Is there a better solution ?
>
> Thanks,
> Jean-Michel
>

Friday, February 17, 2012

Counting problem

Hi everyone,

another problem:

I'm trying to count the number of rows but it's not working. Here's my code:


SELECT 'TOTAL number of rows', count(*) --This counts 4! The total number of rows in [Activites]
FROM [Activities]
WHERE [Person ID] IN
(
SELECT DISTINCT [Person ID] --This brings back 2 rows (two specific people)
FROM [Activites]
)

As my comments say, I'm wanting to count the two rows but it's counting every row. Obviously I'm doing something wrong but I can't work it out.

Any help?
AndrewHi,

i hope the following query will solve your issue.

select count(*) from activities group by personid

Regards
Ravi|||It's actually doing exactly what you are asking it to do: count the total number of rows in activities where personid exists inthe activities table.

What you REALLY want it to do is to count the DISTINCT people in that table.

Try:

SELECT 'TOTAL number of rows', count(DISTINCT PersonID)
FROM [Activities]

The GROUP BY solution works great, too...|||Thanks heaps for the feedback!!

Cheers
Andrew

Tuesday, February 14, 2012

Counting Customer Transactions

I have a question I'm hoping someone will be able to help me with - I've been working on it for a while and can't seem to find an obvious solution.

Basically I have a fairly standard transaction fact table, and customers may have made multiple transactions over the selected range.

I need to know how many customers made 1 order, 2 orders, 3 orders, etc. As far as I can tell, I'm effectively doing a count of a count.

It seems to me to be a fairly straightforward request, however I can't work out a way to do it in Analysis Services. If someone can help me out or point me in the right direction I would be very grateful

Thanks,
Matt

is the selected range fixed? if yes, you could create a set for this purpose.

If not, which i believe is the case, you can rely on the tool you're using as interface to do the filtering for you...

if you're writing an mdx query, did you try doing it in the where condition ?

|||

Hi Christina

Thanks for your response. You're right, the range isn't fixed, although I guess it probably could be for most purposes. Could you please give me an example of how you would do this with a set? I haven't had to use them yet.

The frontend we are using is web-based Dundas Charts for OLAP, and there is no provision for writing mdx queries. Ideally it would appear in the interface as just another attribute in my Customer dimension. Any other thoughts?

Thanks again for your help,

Matt

|||

i don't know if this is a good solution:

since you mentioned that it would appear as another attribute, then maybe you should create a dimension with the customer and the values per range. but the ranges should be predefined. you would lose the flexibility

this dimension would be based on a view in the DW based on this fact table. it should contain the counts and have its structure as such:

customer CountRange1 CountRange2 CountRange3 CountRange4...etc..

where the ranges are not overlapping, however they are the most used ranges. better if you have only 1 range, because on dundas, u'll have to add all these fields to use them as filter

i will think of another alternative and let you know..

Count(IIF) not working

Hello, I have been fighting with getting the following statement to work
=Count(IIF( Fields!PDDAYS.Value>30,1,0))
I basically have returned all records to get a total count and need to weed
out those I want so I can divide the [totalofallrecords] by the
[totalofthose>30daysdue]
Any help would be appreciated.
SonjaI suppose you really want the Sum() aggregate, rather than Count(). Count
works the same way as it works in SQL - every value different than NULL will
be counted.
Try this (inside a data region - e.g. in a table header/footer etc.):
=Sum(IIF( Fields!PDDAYS.Value>30,1,0))
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"SLB" <SLB@.discussions.microsoft.com> wrote in message
news:1D0DCEDA-882C-41E5-9FB7-3308E91DF828@.microsoft.com...
> Hello, I have been fighting with getting the following statement to work
> =Count(IIF( Fields!PDDAYS.Value>30,1,0))
> I basically have returned all records to get a total count and need to
> weed
> out those I want so I can divide the [totalofallrecords] by the
> [totalofthose>30daysdue]
> Any help would be appreciated.
> Sonja|||Thanks so much, worked like a charm. Don't know what I was thinking.
"Robert Bruckner [MSFT]" wrote:
> I suppose you really want the Sum() aggregate, rather than Count(). Count
> works the same way as it works in SQL - every value different than NULL will
> be counted.
> Try this (inside a data region - e.g. in a table header/footer etc.):
> =Sum(IIF( Fields!PDDAYS.Value>30,1,0))
>
> -- Robert
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "SLB" <SLB@.discussions.microsoft.com> wrote in message
> news:1D0DCEDA-882C-41E5-9FB7-3308E91DF828@.microsoft.com...
> > Hello, I have been fighting with getting the following statement to work
> >
> > =Count(IIF( Fields!PDDAYS.Value>30,1,0))
> >
> > I basically have returned all records to get a total count and need to
> > weed
> > out those I want so I can divide the [totalofallrecords] by the
> > [totalofthose>30daysdue]
> >
> > Any help would be appreciated.
> > Sonja
>
>