You can't define a primary key on a nullable column, so first you will need to ensure there are no null values in the Categories column and in the Sequence column. Then you can alter the table so these columns are not null:
I'm developing a c# application to handle communication between two systems each one is interacting with the sql server database , the first one is a scada system used for supervision equipment (alerton envision for bactalk 3.0) and the second system is a coswin 8i which is a software package for a cmms system , thanks in advance . I add that I intend to work with windows services with a timer to ensure the recuperation of the lines that are added every 2 min to the table "Alarm" of the scada system and add them into the table "Intervenant" of the cmms system in order to get these informations as a service request interface at Coswin. I looked for the first time the server of the scada system and it wasn't something that gives hope for me especially since I could not find the interface of a dbms sql server , I found it integrated in the structure of the scada system also I don't find any sql server services in the Computer Management window on the computer server. If you can come to my assistance especially as it's a job I need to do for my final project studies , thank you very much .
I'm developing a c# application to pull out data from the Alerton Envision Bactalk system, but there is no much information how to establish a connection between my interface and Alerton database, any help will be very appreciate.
I was asked a question the other day which was, does using SQL Server Replication improve query response time. I answered no, because I couldn't quite see how it would. I thought I'd better do a bit of research before giving a definitive answer though
The question is not a valid question, it is not possible to answer, 'question does not compute'... - it is the equivalent of asking which is colder a banana or a strawberry.
In essence there is not enough information being provided within the question in order to answer it.
In the circumstances I would have asked for two examples database installations with details, one that is replicated and one that is not, I would then have more of an idea regarding which had an improved response time.
To give you some idea I use replication for a reporting server - I replicate the tables and stored procedures from the production server onto the replicated server so that when running reports the production server does not get a performance hit.
So in the setup I use replication does improve performance on the production server.
However in and of itself replication is nothing but a tool - used well it will help, used poorly it will hinder.
“That which can be asserted without evidence, can be dismissed without evidence.”
I agree with what the others have said - it is a tool, and may or may not help.
In a past position, we used replication and the answer would be - it all depends on where you are and what you're querying.
We had replication from the computer room to two 'remote' sites - one about 1/4 mile away, the other about 30 miles away.
So, if I queried both the computer room database and the local database while at a 'remote' site on comparable database server hardware, I would expect the local response would be appreciably better.
If both systems were local, as suggested with a prodution and reporting server, then it may depend on the system load. For us, data input was a relatively level process, but between 7:00 and 8:30 in the morning, the reporting process hammered the systems.
You need to define what counts as a fail, a pass, and a distinction.
You also need to specify which DBMS you're using.
Assuming a recent version of Microsoft SQL Server, something like this should work:
-- TODO: Change these as required:DECLARE@DistinctionThresholdint = 90;
DECLARE@PassThresholdint = 70;
WITH cteCounts As
SUM(CASEWHEN Marks < @PassThresholdTHEN1ELSE0END) As Failed,
SUM(CASEWHEN Marks >= @PassThresholdAnd Marks < @DistinctionThresholdTHEN1ELSE0END) As Passed,
SUM(CASEWHEN Marks >= @DistinctionThresholdTHEN1ELSE0END) As Distinction
dbo.Class As C
INNERJOIN cteCounts As M
ON M.ClassId = C.ClassId
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Presuming you are using SQL Server (you do not tell us what database) you need to compare the schemas of the 2 databases by looping through the various sysobject and views. There are also a number of tools that will do the job for you, some of them free!
Never underestimate the power of human stupidity
I am having the value in column 1 - 12 digits saved as per the selected month, While fetching the data I need to show the month name in select statement.. Please help ASAP Need DB2 Query
SELECT (SELECT MAX(BAUKID) FROM CRPDTA.F58SM039 ) AS RMAX
,BAUKID AS ID
,BADO AS DOCODE
,BAAA AS AMOUNT
,BAOBSZ AS NOOFJOBCODE
,BAS1FU AS EMPPOSNAME
,BAFB03 AS EMPCATEGORY
,BAMNTH AS MONTH ---(Here I need month name ,BAMNTH this contain any number in 1 to 12 )
But I made a huge mistake in a table design for Billing and Shipping addresses in relation to card processing.
I made a single column called attention for the name. But card processors want a first and last name for Billing and Shipping, and a single column for card name.
So now I have all these names in a single column.
Thomas Friedman Sr.
Loopy Jose De SannaAna
Kenneth G. Tompson Jr.
So I can do a split in vb.net, and split them up, but I'm not sure how to place them.
Just looking for ideas before I write any code to do the job.
Perhaps just take the first set of chars, and that's the first name, and then the rest is the last name?
IMHO it is a issue you can not resolve with code...
Human names - and the way they are written down - are reflecting the human brain - lack of any order...
As long as you have only one whitespace in the name you can simply split it, but what should you do with those with more than two parts in it?
There is no existing algorithm to take them apart...(And if you add international customers, you are in deep...)
What I would advise is:
1. Change the design of the tables, when the existing name will go into new 'firstname' column for the beginning...
2. Create logical groups of the names and
2.a. Split the simples
2.b. Check for those with Mr., Msr., Jr. and so in it and split them
2.c. Scan remained names for groups and handle them individually
2.d. Handle manually the rest (hopefully not much)
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
It's good to get a 2nd opinion on that, and you confirmed it.
I did change the design to let the customer choose what is the first and last name, sounds dumb but practical.
So I did a split and select or switch case 2, 3 and 4 - first last, first (1) last, first (1+) (1+), first (1) last (SR-JR)
So out of 5000, I only had 30 Mexican names, that i did by hand.