I have a sql table with following schema. DateStamp BatchID MixName MixComment BatchDestination BatchComment MixNo MixRev Ing1Name Ing1Size Ing1PRM Ing1AcceptedUnderTol Ing1SPCSample Ing1TargetWgt Ing1ActualWgt Ing1PartialActualWgt Ing1PreactWgt Ing1SlowFeedTime Ing1FastFeedTime Ing2Name Ing2Size Ing2PRM Ing2AcceptedUnderTol Ing2SPCSample Ing2TargetWgt Ing2ActualWgt Ing2PartialActualWgt Ing2PreactWgt Ing2SlowFeedTime Ing2FastFeedTime Ing3Name Ing3Size Ing3PRM Ing3AcceptedUnderTol Ing3SPCSample Ing3TargetWgt Ing3ActualWgt Ing3PartialActualWgt Ing3PreactWgt Ing3SlowFeedTime Ing3FastFeedTime Ing4Name Ing4Size Ing4PRM Ing4AcceptedUnderTol Ing4SPCSample Ing4TargetWgt Ing4ActualWgt Ing4PartialActualWgt Ing4PreactWgt Ing4SlowFeedTime Ing4FastFeedTime Ing5Name Ing5Size Ing5PRM Ing5AcceptedUnderTol Ing5SPCSample Ing5TargetWgt Ing5ActualWgt Ing5PartialActualWgt Ing5PreactWgt Ing5SlowFeedTime Ing5FastFeedTime Ing6Name Ing6Size Ing6PRM Ing6AcceptedUnderTol Ing6SPCSample Ing6TargetWgt Ing6ActualWgt Ing6PartialActualWgt Ing6PreactWgt Ing6SlowFeedTime Ing6FastFeedTime Ing7Name Ing7Size Ing7PRM Ing7AcceptedUnderTol Ing7SPCSample Ing7TargetWgt Ing7ActualWgt Ing7PartialActualWgt Ing7PreactWgt Ing7SlowFeedTime Ing7FastFeedTime Ing8Name Ing8Size Ing8PRM Ing8AcceptedUnderTol Ing8SPCSample Ing8TargetWgt Ing8ActualWgt Ing8PartialActualWgt Ing8PreactWgt Ing8SlowFeedTime Ing8FastFeedTime Ing9Name Ing9Size Ing9PRM Ing9AcceptedUnderTol Ing9SPCSample Ing9TargetWgt Ing9ActualWgt Ing9PartialActualWgt Ing9PreactWgt Ing9SlowFeedTime Ing9FastFeedTime Ing10Name Ing10Size Ing10PRM Ing10AcceptedUnderTol Ing10SPCSample Ing10TargetWgt Ing10ActualWgt Ing10PartialActualWgt Ing10PreactWgt Ing10SlowFeedTime Ing10FastFeedTime Ing11Name Ing11Size Ing11PRM Ing11AcceptedUnderTol Ing11SPCSample Ing11TargetWgt Ing11ActualWgt Ing11PartialActualWgt Ing11PreactWgt Ing11SlowFeedTime Ing11FastFeedTime Ing12Name Ing12Size Ing12PRM Ing12AcceptedUnderTol Ing12SPCSample Ing12TargetWgt Ing12ActualWgt Ing12PartialActualWgt Ing12PreactWgt Ing12SlowFeedTime Ing12FastFeedTime TimeStarted TimeComp ManIntervention HA_Ing1Name HA_Ing1Size HA_Ing1PRM HA_Ing1TargetWgt HA_Ing1ActualWgt HA_Ing2Name HA_Ing2Size HA_Ing2PRM HA_Ing2TargetWgt HA_Ing2ActualWgt HA_Ing3Name HA_Ing3Size HA_Ing3PRM HA_Ing3TargetWgt HA_Ing3ActualWgt HA_Ing4Name HA_Ing4Size HA_Ing4PRM HA_Ing4TargetWgt HA_Ing4ActualWgt HA_Ing5Name HA_Ing5Size HA_I
Frank Lepkowski
Posts
-
Transposing SQL Record -
Linked Server Query Returning No RecordsI have an x64 Server Running SQL Server 08 and within that server I am setting up a linked server to an XP box running SQL express 05. I am setting up the linked server with a server name of "ComputerName\SQLEXPRESS", using the Microsoft OLE DB Provider for SQL Server. It connects fine and passes a connection test, but when i write a simple select query to get all records from the linked server table it returns no records when there are multiple records in the table I have queried. Any one ever seen this before? It should be noted that when I try to add the linked server and keep the radio button selected for sql server it will not connect giving me an error message VIA Provider: The specified module could not be found. OLE DB provider: SQLNCLI10 for linked server returned message login timeout expired. OLE DB Provider for linked server returned message a network related or instance specific error has occured while establishing..... I am at a loss? :mad:
-
SQL Syntax IssueGuru's, I have the following SQL query and it gives me back some syntactical errors and I am not familiar enough with Sql Server to understand exactly what it is I am doing wrong. Thanks in advance for an information! ALTER TABLE BatchData DROP CONSTRAINT PK_BatchData ALTER COLUMN StartTime VARCHAR(50) NOT NULL ADD PRIMARY KEY (BatchID,StartTime) Gives error: Msg 156, Level 15, State 1, Line 3 Incorrect syntax near the keyword 'COLUMN'.
-
Select records from a single table that have common data in two columnsHow can I select records from a single sql table that have common data in two of their columns. Thanks, i.e. table customer {Name, Address, Phone Number) How can I select all records from customer where address and phone number are the same even though the records are unique?
-
How do I ...Using a DataColumn might be quicker since you are searching for a particular value for only one attribute of the table, not sure though.