DISTINCT Requires ORDER BY
OK I am trying the following select statement but I am getting a 'DISTINCT requires ORDER BY to be used' error. I have an ORDER BY in it so I am not sure what I have missed?
SELECT DISTINCT tbl_final_CP.ExtEnum + tbl_final_CP.ExtEnum AS [Full Cost]
FROM tbl_final_CP INNER JOIN
ContractorAreaRelationship ON tbl_final_CP.Area = ContractorAreaRelationship.AreaNo INNER JOIN
tbl_CPCost ON tbl_final_CP.CP = tbl_CPCost.CP
WHERE (DATEPART(yyyy, tbl_final_CP.dCount) = DATEPART(yyyy, GETDATE())) AND (ContractorAreaRelationship.ContractorNumber = 6112) AND
(DATENAME(mm, tbl_final_CP.dCount) = 'Conwy') AND (ContractorAreaRelationship.AreaName = 'Conwy') AND (tbl_final_CP.Video > 0) OR
(DATEPART(yyyy, tbl_final_CP.dCount) = DATEPART(yyyy, GETDATE())) AND (ContractorAreaRelationship.ContractorNumber = 6112) AND
(DATENAME(mm, tbl_final_CP.dCount) = 'March') AND (ContractorAreaRelationship.AreaName = 'Conwy') AND (tbl_final_CP.ExtEnum > 0) OR
(DATEPART(yyyy, tbl_final_CP.dCount) = DATEPART(yyyy, GETDATE())) AND (DATENAME(mm, tbl_final_CP.dCount) = 'March') AND
(ContractorAreaRelationship.AreaName = 'Conwy') AND (tbl_final_CP.Video > 0) AND (ContractorAreaRelationship.AdminID = 6112) OR
(DATEPART(yyyy, tbl_final_CP.dCount) = DATEPART(yyyy, GETDATE())) AND (DATENAME(mm, tbl_final_CP.dCount) = 'March') AND
(ContractorAreaRelationship.AreaName = 'Conwy') AND (tbl_final_CP.ExtEnum > 0) AND (ContractorAreaRelationship.AdminID = 6112)
ORDER BY tbl_final_CP.CP, tbl_final_CP.ExtEnum + tbl_final_CP.ExtEnum
View Complete Forum Thread with Replies
Related Forum Messages:
Order By Because Of Distinct
I have a strange situation (I think). Within a view (which explains why I use the top 100% --> to use an order by) I have this query: select TOP 100 PERCENT * from tbOfferDetails where ofd_id = ofd_parent and ofd_fk_off_id = 100 This gives me the following results: ofd_fk_off_id off_fk_class_id 100 2753 100 2753 100 2071 100 2753 Now I change the query to: select distinct ofd_fk_off_id, ofd_fk_class_id from (select TOP 100 PERCENT * from tbOfferDetails where ofd_id = ofd_parent and ofd_fk_off_id = 100 order by ofd_sequence ASC ) as tbOffers This gives me the following results: ofd_fk_off_id off_fk_class_id 100 2071 100 2753 In the execution plan, it says that a distinct order by is used on off_fk_class_id. My question is: why is this done? I want only a distinct and not an order by. So is there a way to change this (default?) behaviour.
View Replies !
Distinct With Order By
It gives me this error: ORDER BY clause (TimeStamp) conflicts with Distinct The sql statement is: sql Code: Original - sql Code SELECT DISTINCT division from table order by Stamp DESC SELECT DISTINCT division FROM TABLE ORDER BY Stamp DESC I've tried: sql Code: Original - sql Code SELECT DISTINCT division, Stamp FROM table ORDER BY Stamp DESC SELECT DISTINCT division, Stamp FROM TABLE ORDER BY Stamp DESC But this produces duplicate rows, which in this specific case is unacceptable. Is there any way I can acheive what I want? Stamp is a TimeStamp if you couldn't figure it out. I just want the last one entered, but all the last ones entered per division. . .
View Replies !
How Do I Use Order By When I Use Select Distinct.
Hi I have a query which returns some rows.. what happens if i use a select distinct instead of a select.. this is my sproc DECLARE @Counter TABLE( PlanId int, FundId int, ClientFundName varchar(110), DisplayOrder int IDENTITY(1,1), IsDefault bit, IsPortfolioFundOnly bit ) INSERT INTO @Counter ( PlanId, FundId, ClientFundName, IsDefault, IsPortfolioFundOnly ) SELECT 5923, f.FundId, d.FundName, CASE WHEN d.FundDefault IS NULL THEN 0 ELSE 1 END, CASE WHEN Lower(p.FundType) = 'modfundonly' THEN 1 ELSE 0 END FROM PlanDetail d INNER JOIN Statements..Fund f ON d.CUSIP = f.CUSIP OR d.Ticker = f.Ticker OR d.Ticker = f.ClientFundId OR d.CUSIP = f.ClientFundId -- Do an internal join on the PlanDetail table to get the value of the FundType to derive whether --fund can only be chosen as part of a portfolio. LEFT JOIN PlanDetail p ON d.FundName = p.FundName AND d.PortfolioName = p.PortfolioName WHERE d.PlanNumber IS NOT NULL AND p.PortFundPercent IS NULL GROUP BY f.FundId, d.FundName, d.FundDefault, --d.PlanNumber, --d.Cusip, -- d.Ticker, --d.RowNumber, p.FundType ORDER BY Min(d.PlanNumber), Min(d.RowNumber) any help will be appreciated. Thanks Karen
View Replies !
SQL Distinct Value And Order By Some Field......
Dear all,In SQL Server 2000 , how to get distinct records sort by onefield .ExampleSELECT DISTINCT A FROM tblTEST ORBER BY BHere, In TableField 'A' contain more than one same data...Field 'B' contain all are different Data......I want distince in Field 'A' and order by Field 'B'..... how to getit.........regardskrishnan
View Replies !
SELECT DISTINCT W/ORDER BY
I get the "ORDER BY items must appear in the select list if SELECT DISTINCT is specified. SELECT DISTINCT pdm.Account, pdm.Customer FROM dbo.Demands pdm LEFT OUTER JOIN dbo.Tickets rct ON pdm.Account = rct.Account WHERE pdm.Code IN (66, 51) ORDER BY pdm.TransactionDate DESC Is there any way to make the ORDER BY work in this case?
View Replies !
Distinct & Dynamic ORDER BY
Hello, I have a stored procedure with dynamic ORDER BY. I would like to use the DISTINCT too. Is it somehow possible? Thank you Here is the stored procedure: SELECT identifier_company + cast(identifier_number as nvarchar(3)) as identifier, CASE WHEN canceled = 'True' THEN 'canceledPO' ELSE '' END AS style, staff.staff_name, purchase.purchase_id, purchase.traveller_name, nominal_department.department_name, purchase.canceled, purchase.travel_date, convert(nvarchar(20), purchase.date_raised, 103) as dated, supplier FROM purchase INNER JOIN purchase_project ON purchase.purchase_id = purchase_project.purchase_id INNER JOIN staff ON purchase.raised = staff.staff_id INNER JOIN nominal_department ON purchase.department = nominal_department.nominal_dep_id WHERE (raised in (SELECT staff_id FROM staff WHERE department like @FromDepartment) or purchase.raised = @raisedBy) and purchase_project.project_number like '%' + @Query + '%' ORDER BY CASE @SortDir WHEN 'ASC' THEN CASE @OrderBy WHEN 'staff_name' THEN cast(staff_name as nvarchar(100)) WHEN 'traveller_name' THEN cast(traveller_name as nvarchar(100)) WHEN 'department_name' THEN cast(department_name as nvarchar(100)) WHEN 'supplier' THEN cast(supplier as nvarchar(100)) WHEN 'canceled' THEN cast(canceled as nvarchar(10)) END END ASC, CASE @SortDir WHEN 'DESC' THEN CASE @OrderBy WHEN 'staff_name' THEN cast(staff_name as nvarchar(100)) WHEN 'traveller_name' THEN cast(traveller_name as nvarchar(100)) WHEN 'department_name' THEN cast(department_name as nvarchar(100)) WHEN 'supplier' THEN cast(supplier as nvarchar(100)) WHEN 'canceled' THEN cast(canceled as nvarchar(10)) END END DESC
View Replies !
SELECT DISTINCT Type ORDER BY
I am trying to display items from a table that have a type. For each condition there are between 7 and 10 types. I am looping through each type and displaying all items in that type. I am using DISTINCT to pull the types and count them, so I know how many there are and how times to loop. My problem is that DISTINCT is ordering the types alphabetically! I want them in the same order they went into the table. I tried adding ORDER BY primaryID, but got an error that said I also had to select primaryID as well as type, so now I am selecting every item that fits the condition and not just the DISTINCT types! Is there any way to make it order by column_position? I am using SQL 2K.
View Replies !
How Can I Use SELECT DISTINCT And Maintain The Original Order
Say I have a result set with two fields numbers and letters. 1 A3 A1 B2 B The result set is ordered by the letters column. How can I select the distinct numbers from the result set but maintain the current order? When I tryselect distinct Number from MyResultSet it will reorder the new result set by the Number field and return 123 However, I'd like maintain the Letter order and return 132
View Replies !
SELECT DISTINCT MyId Order By MyDate
I have the following records, MyDate MyId 2003/10/25 2 2003/10/26 3 2003/10/26 1 2003/10/27 3 2003/10/28 2 2003/10/29 4 I want to get the most earlier date distinct records. I try to use "SELECT DISTINCT MyID from Table;" I expect to get Myid: 2,3,1,4 But the computer returns Myid:1,2,3,4 Is there a way to get the records using "SELECT DISTINCT MyID from Table ORDER BY MyDate;" Appreciate help......
View Replies !
SELECT DISTINCT And ORDER BY With Aliased Column
This query demonstrates a problem I have run across: USE AdventureWorks GO -- This query works fine. SELECT DISTINCT FirstName AS Name1 FROM Person.Contact ORDER BY FirstName GO -- This query also works fine. SELECT ISNULL(FirstName, '') AS Name1 FROM Person.Contact ORDER BY FirstName GO -- This query returns error 145 SELECT DISTINCT ISNULL(FirstName, '') AS Name1 FROM Person.Contact ORDER BY FirstName GO The last query returns the error "ORDER BY items must appear in the select list if SELECT DISTINCT is specified". It will work if I change ORDER BY to use "Name1" instead of "FirstName", but in the situation I have at hand, the query is generated by third-party software and I don't have the ability to change it. Can anyone explain why what's going on here? Oddly, this same query will work if I run it against SQL Server 2000.
View Replies !
Extract Distinct Information And Order The Results
Hi, MSSQL 2000 T-SQL I have a problem in extracting information pertaing to a key value and matching that key value to another transaction but the order is based on another value in the same row. I've attached a sample of DB data below. tran_nr ret_ref_no msg_type description 5111 12345 420 reversal 5112 12345 200 auths 5113 15236 200 auths 5114 46587 200 auths 5115 46587 420 reversal Requirement using the above data is to extract data where the ret_ref_no is the same for more than one row but also check that the msg_type 420 happens before the 200. Is there a way of retrieving the information in this way using the tran_nr coloumn values? The tran_nr values is basically the serial number when the transaction is wrriten away to the DB. I've managed only to retrive the 1st half of my query whereby the same ret_ref_nr is being used by more then one transaction. Still need to figure out the 2nd part where the msg_type of 420 happens before the 200. SELECT * FROM SAMPLE WHERE ret_ref_no in ( SELECT ret_ref_no FROM SAMPLE GROUP BY ret_ref_no HAVING COUNT(*) > 1 ) Results of query 5111 12345 420 reversal 5112 12345 200 auths 5114 46587 200 auths 5115 46587 420 reversal If someone could assist with only retreiving the above results in bold to the query analyser i will really appreciate it. Regards Deceptive
View Replies !
How To Use ORDER BY Clause In An SELECT DISTINCT Sql Query When AS SINGLECOLUMN Is Defined?
Hi, I wonder if its possible to perform a ORDER BY clause in an SELECT DISTINCT sql query whereby the AS SINGLECOLUMN is used. At present I am recieving error: ORDER BY items must appear in the select list if SELECT DISTINCT is specified. My guess is that I cant perform the Order By clauses because it cant find the columns individually. It is essentail I get this to work somehow... Can anyone help? Thanks in advance Gemma
View Replies !
Select DISTINCT On Multiple Columns Is Not Returning Distinct Rows?
Hi, I have the following script segment which is failing: CREATE TABLE #LatLong (Latitude DECIMAL, Longitude DECIMAL, PRIMARY KEY (Latitude, Longitude)) INSERT INTO #LatLong SELECT DISTINCT Latitude, Longitude FROM RGCcache When I run it I get the following error: "Violation of PRIMARY KEY constraint 'PK__#LatLong__________7CE3D9D4'. Cannot insert duplicate key in object 'dbo.#LatLong'." Im not sure how this is failing as when I try creating another table with 2 decimal columns and repeated values, select distinct only returns distinct pairs of values. The failure may be related to the fact that RGCcache has about 10 million rows, but I can't see why. Any ideas?
View Replies !
Trying To Add A NON-DISTINCT Field To A DISTINCT Record Set In A Query.
I need to run a SELECT DISTINCT query acrossmultiple fields, but I need to add another field that is NON-DISTINCTto my record set.Here is my query:SELECT DISTINCT lastname, firstname, middleinitial, address1,address2, city, state, zip, age, genderFROM gpresultsWHERE age>='18' and serviceline not in ('4TH','4E','4W')and financialclass not in ('Z','X') and age not in('1','2','3','4','5','6','7','8','9','0')and (CAST (ADMITDATE AS DATETIME) >= DATEDIFF(day, 60, GETDATE()))ORDER BY zipThis query runs perfect. No problems whatsoever. However, I need toalso include another field called "admitdate" that should be treatedas NON-DISTINCT. How do I add this in to the query?I've tried this but doesn't work:SELECT admitdateFROM (SELECT DISTINCT lastname, firstname, middleinitial, address1,address2, city, state, zip, age, gender from gpresults)WHERE age>='18' and serviceline not in ('4TH','4E','4W')and financialclass not in ('Z','X') and age not in('1','2','3','4','5','6','7','8','9','0')and (CAST (ADMITDATE AS DATETIME) >= DATEDIFF(day, 60, GETDATE()))ORDER BY zipThis has to be simple but I do not know the syntax to accomplishthis.Thanks
View Replies !
DISTINCT To ShortDateString, Not DISTINCT To The DateTime; How?
Hello, I have written a small asp.net application, which keeps record of the proposals coming from the branch offices of a bank in a tableCREATEd as a TABLE Proposals ( ID smallint identity(7,1), BranchID char(5), Proposal_Date datetime ) This app also calculates the total number of proposals coming from a specific branch in a given date bySELECTing COUNT(BranchID) FROM Proposals WHERE BranchID=@prmBranchID AND Proposal_Date=@prmDateand prints them in a table (my target table). This target table has as many rows as the result of the "SELECT COUNT( DISTINCT Proposal_Date ) FROM Proposals"and excluding the first column which displays those DISTINCT Proposal_Dates, it also has as many columns as the result of the"SELECT DISTINCT BranchID FROM Proposals". This target table converts the DateTime values ToShortDateString so that we are able to see comfortably which branch office has sent how many proposals in a given day. So far so good, and everything works fine except one thing: Certain DateTime values in the Proposals table which are of the same day but of different hours (for ex: 11.11.2005 08:30:45 and11.11.2005 10:45:30) cause some trouble in the target table, where "SELECT COUNT( DISTINCT Proposal_Date ) FROM Proposals" is executed, because (as you might already guess) it displays two identical dates in ShortDateString form, and this doesn't make much sense (i.e. it causes redundant rows) What I need to do is to get a result like (in a neat fashion :) "SELECT COUNT( DISTINCT Proposal_Date ) <<DISTINCT ONLY IN THE DAYS AND NOT IN HOURS OR MINUTES OR SECONDS>> FROM Proposals" So, how to do it in a suitable way? Thanks in advance.
View Replies !
Begineer Requires Help!
I develop basic websites. I have been contracted by a music company to develop a site using a database to do the following: Search for music by genre/keyword -> display the results in the following format: Song Name | Artist Name | Keywords | Description | (MP3 icon linked to download) | (WMA icon linked to download) The site will have an additional database of users who must login before they can reach the above page, also with the facility to track what each person downloads/searches etc. Any assistance on where I should start, what scripts to use etc. would be much appreciated. Cheers -andrew
View Replies !
My Application 'requires' SQL
Hello, I tried to run my application on another computer but then I got this error: 'An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.' ( well this is only the first line ) When I tried to do something with the database inside my application. So I installed SQL (and I had to install .net framework 2.0 also). And then my applicaton worked. But now my question: Is it possible to run my application, and use the database, without having to install all those things first, when I want to use it on other computers? Thanks in advance, Ruben Pieters
View Replies !
Why It Requires Userid And Password.
When I tried to browse the reportserver url. The IE 7.0 asks me for Username and password. I feel, its some settings related to security. But other sites created are working fine. The virtual directories created using Repoting services configuration manager only ask me username and password. Any suggestions. Murali.
View Replies !
SQL Problem (The MAX Function Requires 1 Argument(s).)
Hey Guys, I'm having problems with my SQL statement and Im wondering if anyone could help? My code is below. The Label6 is filled up using a previous SQL Statement, and when Ive had a fiddle around it is using the KnowledgeID It works in reading in the date, it just doesnt appear to want to work for the second statement as I am getting the error shown in the subject. Thanks in advance =) C# Codeprotected void Button2_Click(object sender, EventArgs e) {KnowledgeID = Convert.ToInt32(Label5.Text); string path = Server.MapPath(" ") + "\X_Drive\";FileLocation = path + Convert.ToString(FileUpload1.FileName);SqlConnection myConnection = new SqlConnection(myConnectionString); SqlCommand myCommand2 = new SqlCommand("select * from Knowledge WHERE KnowledgeID = '" + KnowledgeID + "'", myConnection); myConnection.Open(); SqlDataReader myReader = myCommand2.ExecuteReader();if (myReader.HasRows) {while (myReader.Read()) {Add = myReader["DateAdded"].ToString(); } myReader.Close(); } else { myConnection.Close(); } SqlTransaction trans = myConnection.BeginTransaction(); { try { SqlCommand myCommand3 = new SqlCommand("Select ISNULL(MAX(Version,0)+1 FROM Archive WHERE KnowledgeID = "+KnowledgeID+"",myConnection); myCommand3.Transaction=trans;int nextVersion =(int)myCommand3.ExecuteScalar();if (File != null) {myCommand3 = new SqlCommand("INSERT INTO Archive (FixName, Description, Location, DateAdded, DateArchived, Version, KnowledgeID) SET (@FixName,@Description,@File,@Add,@AddDate,@SAPPS,@Version,'" + KnowledgeID + "')", myConnection); } else {myCommand3 = new SqlCommand("INSERT INTO Archive (FixName, Description, DateAdded, DateArchived, Version, KnowledgeID) SET (@FixName,@Description,@Add,@AddDate,@SAPPS,@Version,'" + KnowledgeID + "')", myConnection); }myCommand3.Parameters.AddWithValue("@FixName", TextBox1.Text); myCommand3.Parameters.AddWithValue("@Description",TextBox2.Text);myCommand3.Parameters.AddWithValue("@File",FileLocation); myCommand3.Parameters.AddWithValue("@Add",Add);myCommand3.Parameters.AddWithValue("@AddDate",AddDate);myCommand3.Parameters.AddWithValue("@Versions",nextVersion); myCommand3.ExecuteNonQuery(); trans.Commit(); }catch (Exception ex) { //TextBox2.Text = ex.Message; trans.Rollback(); myConnection.Close(); } //}
View Replies !
Not Being Able To Create A View That Requires A Loop
Hey i have a table A that contains 3 columns : id, entry ,sessionid i want to create a view on this table that will contain - for each sessionid s in A --> select top 5 rows having s as sessionid and ordered by id desc (s can have 1 or 2 or 5 or 300 entries i want to get only the latest 5 rows that correspond to this session) I tried many queries and different combinations i could find one yet to do the following. Can anyone help me plz? Can we have a loop in a view?is it possible?
View Replies !
Oracle Dba Requires Corresponding Sqlserver Commands
Hi I am an oracle dba now working with sqlserver. Could you jumpstart me with the sqlserver commands corresponding to the following 1. disable/enable all foreign keys on a table 2. apply fkeys to validate bcp-ed data (thanks to all who helped me with bcp) 3. apply table constraints on the bcp-ed data 4. huge log file - how can i reduce this 20Meg data file 600meg transaction file(sure it is containing bcp-ed transactions) 5. sytem tables that will give foreign key cols on a table and where it is coming from (or is a proc available??) As you can see, I am living on a 'need to know' basis thanks Liju
View Replies !
Error: SQL Server Requires Encryption On
Hello All, I have a commercial application built for Pocket PC's that connects to SQL Server 2005 via TCP/IP over wireless networks. In installations for our sales people we installed SQL 2005 Express on their notebooks for demonstrations. In one of these installs we are getting the following error message: "An error occurred - SQL Server requires Encryption On". We do not use encrypted connections and I have verified encryption is turned off in the Options tab in SQL 2005 login screens. Here is the connection string we use in the app.config file on the Pocket PC's: <add key="connStr" value="Data Source=192.168.0.19,1433;Initial Catalog=SQL0018;User ID = User01;Password=PW01"/> Other apps on the notebook are connecting to this same SQL Server without any issues. Thank you in advance for any help here, Jack
View Replies !
Installing ReportViewer.exe Requires IIS Restart?
On my production machine, my asp.net site containing a ReportViewer control gave the following error: Could not load file or assembly 'Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. So I installed ReportViewer.exe. However, I continue getting the error until I do an IIS restart. I couldn't find any documentation stating this was necessary and I'd prefer not to have to do this on a production machine. Any ideas of a workaround?
View Replies !
Error - SQL Server Requires Encryption On
Hello All, I have a commercial application built for Pocket PC's that connects to SQL Server 2005 via TCP/IP over wireless networks. In installations for our sales people we installed SQL 2005 Express on their notebooks for demonstrations. In one of these installs we are getting the following error message: "An error occurred - SQL Server requires Encryption On". We do not use encrypted connections and I have verified encryption is turned off in the Options tab in SQL 2005 login screens. Here is the connection string we use in the app.config file on the Pocket PC's: <add key="connStr" value="Data Source=192.168.0.19,1433;Initial Catalog=SQL0018;User ID = User01;Password=PW01"/> Other apps on the notebook are connecting to this same SQL Server without any issues. Thank you in advance for any help here, Jack
View Replies !
My Hosting Service Requires Csv Upload ONLY!!!!
Hello, Im a bit of a novice at this so please bare with me Does anyone know how to convert a .mdf to .csv as my hosting provider will only allow .csv importing to there SQL servers. Plus will my data base work in this .csv format. (comma separated value) Thanks in advance
View Replies !
Error: SQL Server Requires Encryption On
Hello All, I have a commercial application built for Pocket PC's that connects to SQL Server 2005 via TCP/IP over wireless networks. In installations for our sales people we installed SQL 2005 Express on their notebooks for demonstrations. In one of these installs we are getting the following error message: "An error occurred - SQL Server requires Encryption On". We do not use encrypted connections and I have verified encryption is turned off in the Options tab in SQL 2005 login screens. Here is the connection string we use in the app.config file on the Pocket PC's: <add key="connStr" value="Data Source=192.168.0.19,1433;Initial Catalog=SQL0018;User ID = User01;Password=PW01"/> Other apps on the notebook are connecting to this same SQL Server without any issues. Thank you in advance for any help here, Jack
View Replies !
Server "lock Up" That Requires A Reboot To Recover
I have a situation that I was wondering if anyone has ever ran into before. It has to do with one of my MS SQL servers. The hardware is a ALR/Gateway 9000R with 4 PP200's, 1 Gb RAM, and a RAID 5 with 72 Gb storage. The NIC card is an ATM 155 Mbit card connected directly to our fiber backbone. I have WinNT 4.0 Server Enterprise Edition loaded with SP4 and MS SQL Server 6.5 Enterprise Edition with SP5 installed. I have 7 seperate active databases on the server supporting 7 different applications. The server has been on-line for approximately 4 weeks and just recently (last Thursday) it has started to "lock up" every couple of days. By lockup I mean that it starts to reject all requests by all users. No one can connect to the server including myself. The MS SQL error log grows and grows until we reboot the server. The error logs are 100 Mb or larger in size due to rejection errors being repeated over and over again. There has been no change made to the server since initial installation. The error in the MS SQL error log that keeps on being repeated is... "Message 17308: Kernelerror - Lazywriter. Process (process ID number) generated access violation; SQL Server is terminating this process." We have an incident in with Microsoft but they are not responding fast enough. I was hoping that someone out there may have had this type of occurrance happen before. Any suggestions? Jim
View Replies !
The Data Pump Task Requires Transformations To Be Specified
Hi, I tried to shchedule a DTS for pulling data into a flat file in the network directory, I got the following error. 'The Data pump task requires Transformations to be specified.' Is there any way of writing procedures to do this job so that after scheduling the DTS any one can get know what the DTS is doing, My assumption of DTS is one can get to know what is doing. Any one please help. Thanks John Jayaseelan
View Replies !
Error:... It Requires A Higher Level Edition.
I've read some threads on this topic and all have been solved by installing the SSIS service. This would be fine except for the fact that I already have SSIS installed and working on the server the package is being called from. I have several scheduled packages that work without error and a few that fail, telling me "Error: ... it requires a higher level edition." Does SSIS need to be installed on the target server as well? Do I need to do a reinstall? Please advise. Thanks. -Matt
View Replies !
Update Requires Valid Insert Command
I have created a dataset in code with a select command being a stored procedure. I have used commandbuilder so as to create update, insert statements. The update of the dataset receives error "update requires valid insert command". From reading, it seems the problem is that the select statement is a stored procedure so data adapter cannot created the insert, update commands. Can I create an update and insert command using update and insert stored procedures and use those to update the dataset (with multiple records of course) or do I have to create my select command using a select statement rather than the stored procedure? Thanks for any help on this
View Replies !
MSDASQL Error Requires SQL Service Restart
I am having trouble with a linked server using MSDASQL. I'm connecting to a PostgreSQL database and pulling over data. This process has been working fine. In trying to pull data from a different client database (same schema), I received an error that the MSDASQL couldn't read the column names. The actual problem I want help on is that after this happens, I am no longer able to make valid connections to any of my Linked Servers using MSDASQL. The only way I can get my other linked servers to work again is to restart the SQL Service. Usually this is impossible for me to do because of the number of active users. Two questions: 1) Is there another way to restart a more targeted service or sub-set to reset MSDASQL connections, and clear out my problem? 2) Any idea why I'm getting this error connecting to PostgreSQL on a large dataset when it worked fine for a small dataset using the same linked server? "The provider reported an unexpected catastrophic failure." Any help is appreciated.
View Replies !
CE DB Requires SQL Express Install On Client Machines?
I'm working on a C# 2008 project, when i add a CE Database to it, then publish the app, the installer wants to download and install the entire SQL Server Express product on the client machines. My understanding is that I should be able to embed this database right into the app, but it defeats the purpose to have the installer download and install the entire express product (the actual project is 1 meg). Is this expected behavior? or am I doing something wrong?
View Replies !
Express Will Not Load. Insurmountable Difficulties With Order Of Uninstalls/order Of Installs/ Suggestions Plz
Finding the "pieces of information" I need to successfully install the SQL Server Express edition is so complex. Uninstalls do "not" really uninstall completely, leading to failure of SQL install. Can you suggest a thorough, one-stop site for directions for the order of app uninstalls and then the order for app installs for the following... SQL Server Express edition Visual Studios 2005 Jet 4.0 newest upgrade .Net Framework 2.0 (or should I use 3.0) VS2005 Security upgrade Anything else I need for just creating a database for my VS2005 Visual Basic project? I was trying to use MS Access as my backend db but would like to try SQL Express Thank you, Mark
View Replies !
Default Sort Order - Open Table - Select Without Order By
Hi! I recently run into a senario when a procedure quiered a table without a order by clause. Luckily it retrived data in the prefered order. The table returns the data in the same order in SQL Manager "Open Table" So I started to wonder what deterimins the sort order when there is no order by clause ? I researched this for a bit but found no straight answers. My table has no PK, but an identiy column. Peace. /P
View Replies !
How To Add Order Item Into A Purchase Order Using A Stored Procedure/Trigger?
Hey guys, i need to find out how can i add order items under a Purchase Order number. My table relationship is PurchaseOrder ->PurchaseOrderItem. below is a Stored Procedure that i have wrote in creating a PO: CREATE PROC spCreatePO (@SupplierID SmallInt, @date datetime, @POno SmallInt OUTPUT) AS BEGIN INSERT INTO PurchaseOrder (PurchaseOrderDate, SupplierID) VALUES(@date, @SupplierID) END SET @POno = @@IDENTITY RETURN However, how do i make it that it will automatically adds item under the POno being gernerated? can i use a trigger so that whenever a Insert for PO is success, it automaticallys proceed to adding the items into the table PurcahseOrderItem? CREATE TRIGGER trgInsertPOItem ON PurchaseOrderItem FOR INSERT AS BEGIN 'What do i entered???' END RETURN help is needed asap! thanks!
View Replies !
Verifying MergeSynchronizationAgent No Longer Requires STA Threading Model
I've seen a few posts in the MSDN documentation (see links below) stating that the MergeSynchronizationAgent no longer requires the STA threading model in SQL Server 2005 SP1. However, I'm still receiving the following exception message in my synchronization code (where it attempts to access the SynchronizationAgent property): The MergeSynchronizationAgent class must be instantiated on a Single-Threaded Apartment (STA) thread. I have Service Pack 1 for SQL Server 2005 installed on both my server as well as my local client (the client is running SQL Server 2005 Express). How can I verify the correct files are there (e.g. are the some specific date/time values for the RMO/COM objects? Here's the list of MSDN links mentioned above: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=326837&SiteID=1 http://msdn2.microsoft.com/en-us/library/ms146869.aspx http://msdn2.microsoft.com/en-us/library/microsoft.sqlserver.replication.mergesynchronizationagent.aspx http://msdn2.microsoft.com/en-us/library/microsoft.sqlserver.replication.mergepullsubscription.synchronizationagent.aspx
View Replies !
Snapshot Folder Is On Network Drive, Which Requires User And Pwd Login
hi all when my snapshot folder is on a network drive, on which "simple filesharing" is enabled, i can access that folder without typing a user and password and configuring login security settings. but in fact the network drive on which the snapshot folder will be located will do have a login and password. (when i go to it with windows explorer, i have to enter my login and password). won't this cause problems for the replication? as i don't see where to enter net network login when i configure the replication via the wizard. Thanks for help
View Replies !
Installing SQL Server Native Client Requires Administrator Rights
Hi All, We're deploying an app. using a MSSQL Server 2005 (Std. Ed.). In order to install an ODBC driver for the DB, we've made the installation of Sqlncli.msi part of the package. It will not run - unless user has Admin priv.s on the klient PC targeted. Does any one have any experience w. other ways of installing the sql native client (like MDAC) - og just an idea about circumventing the Admin rights problem? Regards
View Replies !
Find Order By Date Range Or Order Id
hi basically what i have is 3 text boxes. one for start date, one for end date and one for order id, i also have this bit of SQL SelectCommand="SELECT [Order_ID], [Customer_Id], [Date_ordered], [status] FROM [tbl_order]WHERE (([Date_ordered] >= @Date_ordered OR @Date_ordered IS NULL) AND ([Date_ordered] <= @Date_ordered2 OR @Date_ordered2 IS NULL OR (Order_ID=ISNULL(@OrderID_ID,Order_ID) OR @Order_ID IS NULL))"> but the problem is it does not seem to work! i am not an SQL guru but i cant figure it out, someone help me please! Thanks Jez
View Replies !
|