I have two different SQL server installations (7 and 2000) that I have configured for using the SP_processmail procedure. Both servers can properly execute xp_startmail, xp_stopmail, xp_readmail, and xp_findnextmsg. HOWEVER, both have different problems with SP_processmail.
Using this command (and a host of many other variations):
sp_processmail @filetype = 'CSV', @separator = ',', @dbuse = 'ryantest', @set_user = 'guest'
SQL 7.0 says: Server: Msg 18007, Level 16, State 1, Line 0
Supplied datatype for @set_user is not allowed, expecting 'varchar'
I have tried every variation possible, including not specifying the yser which should result in it defaulting to the "guest" account. The message is always the same.
SQL 2000 says: Server: Msg 18025, Level 16, State 1, Line 0
xp_sendmail: failed with mail error 0x80004005
Queries processed: 0.
I have checked all my configurations and read every KB article - I can't find anything wrong.
Can someone PLEASE respond if you have any experience with SP_PROCESSMAIL on your servers.
The business rule is, the sales manager is commissioned on the avg. numberof appointments set up per salesrep per day during the month.I have 2 tables: The UserLog table records only 1 entry per day per user(salesrep). This will log how many salesreps worked a particular day. Thesecond table logs any appointments set up.UserLog: ID, UserName, EnteredTimeAppointment: ApptID, EnteredTime, ApptDateI figured that, for a given date ranged, I could1. sum the number of appointments2. sum the number of days worked2. sum the salesreps / number of days = avg number of salesreps per day3. number of appointments / avg number of salesreps per day = avg numberof appointments per sales repBut this logic is flawed. If I average out every day and then take anaverage of this daily average, I get a different result. Any ideas on howto best solve this problem?Thanks.
Hi -I hope some one can help me with this.I am using sql server 2000[Microsoft SQL Server 2000 - 8.00.818 (Intel X86) May 31 200316:08:15 Copyright (c) 1988-2003 Microsoft Corporation EnterpriseEdition on Windows NT 5.0 (Build 2195: Service Pack 4)]I have a stored procedure that is using cursors and a few joins, andwrites to a few tables. (I can post the code if that will help) Thestored procedure takes approximately 27 seconds to complete whenexecuted inside query analyser. However, if I run the stored proceduresource directly inside query analyser (like a long sql script), ittakes only 3 seconds!! These results are consistent and reproducible.I would think a stored procedure stores the plan, and I would expectbetter optimization. Why am I witnessing the opposite behaviour? Anyone has any experience?The server is manned by DBAs (I work at a large corporation), so Ibelieve it is well configured. We have noticed similar behaviour ondata restores on a different physical server.Thanks in advance,-praty77
I'm currently evaluating Visual Studio Team System using SQL Server 2005 (9.00.3042.00, SP2, Enterprise Evaluation Edition) and from time to time, I get this error:
Error: 18456, Severity: 14, State: 16.
If I try to connect to the database using SQL Server Management Studio, I get the error:
"A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP provider, error: 0 - An existing connection was forcibly closed by the remote host.) (Microsoft SQL Server, Error: 10054)".
If I restart the SQL Server services, everything works fine! This is driving me nuts!
Additional information: - The user accounts and security are OK - they have been double checked, and once the services are restarted everything works fine. - SQL Server is configured to accept remote connections - again, once the services are restarted eveything works fine. - I have disabled meanwhile the following protocols: VIA, Named Pipes, Shared Memory both at the Server and Client - and the problem still remains.
I use sp_processmail in sql 6.5 to process incoming email queries against my DB. When I try the exact same thing in SQL 7 I get the following error message:
Server: Msg 18007, Level 16, State 1, Line 0 Supplied datatype for @set_user is not allowed, expecting 'varchar'
I have tried the following with no success: sp_processmail @set_user='sa' sp_processmail @set_user="sa" sp_processmail @set_user=sa
I been all over this forum trying to find out how to get the aspnetdb.mdf running on my remote site and its driving me nuts. i been using VWD 2005 express Edition and SQL Express Error Server Error in '/' Application. An attempt to attach an auto-named database for file I:DataWebqsh.eumarker_93618920-db3b-4a04-a274-3fb613afc5dfwwwApp_Dataaspnetdb.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share. over the last week it has been a nightmare trying to get anything working on the site but i have got all the other databases working but i can get the aspnetdb.mdf working. i am very new to ASP.net so please use the he kiss method "Keep It Simple, Stupid!" as im a newbe to this and it will just go over my head. Thanks
Hi all, quick, hopefully simple question that has been driving me nuts for 3 days. Using Visual Studio 2005, doing a web app, connecting to an SQL server with already existing login names and passwords... I have a login name and password text box and a login button. Upon clicking, sqldatasource1 checks to see if the items in the text box match a login and password in the DB. If so, it sets Profile.login and Profile.password to the values in that text box so I can use it to key off the DB for application IDs associated with that login/pass later. It displays just the login name in a details view upon a match. If nothing is there that matches, it shows a hidden label saying "login failed". My problem is, that I really don't want the detailsview to display if there is a match. I want it to automatically go to page2.aspx...but I can't figure this out. Response.Redirect("page2.aspx"); doesn't work. It's like the check is happening before detailsview1 shows any data and therefore it doesn't load page2....and I can't figure out how to get it to check detailsview1 for data AFTER it has been displayed. I guess that I don't know how to get this thing to check if there is something in the detailsview, to go to page 2. It's just not working. Any help would be great! (BTW, not using the builtin login control because I can't figure out how to get that to connect to our sql database's login table.) Thanks all!
I'm struggling with the different methodologies for using DataSets in 2.0. I can knock this out in no time flat in 1.0, but am bogged down in 2.0. Can anyone guide me on the right track? My code is below. I'm forming a DataSet from a SQL Server Express database from the user's choice from a drop down. My connection string "ASOCTCOConnectionString" is declared in my web.config and used successfully throughout in the WYSIWYG configurations of my databound controls. But I want to control this in code. This si getting frustrating and right now I'm longing for the clean simplicity I had with Web Matrix :( In any case, any suggestions? It crashes with this error when opening the connection with MyConn.Open(). I just want to be able to configure a DataSet and apply it to my controls and results. <code> Dim connectionString As String = System.Configuration.ConfigurationManager.AppSettings("ASOCTCOConnectionString") Dim MyConn As System.Data.IDbConnection = New System.Data.SqlClient.SqlConnection(connectionString) Dim MyQuery, SearchString As String
Dim myAdapter As New System.Data.SqlClient.SqlDataAdapter Dim myDataSet As New System.Data.DataSet Dim mySelectCommand As New System.Data.SqlClient.SqlCommand mySelectCommand.CommandText = "SELECT * from Device_Type where Category LIKE " & DDLDevType.SelectedItem.Text mySelectCommand.Connection = MyConn MyConn.Open() Grid1.DataSource = myDataSet Grid1.Databind() MyConn.Close() </code>
Has anyone else noticed that if you create a non-existing file as an attachment using xp_sendmail in SQL Server 2000, it does not create a copy of that file on the Hard Drive, nor does it format the attached file sensibly if you attach it as a .csv file ?
I am using the procedure below :-
CREATE PROCEDURE mailtest AS
declare @sql varchar (255)
SELECT PERSONID, FORENAME, SURNAME INTO ##TEMP FROM PERSON
In the example above, the file MARKTEST.CSV does not currently exist, but the procedure should create it, put it in the root of C: and e:mail it, as it did when it ran under SQL Server 6.5. However, under 2000 it now doesn`t put a copy on the Hard Drive and it formats the .csv file in a very odd manner.
We have a tree structure containing section names. Each node is a section name and each section can have subsections. I have to copy the tree structure but need to maintain the parent-child relationship established within the id / parent_id fields. How do i acheive this?For example i have the treeSection 1 |-Section 1.1Section 2 |-Section 2.1The "Section" table contains 3 fields: id, parent_id, and caption. ID is the identity of the section record and parent_id contains NULL or the ID of this record's parent to create a child. So "Section 1" (id=1, parent_id=null), "Section 2" (id=2, parent_id=null), "Section 1.1" (id=3, parent_id=1), "Section 2.1" (id=4,parent_id=2).I would like to copy this sucture to create 4 new sections but they need to maintain their id/parent_id relationships BUT with new IDs. For this i created the following stored procedure:----------------CREATE PROCEDURE [dbo].[CopySection] AS -- Declare a temporary variable table for storing the sections DECLARE @tblSection TABLE ( id int, parent_id int, caption varchar(max), ) DECLARE @newAgendaID int, @newSectionID int; DECLARE @tid int, @tparent_id int, @tcaption varchar(max);BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Copy the desired sections into the local temp variable table INSERT INTO @tblSection SELECT id, parent_id, caption FROM tblSection ORDER BY parent_id; -- Using a cursor, step through all temp sections and add them to the tblSection but note its new ID DECLARE c1 CURSOR FOR SELECT * FROM @tblSection ORDER BY parent_id FOR UPDATE OF parent_id; OPEN c1; FETCH NEXT FROM c1 INTO @tid, @tparent_id, @tcaption; WHILE @@FETCH_STATUS = 0 BEGIN -- Insert the new Section and record the identity INSERT INTO tblSection (agenda_id, parent_id, caption) VALUES (@tparent_id, @tcaption); SET @newSectionID = SCOPE_IDENTITY(); -- Update the temp variable table with the new identity from the newly created real section in tblSection -- Update all temp variable records to point to the new parent_id UPDATE @tblSection SET parent_id = @newSectionID WHERE parent_id = @tid; FETCH NEXT FROM c1 INTO @tid, @tparent_id, @tcaption; END CLOSE c1 DEALLOCATE c1 END----------------The critical "UPDATE @tblSection" part doesnt seem to update the temp variable table with the @newSectionID (the actual section identity obtained after inserting a real record into the tblSection table). So in the end the inserted records into tblSection still point to the incorrect parent_id instead of the copied record's parent_id.Maybe I'm using CURSOR incorrectly or not setting a parameter so that it refreshes its recordset? I've tried using both table variables and temp tables but no luck.
Hi Guys, I have a syntax error in my SQL SELECT Query that is driving me crazy. All I am doing is adding a conditional with a literal value and that is breaking the query.This Query Works: SELECT Quantity, CAST(Gallons AS VARCHAR(10)) + ' ' + Style, Colour FROM ORDER_TANK_LINK LEFT JOIN TANKS ON TANKS.TankID = ORDER_TANK_LINK.TankID LEFT JOIN COLOURS ON COLOURS.ColourID = ORDER_TANK_LINK.ColourID This One is Broken:SELECT Quantity, CAST(Gallons AS VARCHAR(10)) + ' ' + Style, Colour FROM ORDER_TANK_LINK ON ORDER_TANK_LINK.OrderID = 1 LEFT JOIN TANKS ON TANKS.TankID = ORDER_TANK_LINK.TankID LEFT JOIN COLOURS ON COLOURS.ColourID = ORDER_TANK_LINK.ColourID Obviously I haven't explained the design of the tables, but because of the fact that I have another query that is so similar working perfectly, I didn't think you'd need it. The exact error is "Incorrect Syntax Near the Keyword 'ON'". OrderID is definately a value of the ORDER_TANK_LINK Table and is of type int. Thanks in advance!
I'm trying to do a basic update query which is working on other pages but not on this page. Dim uid As Integer = CInt(Session("uid")) Dim cmd As New SqlCommand("UPDATE [cvdata] SET [jobCompanyName] = @inputJobCompanyName WHERE [user_id] = @uid", strConn) With cmd.Parameters cmd.Parameters.AddWithValue("@inputJobCompanyName", inputJobCompanyName.Text) cmd.Parameters.AddWithValue("@uid", uid) End With cmd.Connection.Open() cmd.ExecuteNonQuery() cmd.Connection.Close() The funny thing is that if i remove inputJobCompanyName.Text and add a custom value (for example "test") it works.So it doesn't seem to read my updated textfield or something im clueless.Kind regards, Mark
I've got 2 identical DB's on the same server, one production, one test. No we don't have a test env, but at least I'm not testing on a prod DB (some people here do, trust me).
I've got a prod VB6 app that used SQL sp's. I've pointed the ADO connection string to the test DB while I make the changes I need to make, and I'll obviously change it back before I'm done etc.
I made some VERY minor changes to one of the sp's (added a variable, changed some stuff), tested thoroughly in query analyzer (runs with no errors in <1 sec), altered my ADO command accordingly and when I executed I get this:
run time error '-2147217871 (80040e31): [Microsoft][ODBC SQL Server Driver] timeout expired
The connection to the server is fine, I've tested that - it trips on the execution of the command:
Set rstCalls = conHelpArchiveConnection.Execute(SQLQ)
so here's my question: The prod version of this app works like a charm, and the test app times out. I'd rather not toy with the connection timeout setting on the server. Any thoughts on what could be causing this?
Any help would be appreciated, I'm ready to throw in the towel. Well at least until tomorrow morning ;)
Our application drives SSIS packages from ASP.NET web services. To alleviate some of the package load time overhead application caches SSIS Application object and several instances of "pre-loaded" packages in ASP.NET Application context. As needed the code uses cached SSIS Application instance to execute "pre-loaded" packages. Is this thread-safe?
Is it just me, or are features missing in Management Studio? I mean, where is the "Export Objects" option when exporting data? Why is it so difficult to register a remote server? Why do the object views suck? And most important, why is the documentation the worst software documentation I have EVER SEEN?! Things that were easy in Enterprise Manager with Client Network Utility and Query Analyzer seem impossible, difficult, or maybe just hidden in Management Studio. If it is there, the documentation sure doesnt tell you how to find it. Please someone tell me that it's just me. Tell me that the features are there but Im not doing something right. I feel like putting my head in between my door opening and banging the door against it.
Assuming I should be using values from temp inserted to insure correct record... Need help coding IF...THEN INSERT statements in following After TRIGGER:
Create TRIGGER trg_insertItemRows
ON dbo.a_form AFTER INSERT
AS SET NOCOUNT ON -- Checkbox Driven: IF a_form.missingCheckbox = -1 THEN Insert into b_items (form_ID, parent_ID, ItemTitle) Values (Select Distinct i.form_ID,i.parent_ID from inserted i)', '+ 'User checked Missing Data')
-- Textbox Driven: IF a_form.incorrectTxtbox <> 'na' THEN Insert into b_items (form_ID, parent_ID, ItemTitle) Values (Select Distinct i.form_ID,i.parent_ID from inserted i)', '+ Correction: Replace '+ incorrectTxtbox + ' with '+replaceWithTxtbox)
Sample code below:
-- Source table the Trigger acts on Create Table a_form ( form_ID int Not Null, parent_ID int, missingCheckbox bit, missingNote varchar(100), incorrectTxtbox varchar(50), replaceWithTxtbox varchar(50) )
--Target table Trigger inserts into Create Table b_items ( items_ID int Not Null, form_ID int Not Null, parent_ID int, ItemTitle varchar(150) )