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

Post New Web Links

Updating all the columns even the ones with no change, good or bad?

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :

I am writing my Stored Procedure to update any rows that have changed, by default all the variables in the SP are set to NULL, so what I am doing is..


	UPDATE Table1
	SET FirstName = ISNULL(@FirstName , FirstName )
		, LastName = ISNULL(@LastName , LastName )
		, PhoneNumber = ISNULL(@PhoneNumber , PhoneNumber )
	WHERE TableID = @TableID 


So basically if the user didn't pass in the variables they will be NULL and they will be updated to the same value.


Is this a bad practice? this query will be running constantly to update different values.

View Complete Post

More Related Resource Links

How to change text in columns in SSRS?


I need to create a complex report and export it to Excel. 

In the first column header, text is displayed as "Hide Daily Columns", but I need the text to change as "Unhide Daily columns" when I click on it and when the text changes the columns under "daily" header (I have 3 columns under this header) present in the report shud be hidden and only weekly columns shud be visible. Any ideas please. I am new to SSRS and tried out many ways but didn't get it.

DataGridView>Edit Columns> Column Read Only property is unwilling to change

Hello, I am facing the following mystery: When changing the read only property of a column to false and reopening the "edit columns" window, it mysteriously turns back to true. Even when closing the designer and changing it in the designer code, the resulting execution does not allow edit, as well as when re-opening the designer you see true again.             this.numberDataGridViewTextBoxColumn1.DataPropertyName = "Number";             this.numberDataGridViewTextBoxColumn1.HeaderText = "Number";             this.numberDataGridViewTextBoxColumn1.Name = "numberDataGridViewTextBoxColumn1";             this.numberDataGridViewTextBoxColumn1.ReadOnly = true;//False is required We thought it might be related to data binding. rebinding the grid did not help as well. The is no other place in the code where it changes. Please advice, Thanks

How to change the size (width) of scorecard columns in Dashboard Designer?

Is there any way to change the size (width) of scorecard columns in Dashboard Designer?

Change order of columns in a list


Hi there

I'm looking for a way to change the order of the colums in a list in SharePoint 2010. I only have access to SharePoint Designer 2010 for editing the site.

I already looked at the function to create custom views for lists. However this are only useful when viewing the list as a whole, however when you edit an existing, or create a new entry you will see

  • first: the columns in the order in which they were created.
  • and second: all of the columns. i cant find a way to make certain columns invisible for the user.
I already looked through the functions that are given to me by SharePoint Designer 2010 when editing the columns of a list and I also checked for a way to change the order of the columns when surfing the actual website with Internet Explorer.

Does anyone know how to do this? Or am I just trying to find a function that doesn't make sense because it's covered by another feature?

Thanks for your help!

Updating the site columns failed


Hi all

When I try to publish an InfoPath form to a site content type I get this message "Updating the site columns failed".
I have not managed to find out why it does that. Any one that has had success with it, or got any smart tips? :)


How to change the first column of auto-generated columns of a gridview.


Hi, I have a gridview which makes use of a datasource. The columns are auto-generated.

Right now, my task is to make the first column into a url column. Does anybody know how to do it?


Does TDS transfer all columns of every row? Even if they don't change?



Does SQL Server Tabular Data Stream transfer all values of every row, even the values that don't change?  I read the spec a while ago and it appears the answer is "yes."

It seems like that would be an extreme bandwidth optimization and make possible a lot more flexible queries: SQL could detect that I did a join of a parent and child table, returned repeated rows of the parent for each child, but only pass the parent "once":


--p.* values are only shipped once -> saves bandwidth

Currently, I do separate queries for parent and child, which can result in an expensive repeated WHERE clause being executed twice or necessitate saving parent ids in a table variable...


Adding columns to existing content types - not updating

We deployed site columns and content types through xml definitions in features. When we update the content types by adding a new column, new columns do appear in SharePoint Designer 2010 but when pages are created from those page layouts, columns are not visible.

We see this in 2007 and found some solutions but these are code-base. Any alternative that guide us to make changes in the XML or any other file?

Same issue for 2007: 


updating multiple rows for multiple columns of the table from other table



I have source table called customer. And data from this table is transfered to another database  with same table name.

that is database1(customer table) ----> database 2(customer table)

now in database 2, First time my program runs and it randomly get any name and ssn and then updates the first name, last name, ssn of all the customer_ID's in the customer table (I use RAND function)

Now second when i run the program, it recreates the name and ssn again but different, for the same customer_id.

So i want that once the particular customer_ID is updated, next time if i run the program. it shold not update the those updated customer id's

Thanks, Any help is appreciated.


is it possible to change a document name dynamically when inserting and updating - Doc lib is in WSS


If i'm not wrong a document name is unique to each doc library. What i want to do is use some fields the users select to make up a document name.e.g docname_Created I'm sure i can do this via Object Model but can i use a SPD workflow for this? Any ideas would be appreciated

How to change value in columns with same name in multiple tables


For a uncomplicated example, our database has 10 tables.  Each table contains the column COMPANY.  I need to change company from 1 to 4, and I don't want to have to update each table individually (because the number of tables is actually closer to 800).


COMPANY being a primary key isn't an issue. 


Is there a painless way to update the COMPANY field in all user defined tables?

sharepoint Duplicate Site columns and updating content type failed when publishing to sharepoint


1many duplicate columns in my library

we can see image here:

2run  sql :

select * from AllUserData 
where  tp_LeafName = 'xxxx.xml' and tpid='1123' 
and tp_DeleteTransactionid = 0x 

should find only one row,but then can find 7 rows:

row1                    0
row2                    1
row3                    3
row4                    4
row5                    6
row6               &

Change Columns to be represented in calendar View




I have created a global calendar that takes events from my subsite calendar. It works great, the only problem is that I cannot change the default Title column in Month View Title, don't know what code to use. I know I should create a content Type to hold my custom column, so I'm using the same columns in all my subsites, I want to change Title as the column in "Month View Title", "Week View Title", "Week View Sub Heading", "Day View Title" and "Day View Sub Heading". I will continue my search but if anyone knows I'll be glad to get some help. Thanks.

Updating Data-Tier Application project after schema change has been made in SSMS

I have successfully created a Data-Tier Application project within visual studio. How do I update these scripts to reflect the changes made by a DBA in SSMS?  Also, on another project we use Entity Framework which drops and recreates the database from within the application. I would also like to import these changes into the Data-Tier Application project.
I can figure out how to import the database into the project the very first time. But after a change has been made using another tool, how do I synchronize the project in visual studio?
When I create a schema comparison that points from database -> project, it correctly analyzes the schema changes. Am I missing how to update the project with these changes?
Thanks, I really would like a solution to this so I can use Data-Tier Applications instead of a third party tool.

How to change alternative color in asp.net gridview rows and columns?

In this article, I will show you how to set alternative color for gridview rows and columns in asp.net.

MS SQL Server: Search All Tables, Columns & Rows For Data or Keyword Query

If you need to search your entire database for specific data, this query will come in handy.

So when a client needs a custom report or some sort of custom development using Great Plains, most of the time I will have to track down the data in the system by running this query and find the table(s) it is in.

Adding Multiple Columns and Rows in GridView without using a Database

This article describes on how to add multiple columns and rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in each TextBoxes on Button Click and retain the GridView data on post back.
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