.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Duplicate columns names not allowed - OPENQUERY - OPENROWSET - Error 492

Posted By:      Posted Date: September 02, 2010    Points: 0   Category :Sql Server
I have a piece of code below which manipulates incoming XML. I understand why it is failing in SQL2005, due to the duplicate name "Process". What i dont understand is why this works fine in SQL2000? We are trying to migrate from SQL2000 to SQL2005 and even if we run SQL2005 in 8.0 compatibility mode we still get the error. Why does it work in SQL2000 and is there anyway to emulate this behaviour in SQL2005? I really do not want to work through +-600 SPs to see if I need to change anything. Thank You declare @Event varchar(255) declare @XML varchar(3000) set @event = ' set @xml = '<OmegaEvent Process="NEWBUSINESS" Type="APPFORM" DateTimeStamp="2010-09-02T06:06:43" Version="3.0"> <APPFORM> <BUSSUNIT>AN</BUSSUNIT> <CATEGORYDESC> </CATEGORYDESC> <CHECKDIGIT>B</CHECKDIGIT> <CLIENTSTATUS> </CLIENTSTATUS> <CONVERSION> </CONVERSION> <DISTRCHANNEL> </DISTRCHANNEL> <EVENTDATE>20100902</EVENTDATE> <EVENTTIME>60643528960</EVENTTIME> <FINALISOR>N</FINALISOR> <FORM>MIFU</FORM> <FORMNAME>MAX INCOME COMPULSORY</FORMNAME> <INTERMEDCODE> </INTERMEDCODE> <MAIL_CAMPAIGN> </MAIL_CAMPAIGN> <POLICYNO>016058558</POLICYNO> <PROCESS>ICC</PROCESS> <PR

View Complete Post

More Related Resource Links

OPENQUERY Error when calling usp - object has no columns or the current user does not have permissio

Hi Guys, I need to get data using a usp, but getting error: Cannot process the object "EXEC BKS..uspPayments @paymentTypeCode1 = '1', @paymentTypeCode2 = '2', @paymentTypeCode3 = '3';". The OLE DB provider "SQLNCLI" for linked server "SERVER" indicates that either the object has no columns or the current user does not have permissions on that object. I am trying the script below: use myDB; select * from OPENQUERY([SERVER], 'EXEC myDB..uspPayments @paymentTypeCode1 = ''1'', @paymentTypeCode2 = ''2'', @paymentTypeCode3 = ''3''; ') Thanks in advance for any help. Everything is possible, impossible just takes longer

Can two columns have the same display names but different underlying names?


I have two columns which are set up differently. But for a display purpose and different usage, they should share the same display names but not the underlying name. How may I set them up in SharPoint?

Duplicate column names from forms in SharePoint lists



I'm in the process of migrating from a WSS 2 site to WSS 3/MOSS. On the old site I used an Infopath 2003 form for absence requests. During the migration I now use Infopath 2007. There wasn't any problem initially when the form was stored with the SharePoint form library. However, when I published the form as a content type from Infopath 2007 and then added that content type to the form library, there are two columns for each piece of data from the form. (One from the content type and one from the form list.) I relinked each old form (list content type) to the new AbsenceRequest content type and removed the original one from the list. However, the duplicate column names are still there. Since they came from the Infopath form, they are not editable or deletable from the SharePoint list management interface. The duplicate column names make it tough to build views since it isn't apparent which column to use in the form building UI. It can be determined form the overview display, but it is very cumbersome.


Does anyone know a way to get rid of the old, absolute, columns?

Calculated Columns in a Form Library receive error: Value does not fall within the expected range.


I have a forms library that posts the date the form was created. We would like to create a calculated column that allows us to look at these forms based on the month and year they were created. I had created a calculated column that extracts the month and replaces the number with a text string by using an if statement; "IF(MONTH([Proposal Date])=1,"January","") It goes on to evaluate each month and replace the number with the text string. This formula worked for quite some time, though now when I try to add any calculated columns or edit any existing calculated columns on this form library I receive the following error: Value does not fall within the expected range. Now my existing calculated columns (like the one above) do not work and I can not create new calcualted columns. Any insight would be awesome as this has been plaguing me for a couple of months now.

The remote server returned an error: (405) Method Not Allowed.



{System.Net.WebException: The remote server returned an error: (405) Method Not Allowed.
   at System.Net.WebClient.UploadFile(Uri address, String method, String fileName)
   at System.Net.WebClient.UploadFile(Uri address, String fileName)
   at System.Net.WebClient.UploadFile(String address, String fileName)
   at Test.Page_Load(Object sender, EventArgs e) in c:\Inetpub\wwwroot\WebSite1\Test.aspx.cs:line 35}

Windows application, automated process will run on local user system...
trying to upload a file to website folder. website address:

System.Net.WebClient wc = new WebClient();
wc.UploadFile(website address, "c:/1.pdf");

Getting error from above line.. Am doing something wrong??
I dont want to use ftp or share folder logic..
is there any other way to upload the files to server??

Error when creating PK to a column which has dupliacte columns..

The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'table name' and the index name 'PK__column__118068EB'. The duplicate key value is (D1).

Insert columns into GridView and rendercontrol error

Hi I´m inserting columns into a gridview at run time using: gvRageReport.Columns.Insert(index, column) When I render the gridview in orther to export to excel all the excel columns are empty except the new insert columns, but when I add the new columns using gvRageReport.Columns.Add(column) the excell is exported successfully.Any idea?

Duplicate column error in script

Hello, I have a new database server and I created a new database and now I'm trying to run a script that's supposed to create all the tables from the previous database server. The script is an accumulation of various changes I have made to the old database since the start of the project in order to implement a variety of features, so it has this pattern: ALTER TABLE X DROP COLUMN Y; GO and later in the file: ALTER TABLE X ADD Y int NOT NULL; GO When I run the script, I get a duplicate column error message for the table and field, although I first dropped the column and then added it again. I suppose I have to do some kind of flash after the drop and before the add, but isn't the GO supposed to do that? If not, how can I flash it in the script? Thanks.  

Foreign characters causing a duplicate attribute key error - how to avoid?

Greetings, We have a data warehouse into which we import data obtained from our outside vendors.  The data are then used to build data cubes.  Lately we have started to get a duplicate key error on the "County" attribute in our "Location" dimension.  The problem appears to be caused by these two values returned by the query that returns the distinct list of counties: Spree-Neisse Spree-Neiße These are German counties and they are really the same county, I believe.  Our data warehouse stores County as a varchar.  If I cast the stored value as nvarchar, the query that returns the distinct list of counties returns only the 2nd value and so should avoid the duplicate key error.  (I haven't tried it yet, just speculating.) This post suggests the root cause of the problem: http://ssas-musings.blogspot.com/2009/11/duplicate-key-error.html We don't have any control over the data before our vendors give it to us, and it comes from all over the world.  What is the best way to avoid occurrences of the duplicate attribute key error?  Should we be storing all our character data as nvarchar?  Would it be enough to cast the stored data as nvarchar when the cubes are being built?  Is there a better approach?  I'd like to get an idea of what the best practice would be.  Our warehouse

Master Detail-Modal Popup Duplicate Component ID error

This is my main page in which I have collapsible panel and my phone gridview is contained in it. The Initial page loads up properly and shows the gridview. All the errors happen when I select a gridview row for modal popup edit. I get the following errors one after other after ignoring each one of them. I have been struggling with his for almost a week. I would appreciate if someone could help me get rid of these errors. Following are the sections of the main page and the code in the gridview ascx control . Main GridView User Control Page.<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/basemaster.master" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> <%@ Register TagPrefix="ucophone" TagName="ucopsphone" Src="~/UserControls/online_app_phone_gv.ascx" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <div> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:CollapsiblePanelExtender ID="CollapsiblePanelExtenderPhone" runat="server" TargetControlID="PanelContentPhone" Supp

Duplicate field name error, creating new site from custom template

I've made a site that maps the site (with a table of contents) and i export it to another site collection. I'm able to install and activate the solution in the other site collection, however when i'm going to create a new site using the site i've installed as a template it pops an error saying "A duplicate field name Wiki_x0020_Page_x0020_CategoriesTaxHTField" was found." I have no clue what this means. Can anyone help me? Thanks in advance

Error comparing two identical columns in Condtional Split


(SQL 2005)

I'm reading in one SQL table and doing a lookup against another SQL table which is an identical copy of the first table, used for temporary storage during the load event.

I want to compare each field to find if there are any changes in the temporary table.  When I compare two string fields, Customer != temp_Customer I get no error message.  When I compare two decimal fields, Width != temp_Width I get an error message: DT_WST and DT_Numeric are incompatible with !=.

The two fields are BOTH declared as decimal 19,6 in their respective tables.  Why can't I run this comparision???

Duplicate Fields during list creation from content types and site columns


I am trying to create a List in Sharepoint 2010 using Site Columns and Content Types. It results in creating duplicate fields in the list for the Site Columns used. Here is the details description of what I was doing.

I have created two site columns 


<Field Type="Number" DisplayName="Start Coordinate" Required="TRUE" EnforceUniqueValues="FALSE" Indexed="FALSE"
Group="QMS" ID="{A3F2D108-11B5-4B49-9633-338D27227E12}"
Name="StartCoordinate" Overwrite="TRUE" />

<Field Type="Number" DisplayName="End Coordinate" Required="TRUE" EnforceUniqueValues="FALSE" Indexed="FALSE"
Group="QMS" ID="{06B927BB-C354-4A0A-AE88-9C14E55EAB27}"
Name="EndCoordinate" Overwrite="TRUE" />

Then added these to a new content type I

How to play around with Columns' names filled by OleDbDataAdapter ?


I tried to query an excel file which contains a lot of customers' information but my problem is most of those don't have a specific column names.

E.g. it's in the following format. (Excel File)

A         B         C

Info1  blur    blur
Info2  blur    blur
Info3  blur    blur

So, when I query using SqlDbDataAdapter, in my DataTable, info1 blur blur becomes column header.

E.g. it's in the following format. (DataTable)

Info1 blur blur

Info2 blur blur
Info3 blur blur

I been working on it so that it actually goes down one row and Change the column name in the DataTable into some appropiate name. Something like the following format.

Name1  Name2  Name 3

Info1       blur        blur
Info2       blur        blur
Info3       blur        blur

Is there any way that I could work around it rather than actually going back to change the excel files ? Because I have like 1,000 excel files in that kinda format and s

OPENQUERY throws Error 7357 when the source SP uses temporary table.

Hello Everybody / Anybody,
Sorry but exiting problem!
The Problem: OPENQUERY throwing error [Error 7357]when the source SP uses temporary table.
Description : Need to validate data against master list. My combo on UI has a source Stored Proc(contains a temp table in it).
I'm importing data from Excel. Before import, I want to validate it against my master list values.
[say field Priority has master values "High, Medium,Low".] and in excel user has added 'ComplexHigh' under priority field]
In this case, my import validator StoredProc should not accept value 'ComplexHigh' as it is not present in my Priority master list]
I'm preparing a temp table tabName  containing o/p of SP, it works fine zakkas if my SP  usp_SelectData does not contain temp table. 
I think you got what the situation is!! Woh!

Why do I get a duplicate key error on the following?

        var querymax = (from obj in EMAL_db.tObjects
                select (int?)obj.Id).Max();
        if (querymax != null)
          nextObjectId = (int)querymax + 1;
        newObject = new tObject();
        newObject.Id = nextObjectId++;
        catch (Exception ex0)
          MessageBox.Show("Exception in Converter.Execute " + ex0.Message + Environment.NewLine + ex0.StackTrace);

After unsuccessful attempts to insert into the database, ID's are consumed so that next to be inserted can be i.e. 143 when ...Max() returns 119. Why is that?

infopath Error: Only integers allowed



i'm having trouble submitting new item to an sql server table using infopath 2007.

i'm using a main datasource which i added another table (B) that has a foreign key relationship. i also added a secondary receive datasource to auto-populate the user information on the form.

Everytime i try to add a new data to the table (B) i added, when i click submit it give me this error:

Field or group: BE_CODE
Error: Only integers allowed

Field or group: EM_CODE
Error: Only integers allowed

i created a form to test with only 1 table (B), when i click submit it add the new data fine. so i dont think that i'm inserting a wrong datatype.

does someone know what i'm doing wrong here?


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend