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

Top 5 Contributors of the Month
Post New Web Links

How to validate invalid column in subquery in script

Posted By:      Posted Date: October 28, 2010    Points: 0   Category :Sql Server
How to validate invalid column in subquery in script.
What i have a full script for all of my stored procedures and function.
In some stored procedures there are some inner/sub queries which have invalid column name but there is no error in the script when i run it or Parse it.IS tehre anyway i can find the error in my script without going in each of Stored procedures/Functions

Kamran Shahid Senior Software Engineer/Analyst (MCP,MCAD,MCSD.NET,MCTS,MCPD.net[web])

View Complete Post

More Related Resource Links

Trying to use distrib but gets error, invalid column name 'publisher'

I have a pull subscription setup between sql server standard 2005 and windows 7 sql server 2008 express. When I run the distrib exe I get the error "invalid column name 'publisher'". I have searched the internet for a solution to this problem and keep coming up empty. Can someone help me debug this error?

C# newbie stuck - trying to access column data in a SharePoint list in an SSIS script task

Hello, I'm sure this is the simplest question but I can't figure it out, even with Google's help. I am trying to stumble through some C# code in an SSIS script task and I am frustrated that I can't figure out how to do the easiest things.  I eventually want to find data in a column,and then use another list as a lookup to replace that value with another where the existing value matches a value in the lookup list.  So, the data in my (multiple choice) column might be "apples; bananas" and in another list I have a row that contains two columns, the first holding the value "Apples" and the second containing "Red Delicious" and my original column should read: "Red Delicious; bananas." But, alas, I can't even figure out how to see the data that is in a column. Here is my code: /*<br/> Microsoft SQL Server Integration Services Script Task<br/> Write scripts using Microsoft Visual C# 2008.<br/> The ScriptMain is the entry point class of the script.<br/> */<br/> <br/> using System;<br/> using System.Data;<br/> using Microsoft.SharePoint;<br/> using Microsoft.SqlServer.Dts.Runtime;<br/> using System.Windows.Forms;<br/> using Microsoft.SharePoint.Utilities;<br/> <br/> namespace ST_08becda4c05c49cd9f30ea76110076cd.csproj<br/> {<br/> [

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.  

Invalid column name 'PasswordSalt' - When session dies?

Server Error in '/' Application. Invalid column name 'PasswordSalt'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: Invalid column name 'PasswordSalt'. Source Error: Line 12: login_password = Request.Form["login_password"]; Line 13: var login_username = Request.Form["login_username"]; Line 14: if(WebSecurity.Login(login_username, login_password)){ Line 15: Response.Redirect("~/"); Line 16: } Source File: c:\login.cshtml Line: 14 Stack Trace: [InvalidOperationException: Invalid column name 'PasswordSalt'.] Microsoft.Data.DynamicRecord.VerifyColumn(String name) +146 Microsoft.Data.DynamicRecord.get_Item(String name) +18 Microsoft.Data.DynamicRecord.TryGetMember(GetMemberBinder binder, Object& result) +11 CallSite.Target(Closure , CallSite , Object ) +130 System.Dynamic.UpdateDelegates.UpdateAndExecute1(CallSite site, T0 arg0) +438 Microsoft.WebPages.SimpleMembershipProvider.GetPassword(Database db, Int32 userId, String& passwordSalt) +641 Microsoft.WebPages.SimpleMembershipProvider.CheckPassword(Database db, Int32 userId, String password

Invalid column name sqlserver 2005, asp.net, vb.net

Hello Friends.
  I am getting an error while tryng to write to sql server. I can't figure out whats wrong. I tried over and over and through some of you may be able to see through the erro instantly. 
the error says "Invvalid "ClientID"" whcih is not true. I double checked the typos and the type. I declared it as varchar(250) and its not declared as identity field,w hich I knew I should but I didnt' in this case
Little background on the set up
I have a table named jobs where I have a jobID as the pk(autogenerated colum) and clientID which his not foreign or any kind of key, yet anyway. and rest of hte field as you see below in my code. Why am I getting this error? Any clue?
I really appreciate if you could help me.
My relevant code
If Page.IsValid Then
            Dim jobdsn As New SqlDataSource
            jobdsn.ConnectionString = ConfigurationManager.ConnectionStrings("CandidatesConnectionString").ToString()
            jobdsn.InsertCommandType = SqlDataSourceCommandType.Text
            jobdsn.InsertCommand = "INSE

Invalid column name SERIALNOLEFT


I am writing a report in SSRS and when my report calls the stored proc below I receive an error stating query execution failed:  Invalid column name SERIALNOLEFT.  However, I have searched the script used ot create the Stored Procedure and I do not see where I am specifying a column name SERIALNOLEFT.





/****** Object:  StoredProcedure [dbo].[CustomerActivityCustomerName]    Script Date: 09/24/2010 11:11:44 ******/





CREATE Procedure [dbo].[CustomerActivityCustomerName]

Invalid column name 'Infinity'. + SQLException


Hi All,

I am inserting the values to the table using the table adapter. And all columns except the datetime and messageid that is unique identification column are the varchar then also i am facing problem of "Invalid column name 'Infinity'. + SQLException".  StackTrace is as below:


   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean ret

Why am i getting a note that says 'Invalid Column name'



I,m getting a messeage that i use 'Invalid Column name'. The qury still works but it,s frustrating not knowing what is wrong. I have one table in which i alter a new Column and then update this column from another table, see my code below. When i type in the name of the Column i altered i get this error message. I also use this column later in my query and get the same error. Anybody that knows what i,m doing wrong? 






selecting a value of one column based on the max value of another in a subquery


I would like to select the value of column c  that is based on the max of column b

select q.a,q.c

(select a,max(b) as mx,c

from  a table group by a,c)q

when I try to select the row I get multiple rows

I need to return one row that corresponds to the max in col b

This is an invalid webresource request. and This is an invalid script resource request.


Hi there

I have implemented utility when there is error in sharepoint it will redirect to custom error page and send me email about exception but now i am getting email for following exception 

Date: 10/25/2010 3:15:44 AM
Message: This is an invalid script resource request.
Source: System.Web.Extensions
Current user:
Machine name:
Url: /scriptresource.axd?d=rzsailquovtn1gupn7lfyny_bhio2nj8tgy4dwkr0uuaukzqdcixysplfikqza-dmbls44_vx55vergdorhsel9awk9bjsu1xwzotjbvmdkbubpnz9loy4kwwev6dh-xewiv5kfbukzcsxcy-ebgmwowfq41&t=5c2f384e

Exception details: System.Web.HttpException: This is an invalid script resource request. at System.Web.Handlers.ScriptResourceHandler.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Date: 10/25/2010 3:15:45 AM
Message: This is an invalid webresource request.
Source: System.Web
Current user:
Machine name:
Url: /webresource.axd?d=tinq

invalid character whil running the open xml script

hi i am facing problem while running the following sql statement

 SET NOCOUNT ON DECLARE @hDoc INT EXEC sp_xml_preparedocument @hDoc OUTPUT, '<NewDataSet> <Forms Layout=''&lt;StackPanel Background=&quot;#FFFFFFFF&quot; Name=&quot;StackPanelUser&quot; Width=&quot;1001&quot; Height=&quot;600&quot; Margin=&quot;10,5,10,5&quot; HorizontalAlignment=&quot;Center&quot; ClipToBounds=&quot;True&quot; twcdd:RadDragAndDropManager.AllowDrop=&quot;True&quot; xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot; xmlns:iedf=&quot;clr-namespace:Iris.Ews.Designer.Form;assembly=Iris.Ews.Designer.Form&quot; xmlns:twcdd=&quot;clr-namespace:Telerik.Windows.Controls.DragDrop;assembly=Telerik.Windows.Controls&quot;&gt;&#xD;&#xA; &lt;ScrollViewer HorizontalScrollBarVisibility=&quot;Auto&quot; VerticalScrollBarVisibilit

Invalid column name 'difference'


Here is my code:

else if (str == "View Portfolio")
string url;

this.GridView2.Visible = true;
String usr = Membership.GetUser(false).ToString();
int x,count=0;
float total_value,t_c,c_t,d=0,c=0;
string[,] cmp = new string[30,2];
DbDataReader reader1;

DbProviderFactory dbproviderfactory = DbProviderFactories.GetFactory("System.Data.SqlClient");
using (DbConnection conn = dbproviderfactory.CreateConnection())
string s = ConfigurationManager.ConnectionStrings["Project_FinanceConnectionString"].ConnectionString;

conn.ConnectionString = s;


DbCommand cmd = conn.CreateCommand();
DbCommand cmd1 = conn.CreateCommand();

cmd.CommandText = "SELECT Company,Num FROM investment WHERE username=@Uname";
SqlParameter Uname = new SqlParameter("@Uname", SqlDbType.NVarChar, 256);
Uname.Value = usr;

otput column in script transformation editor



Using script transformation editor I'm trying to generate an output column to use it again in the data flow, I can create it using the editor but when I'm going to use it to store data (string type) in C# code I only find a Buffer type object. Can you please help me with this?




How to validate the value of date columns and use its value in the Calculated column



I am using SharePoint 2010. I have 3 columns in the list:
1) Start date
2) End date
3) Description

I have 3 following scenarios:

·         Some records have value of only Start date and "Description"

·         Some records have value of only End Date and "Description"


Tooltip for GridView Column Headers (ASP.Net)

I just wanted to add auto tooltips for my GridView headers. There are couple of ways but I don't want to use javascript and wanted to use simple 'title' attribute. It took couple of hours to get the working code supporting sortable columns. I thought it will be very useful for others. Here's the code and logic behind it.

Multiple Column Dropdownlist for the ASP.NET DataGrid

Based on my previous control "Multiple Column DropDownList for ASP.NET", I received many emails asking for the same control to be used in the DataGrid for web applications. Here we go.. This control can be used as the regular MS DropDownList in the DataGrid and also as a regular dropdownlist. It has all the properties, like DataTextField, DataValueField, DataSource, SelectedIndex etc. The download file contains the samples both in VB.NET and C#. In this sample, I have used the Northwind database of SQL Server.

JQuery Validate plugin to validate a ASP.NET Form

The first time I used the JQuery Validate plugin, it did not work at all, see JQuery Validate odd behaviour with the ASP.NET Script Manager for reason, but perseverance and stubbornness prevailed and I finally created my first JQuery validated ASP.NET Forms contact form.
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