My SP Works On 2005 Bit Not On 2000 It Doesn't Step Through My Code.
Aug 23, 2007
Hi
I have a SP that works on SQL 2000 but not on 2005
It is just suppose to step through my code and insert values into tables where it finds the "ticked" values
here is apiece of my code. I hope it Helps.
Code Snippet
INSERT INTO Members (ClientID, Name, Surname, Email, Username, Password, Active, WlcSent)
SELECT ClientID, [Name], Surname, Email, Username, Password, Active, [Welcome Sent]
FROM StageMemberUploading
WHERE ID = @numValues
SET @CurrentValue = (SELECT SCOPE_IDENTITY())
IF @ClientID IS NOT NULL BEGIN
INSERT INTO MemberUsergroup (MemberID, ClientID, UsergroupID)
VALUES (@CurrentValue, @ClientID, @UsergroupID)
END
IF @DateOfBirth IS NOT NULL BEGIN
INSERT INTO _MemberProfileCharacterValues (MemberID, OptionID, OptionValue)
VALUES (@CurrentValue, 1, @DateOfBirth)
END
-------------------My Code Stops here ------------------------------
IF @Male = 'x' BEGIN
INSERT INTO _MemberProfileLookupValues (MemberID, OptionID, ValueID)
VALUES (@CurrentValue, 2, 1)
END
IF @Female = 'x' BEGIN
INSERT INTO _MemberProfileLookupValues (MemberID, OptionID, ValueID)
VALUES (@CurrentValue, 2, 3)
END
Hello. I'm having troubles with a query that (should) return all therecords between two dates. The date field is a datetime type. The db isSQL Server 2000. When I try thisSELECT RESERVES.RES_ID, PAYMENTS_RECEIVED.PYR_ID,PAYMENTS_RECEIVED.PYR_VALUE, PAYMENTS_RECEIVED.PYR_DATE,CUSTOMERS.CUS_NAMEFROM RESERVES LEFT OUTER JOINPAYMENTS_RECEIVED ON RESERVES.RES_ID =PAYMENTS_RECEIVED.RES_ID LEFT OUTER JOINCUSTOMERS ON RESERVES.CUS_ID = CUSTOMERS.CUS_IDWHERE (PAYMENTS_RECEIVED.PYR_DATE >= '2006-03-20 00:00:00') AND(PAYMENTS_RECEIVED.PYR_DATE < '2006-03-27 00:00:00')on a "query builder" in visual studio, I get the results that I want.But when I use exactly the same query on an asp 3 vbscript script, Iget no results (an empty selection).I've done everything imaginable. I wrote the date as iso, ansi, britishformat using convert(,103) (that's how users will enter the dates),i've used cast('20060327' as datetime), etc. But I can't still get itto work. Other querys from the asp pages work ok. Any ideas?thanks a lot in advance
Hi all--I'm trying to convert a function which I inherited from a SQL Server 2000 DTS package to something usable in an SSIS package in SQL Server 2005. Given the original code here: Function Main() on error resume next dim cn, i, rs, sSQL Set cn = CreateObject("ADODB.Connection") cn.Open "Provider=sqloledb;Server=<server_name>;Database=<db_name>;User ID=<sysadmin_user>;Password=<password>" set rs = CreateObject("ADODB.Recordset") set rs = DTSGlobalVariables("SQLstring").value
for i = 1 to rs.RecordCount sSQL = rs.Fields(0).value cn.Execute sSQL, , 128 'adExecuteNoRecords option for faster execution rs.MoveNext Next
Main = DTSTaskExecResult_Success
End Function
This code was originally programmed in the SQL Server ActiveX Task type in a DTS package designed to take an open-ended number of SQL statements generated by another task as input, then execute each SQL statement sequentially. Upon this code's success, move on to the next step. (Of course, there was no additional documentation with this code. :-)
Based on other postings, I attempted to push this code into a Visual Studio BI 2005 Script Task with the following change:
public Sub Main()
...
Dts.TaskResult = Dts.Results.Success
End Class
I get the following error when I attempt to compile this:
Error 30209: Option Strict On requires all variable declarations to have an 'As' clause.
I am new to Visual Basic, so I'm on a learning curve here. From what I know of this script: - The variables here violate the new Option Strict On requirement in VS 2005 to declare what type of object your variable is supposed to use.
- I need to explicitly declare each object, unless I turn off the Option Strict On (which didn't seem recommended, based on what I read).
Given this statement:
dim cn, i, rs, sSQL
I'm looking at "i" as type Integer; rs and sSQL are open-ended arrays, but can't quite figure out how to read the code here:
This code seems to create an instance of a COM component, then pass provider information and create the recordset being passed in by the previous task, but am not sure whether this syntax is correct for VS 2005 or what data type declaration to make here. Any ideas/help on how to rewrite this code would be greatly appreciated!
I have several SQL 2000 servers I need to setup transactional (non updatable) replication with. The structure is:
SQL Server 2000 as Publisher/Distributor
SQL Server 2005 Standard as Subscriber
The connection is via the Internet with snapshots using FTP.
I setup the first set (2 databases at location A). They work wonderfully. I created the publication and then subscribed using MGMT Studio for 2K5.
II am setting up the same scenario for location B. Here is my problem:
In MGMT Studio I connect to the publisher (SANDRA). I right-click a publication and choose New Subscriptions..., the publication is already selected. I click next - Run each agent at its Subscriber is selected and the only option (this is desired), I click Next
HERE IS THE PROBLEM:
On the Subscriber's screen there are no Subscribers listed. When setting up location A the subscribing server was listed and I could choose a database. The Next button is greyed out and there is no way to create/add one.
I tried setting up the subscription by right-clicking the subcribing server's Replication folder in MGMT Studio but I get the same result (except that I have to authenticate with the publishing server which works fine).
WHAT'S DIFFERENT:
Location A is SQL Server Standard (SP3) running on SBS2K3. It is obviously on a domain and so SQL Server and the SQL Agent are running under domain accounts. Location B is a Windows XP SP2 machine running SQL Server Personal Edition (it actually says Development Edition in the properties window).
The databases are the same strucutre, different data. At location A the firewall is set to allow 1433->*any* and *any*->1433 where *any* is 1024 or higher. On the XP machine the firewall is set to allow port 1433. I don't think this is the issue because I've turned the firewall off on the XP machine and I get the same result.
Hi, I am trying to edit some data from a SQL2000-datasource in ASP.NET 2.0 and have a problem with a column that has bit-data and is used for selection. SQL2005 works fine when declaring <SelectParameters> <asp:Parameter DefaultValue="TRUE" Name="APL" Type="boolean" /> </SelectParameters>When running this code with SQL2000, there are no error-msgs, but after editing a record the "APL"-column looses its value of 1 and is set to 0. Looks like an issue with type-conversion, we've hit incompatibilities between SQL200 and 2005 with bit/boolean several times before. So, how is this done correctly with SQL2000? (I've tried setting the Type to "int16" -> err. Also setting Defval="1" gave an err) ThanksMichael
I've got a simple transactional replication set up. I have a separate publisher, distributor, and subscriber with 76 articles (tables only) being pushed from the distributor.
I have this exact setup with the same tables and data working in the SQL 2000 environment. I am testing replication on our SQL 2005 test servers before moving to production, however when the distributor attempts to push out the initial snapshot I keep getting this error.
Error messages:
Incorrect syntax near ')'. (Source: MSSQLServer, Error number: 102) Get help: http://help/102
Incorrect syntax near ')'. (Source: MSSQLServer, Error number: 102) Get help: http://help/102
Incorrect syntax near the keyword 'end'. (Source: MSSQLServer, Error number: 156) Get help: http://help/156
The following query works in SQL Server 2000 but gives follwoing error in SQL Server 2005
Msg 8114, Level 16, State 5, Line 1
Error converting data type varchar to float.
=======================
SELECT DISTINCT VWCONTACT.[ID] ID FROM VWCONTACT WHERE VWCONTACT.ACCOUNTID = 2615 AND VWCONTACT.VIRTUALDELETIONDATE IS NULL AND VWCONTACT.EMAIL LIKE '%@%' AND NOT EXISTS (SELECT VWCONTACT.ID FROM (SELECT DISTINCT VWCONTACT.[ID] ID FROM VWCONTACT JOIN (SELECT CONTACTID FROM VWCONTACTATTRIBUTEVALUE WHERE CONTACTATTRIBUTEID = 22943 AND ISNUMERIC(ATTRIBUTEVALUE) = 1 AND CONVERT(float,ATTRIBUTEVALUE) >= 77002) TMP0 ON VWCONTACT.ID = TMP0.CONTACTID JOIN (SELECT CONTACTID FROM VWCONTACTATTRIBUTEVALUE WHERE CONTACTATTRIBUTEID = 22943 AND ISNUMERIC(ATTRIBUTEVALUE) = 1 AND CONVERT(float,ATTRIBUTEVALUE) <= 77099) TMP1 ON VWCONTACT.ID = TMP1.CONTACTID WHERE VWCONTACT.ACCOUNTID = 2615 AND VWCONTACT.VIRTUALDELETIONDATE IS NULL ) NESTEDQUERY1 WHERE VWCONTACT.ID = NESTEDQUERY1.ID) AND NOT EXISTS (SELECT VWCONTACT.ID FROM (SELECT DISTINCT VWCONTACT.[ID] ID FROM VWCONTACT JOIN (SELECT CONTACTID FROM VWCONTACTATTRIBUTEVALUE WHERE (CONTACTATTRIBUTEID = 22943 AND ISNUMERIC(ATTRIBUTEVALUE) = 1 AND CONVERT(float,ATTRIBUTEVALUE) = 77336) OR (CONTACTATTRIBUTEID = 22943 AND ISNUMERIC(ATTRIBUTEVALUE) = 1 AND CONVERT(float,ATTRIBUTEVALUE) = 77338) OR (CONTACTATTRIBUTEID = 22943 AND ISNUMERIC(ATTRIBUTEVALUE) = 1 AND CONVERT(float,ATTRIBUTEVALUE) = 77345) OR (CONTACTATTRIBUTEID = 22943 AND ISNUMERIC(ATTRIBUTEVALUE) = 1 AND CONVERT(float,ATTRIBUTEVALUE) = 77365) OR (CONTACTATTRIBUTEID = 22943 AND ISNUMERIC(ATTRIBUTEVALUE) = 1 AND CONVERT(float,ATTRIBUTEVALUE) = 77396) OR (CONTACTATTRIBUTEID = 22943 AND ISNUMERIC(ATTRIBUTEVALUE) = 1 AND CONVERT(float,ATTRIBUTEVALUE) = 77489) OR (CONTACTATTRIBUTEID = 22943 AND ISNUMERIC(ATTRIBUTEVALUE) = 1 AND CONVERT(float,ATTRIBUTEVALUE) = 77504) OR (CONTACTATTRIBUTEID = 22943 AND ISNUMERIC(ATTRIBUTEVALUE) = 1 AND CONVERT(float,ATTRIBUTEVALUE) = 77598)) ATTR ON ATTR.CONTACTID = VWCONTACT.ID WHERE VWCONTACT.ACCOUNTID = 2615 AND VWCONTACT.VIRTUALDELETIONDATE IS NULL ) NESTEDQUERY1 WHERE VWCONTACT.ID = NESTEDQUERY1.ID) AND NOT EXISTS (SELECT VWCONTACT.ID FROM (SELECT DISTINCT VWCONTACT.[ID] ID FROM VWCONTACT JOIN (SELECT CONTACTID FROM VWCONTACTATTRIBUTEVALUE WHERE CONTACTATTRIBUTEID = 23102 AND ATTRIBUTEVALUE = 'Houston') TMP0 ON VWCONTACT.ID = TMP0.CONTACTID JOIN (SELECT CONTACTID FROM VWCONTACTATTRIBUTEVALUE WHERE CONTACTATTRIBUTEID = 22944 AND ATTRIBUTEVALUE = 'TX') TMP1 ON VWCONTACT.ID = TMP1.CONTACTID WHERE VWCONTACT.ACCOUNTID = 2615 AND VWCONTACT.VIRTUALDELETIONDATE IS NULL ) NESTEDQUERY1 WHERE VWCONTACT.ID = NESTEDQUERY1.ID)
when I modify the query like the following in SQL Server 2005 it works. Now the problem is since it is adynamically generated query from our application based on users selection of criteria, it means a lot to us to change the code.
SELECT DISTINCT VWCONTACT.[ID] ID FROM VWCONTACT WHERE VWCONTACT.ACCOUNTID = 2615 AND VWCONTACT.VIRTUALDELETIONDATE IS NULL AND VWCONTACT.EMAIL LIKE '%@%'
EXCEPT
((SELECT DISTINCT VWCONTACT.[ID] ID FROM VWCONTACT JOIN (SELECT CONTACTID FROM VWCONTACTATTRIBUTEVALUE WHERE CONTACTATTRIBUTEID = 22943 AND ISNUMERIC(ATTRIBUTEVALUE) = 1 AND CONVERT(float,ATTRIBUTEVALUE) >= 77002) TMP0 ON VWCONTACT.ID = TMP0.CONTACTID JOIN (SELECT CONTACTID FROM VWCONTACTATTRIBUTEVALUE WHERE CONTACTATTRIBUTEID = 22943 AND ISNUMERIC(ATTRIBUTEVALUE) = 1 AND CONVERT(float,ATTRIBUTEVALUE) <= 77099) TMP1 ON VWCONTACT.ID = TMP1.CONTACTID WHERE VWCONTACT.ACCOUNTID = 2615 AND VWCONTACT.VIRTUALDELETIONDATE IS NULL ) UNION (SELECT DISTINCT VWCONTACT.[ID] ID FROM VWCONTACT JOIN (SELECT CONTACTID FROM VWCONTACTATTRIBUTEVALUE WHERE (CONTACTATTRIBUTEID = 22943 AND ISNUMERIC(ATTRIBUTEVALUE) = 1 AND CONVERT(float,ATTRIBUTEVALUE) = 77336) OR (CONTACTATTRIBUTEID = 22943 AND ISNUMERIC(ATTRIBUTEVALUE) = 1 AND CONVERT(float,ATTRIBUTEVALUE) = 77338) OR (CONTACTATTRIBUTEID = 22943 AND ISNUMERIC(ATTRIBUTEVALUE) = 1 AND CONVERT(float,ATTRIBUTEVALUE) = 77345) OR (CONTACTATTRIBUTEID = 22943 AND ISNUMERIC(ATTRIBUTEVALUE) = 1 AND CONVERT(float,ATTRIBUTEVALUE) = 77365) OR (CONTACTATTRIBUTEID = 22943 AND ISNUMERIC(ATTRIBUTEVALUE) = 1 AND CONVERT(float,ATTRIBUTEVALUE) = 77396) OR (CONTACTATTRIBUTEID = 22943 AND ISNUMERIC(ATTRIBUTEVALUE) = 1 AND CONVERT(float,ATTRIBUTEVALUE) = 77489) OR (CONTACTATTRIBUTEID = 22943 AND ISNUMERIC(ATTRIBUTEVALUE) = 1 AND CONVERT(float,ATTRIBUTEVALUE) = 77504) OR (CONTACTATTRIBUTEID = 22943 AND ISNUMERIC(ATTRIBUTEVALUE) = 1 AND CONVERT(float,ATTRIBUTEVALUE) = 77598)) ATTR ON ATTR.CONTACTID = VWCONTACT.ID WHERE VWCONTACT.ACCOUNTID = 2615 AND VWCONTACT.VIRTUALDELETIONDATE IS NULL ) UNION (SELECT DISTINCT VWCONTACT.[ID] ID FROM VWCONTACT JOIN (SELECT CONTACTID FROM VWCONTACTATTRIBUTEVALUE WHERE CONTACTATTRIBUTEID = 23102 AND ATTRIBUTEVALUE = 'Houston') TMP0 ON VWCONTACT.ID = TMP0.CONTACTID JOIN (SELECT CONTACTID FROM VWCONTACTATTRIBUTEVALUE WHERE CONTACTATTRIBUTEID = 22944 AND ATTRIBUTEVALUE = 'TX') TMP1 ON VWCONTACT.ID = TMP1.CONTACTID WHERE VWCONTACT.ACCOUNTID = 2615 AND VWCONTACT.VIRTUALDELETIONDATE IS NULL ))
Hi! I have installed SQL 2000 and SQL 2005 in my computer.I tried to use some new features like row_number(),try..catch.. but are not working giving syntax error.β? So someone told me that i had to check the version and when I cheked I realized I was working with SQL 2000: βMicrosoft SQL Server 2000 - 8.00.194 (Intel X86) Aug 6 2000 00:57:48 Copyright (c) 1988-2000 Microsoft Corporation Developer Edition on Windows NT 5.1 (Build 2600: Service Pack 2)β? So, how can I change it for working with SQL 2005?. Itβs like Iβm working with SQL 2005 interface but internally it works as SQL 2000. Can you help me please?
I have installed SQL 2000 and SQL 2005 in my computer. But none of 2005 feature is working. So someone told me that i had to check the version and when I cheked I realized I was working with SQL 2000: Microsoft SQL Server 2000 - 8.00.194 (Intel X86) Aug 6 2000 00:57:48 Copyright (c) 1988-2000 Microsoft Corporation Developer Edition on Windows NT 5.1 (Build 2600: Service Pack 2)?
So, how can I change it for working with SQL 2005?. Its like Im working with SQL 2005 interface but internally it works as SQL 2000. Can you help me please?
I have this SSIS package which just doesn't seem to run when executing as a sql job and I keep getting this error:
"The command line parameters are invalid. The step failed."
I read some of the comments in forums and they were suggesting to verify the command line for the sql job since there is known bug in the command line for sql job.
But that didn't seem to resolve it and the reason could be one of the variable values that I am trying to set.
In this package one of the variables that I am trying to set is the connection string and my command line looks like this
When I try to run this from the command line I get the error as:
Argument " package.variables[User::MetaDataConnectionString].Value;Data Source=[SVRNAME];Initial Catalog=[DBNAME];Integrated Security=True;"" for option "set" is not valid.
I think the issue is in the set parameter where it seems to be intepreting the ;'s in the connection string as part of its command (which I seem to be escaping by putting them in quotes but it seems to be stripping them off)
Has anyone else encountered this issue? Is there any other escape character that I should be using?
I have a simple update statement that is running forever in SQL 2005 but works fine in SQL 2000. We have a new server we put SQL 2005, restored db. The table in question WEEKLYSALESHISTORY I even re-indexed all the indexes and rebuilt the stats as well. But still no luck, still running extremely long. 1 hour 20 minutes.
I'll try to give you some background on these table. Weeklysalehistory has approx 30 fields. I have 11 indesxes set up weekending date being one of them. And replication control has index on lasttrandatetime as well. So I think my indexes are fine.
/* Update WeekEnding Date for current weeks WeeklySales Records */ Update WeeklySalesHistory set weekendingdate = (SELECT LastTransDateTime from ReplicationControl where TableName = 'WEEKHST') where weekendingdate is null
Weekly sales has approx 100,000,000 rows Replication control has 631,000 (Ithink I can delete some from here to bring it down to 100 or 200 records) Although I don't think this is issue since on 2000 has same thing and works fine.
I was trying to do this within SSIS and thought that was issue. I am new so SSIS but it runs long even if I just run it as a job with this simple Update statement so I think its something with tables, etc that is wrong.
One thing on noticed if I look at the statistics in SQL Server Management studio there is a ton of stats. some being statistics on indexes which makes sense then I have a ton of hind_113_9_6 and simiiar one like this. I must have 90 or so named like this. Not sure how to check on SQL 2000 all the stats to see if they moved over from there or what. I checked a few other tables and don't have all these extra stats. Could this be causing the issue do I need to delete all these extras? Any help would be greatly appreciated.
Intel D975XBX 930 2GB ram HD 300GB - MatroxVD Windows XP Sp2 + updates Visual Studio 2005 Professional edition SQL Sever 2005 Standard Edition
20070203 Install Practice Files at D:Program FilesMicrosoft PressVisual C Sharp Step by Step.
Configuring SQL Sever Express Edition Hostname - xxxxxxxxx..
At sqlcmd s xxxxx...SQLExpress E got - Pipes error.
Open Microsoft SQL Sever 2005 - Configuration Tools SQL Configuration Manager select Protcols for SQLEXPRESS select Named Pipes enable close.
At sqlcmd s xxxxx..SQLExpress E get Sqlcmd: : Unknown Option. Enter -? for help.
Chdir C:Documents and SettingsAll UsersStart MenuProgramsMicrosoft Server 2005 Sqlcmd s xxxxxx..SqlExpress E Hresult 0x2, Lvel 16, State 1 Named Pipes Provider: Couldnot open a connection to SQL Server [2]. Sqlcmd: Error: Microsoft SQL Native Client : 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.. Sqlcmd: Error: Microsoft SQL Native Client : Login timeout expired.
How do I fix this?
Need to be able to to use the Northwind Traders data base
I have a stored procedure with a where clause like this: WHERE Q.EffectiveDate >= @FromEffectiveDate AND Q.EffectiveDate <= @ToEffectiveDate AND I.InsuredName LIKE '%' + isnull(@PreQuoteDesc,I.InsuredName) + '%' AND isnull(Q.LineOfBusinessDescription,'') LIKE '%' + coalesce(@LOBProperty,Q.LineOfBusinessDescription,'') + '%' AND isnull(Q.LineOfBusinessDescription,'') LIKE '%' + coalesce(@LOBGeneralLiability,Q.LineOfBusinessDescription,'') + '%' AND isnull(Q.LineOfBusinessDescription,'') LIKE '%' + coalesce(@LOBInlandMarine,Q.LineOfBusinessDescription,'') + '%' AND isnull(Q.LineOfBusinessDescription,'') LIKE '%' + coalesce(@LOBMotorTruckCargo,Q.LineOfBusinessDescription,'') + '%' AND isnull(Q.LineOfBusinessDescription,'') LIKE '%' + coalesce(@LOBOwnersContractorsProtective,Q.LineOfBusinessDescription,'') + '%' AND isnull(Q.LineOfBusinessDescription,'') LIKE '%' + coalesce(@LOBSpecialEvents,Q.LineOfBusinessDescription,'') + '%' AND rsu.FirstName LIKE '%' + isnull(@OwnerFirstName, rsu.FirstName) + '%' AND rsu.LastName LIKE '%' + isnull(@OwnerLastName, rsu.LastName) + '%' AND Q.quoteID = isnull(@quoteID,Q.QuoteID) AND Q.QuoteStatusID = isnull(@quoteStatusID, Q.QuoteStatusID) AND rsu.AspNetUserID = isnull(@ASPNetUserID, rsu.AspNetUserID) ------------------------------------------------------------------- All is working well except for the line of business: ------------------------------------------------------------ AND isnull(Q.LineOfBusinessDescription,'') LIKE '%' + coalesce(@LOBProperty,Q.LineOfBusinessDescription,'') + '%' AND isnull(Q.LineOfBusinessDescription,'') LIKE '%' + coalesce(@LOBGeneralLiability,Q.LineOfBusinessDescription,'') + '%' AND isnull(Q.LineOfBusinessDescription,'') LIKE '%' + coalesce(@LOBInlandMarine,Q.LineOfBusinessDescription,'') + '%' AND isnull(Q.LineOfBusinessDescription,'') LIKE '%' + coalesce(@LOBMotorTruckCargo,Q.LineOfBusinessDescription,'') + '%' AND isnull(Q.LineOfBusinessDescription,'') LIKE '%' + coalesce(@LOBOwnersContractorsProtective,Q.LineOfBusinessDescription,'') + '%' AND isnull(Q.LineOfBusinessDescription,'') LIKE '%' + coalesce(@LOBSpecialEvents,Q.LineOfBusinessDescription,'') + '%' --------------------------------------------------------------------------------- If the user checks just 'Property' results look like: Property Property Property, General Liability If the user checks just 'General Liability' the resultes look like: Genral Liablility General Liability General Liability, Inland Marine If the user checks both Property and General Liability all they get back is: Property, General Liability They should get back everything including just Property or just General Liability or both. So I tried to change the ANDs to ORs and it doesn't work. ----------------------------------------- AND ( isnull(Q.LineOfBusinessDescription,'') LIKE '%' + coalesce(@LOBProperty,Q.LineOfBusinessDescription,'') + '%' OR isnull(Q.LineOfBusinessDescription,'') LIKE '%' + coalesce(@LOBGeneralLiability,Q.LineOfBusinessDescription,'') + '%' OR isnull(Q.LineOfBusinessDescription,'') LIKE '%' + coalesce(@LOBInlandMarine,Q.LineOfBusinessDescription,'') + '%' OR isnull(Q.LineOfBusinessDescription,'') LIKE '%' + coalesce(@LOBMotorTruckCargo,Q.LineOfBusinessDescription,'') + '%' OR isnull(Q.LineOfBusinessDescription,'') LIKE '%' + coalesce(@LOBOwnersContractorsProtective,Q.LineOfBusinessDescription,'') + '%' OR isnull(Q.LineOfBusinessDescription,'') LIKE '%' + coalesce(@LOBSpecialEvents,Q.LineOfBusinessDescription,'') + '%' ) I know this is incredibly hard to follow because its incredibly hard to write out. Is there anyone smart out there who can figure this out? Thanks
I'm trying to connect to my SQL, and both ways I tried with CLI work. However, I have no luck with native C++, with the same string. Any ideas why? Here's the error message I get, and the source.
However, I cannot get the same to work via RMO. The error i get back is "The process could not connect to subscriber "subscribername". What am I missing? Any help and feedback is greatly appreciated.
Dim _mergeAgent As MergeSynchronizationAgent = New MergeSynchronizationAgent()
I have an active x script written in vb that just counts the records in a table and fails the step if there are not enough records. It is simple and effective. But when I transfered this task to my SSIS package I get a function not found error.
I am not familiar with active x or vb script so I have no idea what is wrong. I can do without while I build the package but I need it in the end to prevent possible problems....
I have a longstanding problem where Stored Procedures or complex T-SQL called from VB.NET will not populate a DataTable object, but will work fine with a DataSet. For example: 'oConn is defined elsewhere... Dim sErr as String = "" Dim dt As New DataTable If Not oConn Is Nothing Then Try Dim sSQL as String = "select 1" Dim oCommand As New OdbcDataAdapter(sSQL, oConn) oCommand.Fill(dt) Catch ex As Exception sErr = "Database Error: " & ex.Message Finally sqlCloseConnection(oConn) End Try End Ifthis works fine and my dt DataTable object gets one row. However using this as the SQL: Dim sSQL as String = "declare @foo table(mycol integer);insert @foo select 1;select mycol from @foo;"does not work. It executes with no errors, but the DataTable has no rows. Finally, if I replace the DataTable with: Dim ds as DataSetI can then get the data in ds.Tables(0) no problem.So, if the results of the sql are a single result table being put at index 0 of a DataSet, why are they not being put in a single DataTable?When a sql is a simple select statement it always works directly to a DataTable. Only when it's a SP or sql with some logic does it require the DataSet approach. This is a reporting utility so I need to standardize the code though the sql will be dynamic. Any ideas?
I have scheduled a job in Management Studio, but it doesn't work. However, when I run it maually in Visual Studio it works. I have connected an outside server by mapping it to mine. Maybe this is the problem?
I have also tried to configure a linked server, but I cannot find out how to connect my SSIS package to the linked server.
I have many jobs on sql 05 and all work but one. This one writes to an Access DB on the same server as SQL. The package works fine. But when executed in the context of the SQL Agent job, it fails.
Jobs that write to a text file work fine. The Access DB has no password required. By the way, that job in sql 2000 worked fine.
I have an SSIS package is made up of SQL tasks and dataflows. The dataflows connect to an Oracle database using Native OLE DBOracle Provider for OLE DB (10g). This is the first package dealing with oracle that runs on the server. I can execute the package manually by right clicking and going to 'Run Package' while logged in remotely from the server, but it gets hung up and does nothing if I run it as a job. I always have to quit the job. I can disable everything but the dataflows in the package and the job completes and runs fine.
I have the following query which works fine when it's executed as a single query. but when i union the result of this query with other queries, it returns a different set of data.
any one know why that might be the case??
select top 100 max(contact._id) "_id", max(old_trans.date) "callback_date", 7 "priority", max(old_trans.date) "recency", count(*) "frequency" --contact._id, contact.callback_date from topcat.class_contact contact inner join topcat.MMTRANS$ old_trans on contact.phone_num = old_trans.phone where contact.phone_num is not null and contact.status = 'New Contact' group by contact._id order by "recency" desc, "frequency" desc
i've included the union query here for completeness of the question
begin declare @current_date datetime set @current_date = GETDATE()
select top 100 _id, callback_date, priority, recency, frequency from ( ( select top 10 _id, callback_date, 10 priority, @current_date recency, 1 frequency --, DATEPART(hour, callback_date) "hour", DATEPART(minute, callback_date) "min" from topcat.class_contact where status ='callback' and (DATEPART(year, callback_date) <= DATEPART(year, @current_date)) and (DATEPART(dayofyear, callback_date) <= DATEPART(dayofyear, @current_date)) -- all call backs within that hour will be returned and (DATEPART(hour, callback_date) <= DATEPART(hour, @current_date)) and (DATEPART(hour, callback_date) <> 0) order by callback_date asc --order by priority desc, DATEPART(hour, callback_date) asc, DATEPART(minute, callback_date) asc, callback_date asc ) union ( select top 10 _id, callback_date, 9 priority, @current_date recency, 1 frequency from topcat.class_contact where status = 'callback' and callback_date is not null and (DATEPART(year, callback_date) <= DATEPART(year, @current_date)) and (DATEPART(dayofyear, callback_date) <= DATEPART(dayofyear, @current_date)) and (DATEPART(hour, callback_date) <= DATEPART(hour, @current_date)) and (DATEPART(hour, callback_date) = 0) order by callback_date asc ) union ( select top 10 _id, callback_date, 8 priority, @current_date recency, 1 frequency from topcat.class_contact where status = 'No Connect' and callback_date is not null and (DATEPART(year, callback_date) <= DATEPART(year, @current_date)) and (DATEPART(dayofyear, callback_date) <= DATEPART(dayofyear, @current_date)) and (DATEPART(hour, callback_date) <= DATEPART(hour, @current_date)) order by callback_date asc ) union ( select top 100 max(contact._id) "_id", max(old_trans.date) "callback_date", 7 "priority", max(old_trans.date) "recency", count(*) "frequency" --contact._id, contact.callback_date from topcat.class_contact contact inner join topcat.MMTRANS$ old_trans on contact.phone_num = old_trans.phone where contact.phone_num is not null and contact.status = 'New Contact' group by contact._id order by "recency" desc, "frequency" desc ) ) contact_queue order by priority desc, recency desc, callback_date asc, frequency desc
Hello to all, i have a problem with IN-Operator. I cann't resolve it. I hope that somebody can help me. I have a IN_Operator sql query like this, this sql query can work. it means that i can get a result 3418: declare @IDM int; declare @IDO varchar(8000); set @IDM = 3418; set @IDO = '3430' select * from wtcomValidRelationships as A where (A.IDMember = @IDM) and ( @IDO in (3428 , 3430 , 3436 , 3452 , 3460 , 3472 , 3437 , 3422 , 3468 , 3470 , 3451 , 3623 , 3475 , 3595 , 3709 , 3723 , 3594 , 3864 , 3453 , 4080 )) but these numbers (3428 , 3430 , 3436 , 3452 , 3460 , 3472 , 3437 , 3422 , 3468 , 3470 , 3451 , 3623 , 3475 , 3595 , 3709 , 3723 , 3594 , 3864 , 3453 , 4080 ) come from a select-statement. so if i use select-statement in this query, i get nothing back. this query like this one:select * from wtcomValidRelationships as A where (A.IDMember = @IDM) and ( @IDO in (select B.RelationshipIDs from wtcomValidRelationships as B where B.IDMember = @IDM)) I have checked that man can use IN-Operator with select-statement. I don't know why it doesn't work with me. Could somebody help me? Thanks I use MS SQL 2005 Server Management Stadio Express Thanks a million and Best regards Sha
SELECT favorites.FID, favorites.filename, favorites.username, files.status, files.private, files.views, files.title FROM favorites INNER JOIN files ON favorites.filename = files.filename WHERE (favorites.username = @username) AND (files.status IS NULL) AND (files.private = @private)@private is manually set to 'no'@username is set to profile.usernamewhen I run the above query in microsoft sql server mgmt studio express on the database, it presents all the information i'm asking for very easily. however when i try to implement this query on a aspx .net2.0 page with teh sqldatasource and a gridview, no data is displayed.anyone know what my problem is?
I am trying to set a variable with this default value using expression. This works in tsql but doesn't in ssis. Can anybody tell me what is wrong with this?
works fine in designer but when i load the report services I get the following error anybody know what to do there is one subreport with this report maybe the passing value but what could be wrong ????
Item has already been added. Key in dictionary: '9' Key being added: '9'
Anyone live in seattle (meet on cap hill)? I have been stuck for weeks now and can't wait any longer wasting time - i will pay someone to set me up correctly quickly. I doubt this will be resolved online, but here goes... I need a datagrid to bring up simple database info (northwind) instead of showing the error 'login failed for mycomputeraspnet'. I am using windows authentication and my string is connectionstring = datasource=(local)\netsdk;initial catalog=Northwind;integrated security=sspi; persistent security=false;, I have seen online they say alter the authorization in the app virtual directory-- is that the C/inetpub/wwwroot or the web config of my project? I did so in the web config of my project, and also I added the impersonate=true to same already. I shared all the folders and made sure they are not read-only. I am flabbergasted. Paul XP pro 2004 sp 2 vis studio 2002 w updates C# Asp web app project
I am trying to debug sql2000 sp from managed code app with VS.Net 2003 archetect Ed.. It did not stop at the break point within the sql sp. I did granted execute permission for sp_sdidebug. Do I need to attach any process?
Is there anything left off by the article? I referenced msdn article option 2: http://support.microsoft.com/default.aspx?kbid=316549
I am working on SQL-Server 2000 (developer edition) with SP3 on Win 2000 and Clients are Win98/Win XP.
I am not able to 'Step Into' my SQL Procedure code in Debug mode, executed from Query Analyzer from a client machine. As soon as I select the 'Execute' button after inserting all the parameters value, the whole procedure gets executed. But I'm able to do the same (i.e 'step into') from the Server itself.
Do I need any additional configuration settings in the client machine ??
I shall be greatful if anyone can help me to solve the above problem.