.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

Drop extended property "MS_Description" of ALL tables and ALL columns

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :Sql Server

Is there an easy way (a sql script) to drop the "MS_Description" of all tables and all columns in my database?


View Complete Post

More Related Resource Links

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.

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

Two Columns of Floating Tables Only Allowing Next Two Tables to start together.

Hi,I am styling a form I have created. I have created a number of tables and I am trying to position them with CSS. However, for some reason each to the two tables are positioned together. So lets say the 1st table on the left is shorter than the table on the right. Then on the second row of tables they both start at the end of the table on the right. I just don't know where I am going wrong. There is no clear command or anything. Any help would be really appreciated. Thanks in advance,      Seamus

Dynamically Drop and Create tables, overcoming 4000 charachter limit

We have a Navision SQL-server database for 7 companies. Each table starts with the name of the company. Except for the CompanyName-part, the tables names are equal. I made a Foreach loop that dynamically transfers tables/data from the the Navision-database to a staging-database. I also want to Drop and re-Create the tables dynamically. However, if I try to do that via an expression in a SQL Task, SSIS complains about the 4000 character limit. What is a better way to do this? I want to execute SQL-commands and have SSIS replace part of the tablename with the contents of a variable (being the name of one the 7 companies). I have no access to the Management Studio or the DB so I need it to be done within the package. What is the best way to do that?


Sorry my terrible english,   I will try to explain my problem, I made some data changes at the publisher and I had to throw away the PK and FK cascading multiple tables. The problem I have is that these changes were trying to apply to the subscribers and can not do because it does not in order which I did step by step through the Publisher. subscribers now show me this error and does not synchronize anything, and takes 0.5 sec and gives the error infinitely I need help, which infinitely grateful Error messages: The schema script ' if exists (select * from sysconstraints where constid = object_id(N'[FinancieroAbonos_PK]')) if object_id(N'[dbo].[FinancieroAbonos]') is not null exec('ALTER TABLE [dbo].[FinancieroAbonos] DROP CONSTRAINT [FinancieroAbonos_PK] ')' could not be propagated to the subscriber. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147201001) Get help: http://help/MSSQL_REPL-2147201001 The constraint 'FinancieroAbonos_PK' is being referenced by table 'FinancieroAbonosContabilizacion', foreign key constraint 'FinancieroAbonos_FinancieroAbonosContabilizacion_FK1'. (Source: MSSQLServer, Error number: 3725) Get help: http://help/3725 Could not drop constraint. See previous errors. (Source: MSSQLServer, Error number: 3727)

Discovering ODBC Tables, Columns and column Definitions

I have worked with ODBC data connections for a while.  Usually, I've setup a connection to some type of database (IBM ISeries, SQL Server, Progress, etc.) depending on the project and then I use MS Access to inspect or export the data using linked tables. I have a database that has numerous tables and columns.  In fact, I believe there are some 16k data columns in the entire database.  Furthermore, I have an excel file that gives me a list of all of these tables and a brief description of each column  but it does not have useful data types in the description.  What I would like to do is query the ODBC source and extract each table, it's columns and it's column data types. My end goal is to take the data from the spread sheet (column names and description) and insert that data into a database that also contains the correct, SQL data type in an additional field.  Is there a way to query an ODBC data source to acquire all of this information?


TABLE 1SELECT I.STUNA    ,S.SNO         ,SUM(B.AMT * Y.YEAR) AS AMT  FROM STUDENT S  LEFT JOIN INFO I ON S.SNO = I.SNO  LEFT JOIN BONUS B ON S.SNO = B.SSNO  LEFT JOIN YEAR  Y ON S.SNO = Y.SSNO  STUNA       SNO      AMTJOHN         A        10LISA         B        20ALLEN        C       100TABLE 2SNO   AMTA     1B     2C     3D     5I WANT TO HAVE RESULT LIKE THIS (TABLE1 + TABLE2)STUNA       SNO      AMTJOHN         A        11LISA         B        22ALLEN        C       103EDDIE        D         5I TRIED USE THIS QEURY SELECT I.STUNA    ,S.SNO         ,SUM(B

Search a word in all the tables(all columns) of a database

Dear Friends, I am developing the Home page of a Client. Apart from various things on this home page I have a text box and search button.Having said that, I have a database in which I have almost 12 tables with varying number of columns.Now my question is,Is there anyway to search a word typed by a user in the textbox to search it in all the tables(all columns) of the database.A simple,concise and easy to follow solution would be a great help.

problem seems to be related to grouping by on columns with the same name in different tables


using OLEDB provider IBMDADB2.1

and the following SQL run from ReportBuilder


sect.name as Team,

tasktype.name as TaskType,










The SQL runs fine in a DB2 query tool but when run through ReportBuilder I get

[DB2/LINUXX8664] SQL0119N  An expression starting with "TASKTYPE" specified in a SELECT clause, HAVING clause, or ORDER BY clause is not specified in the GROUP BY clause or it is in a SELECT clause, HAVING clause, or ORDER BY clause with a column function and no GROUP BY clause is specified.  SQLSTATE=42803


Basically the problem seems to be related to grouping by on columns with the same name in different tables.

Anyone know a work around?

Drop tables by date it were created



I have a large database that were used to archive tables before implementing structural change on it.

We had this database for years, I want to create a dynamic script to check today's date and drop any table in this database that were created 3 years or older.


Regarding tables and columns


Dear All,

What would you all suggest a database with

less number of tables and more number of columns

more number of tables with less number of columns.

I am developing a web application using Visual stuio 2005 and Sql Server 2005

Thanks in Advance,

Extended Property for Instances

I want to add some blurb for an instance such that I could write some T-SQL to bring the blurb back. For example - " The purpose of this instance is to blah..."

Is there a way to do this similar to using sp_addextendedproperty for DBs?


Drop tables where table name is a parameter


I'm trying to drop some tables and I created a curser to do so.

The table name is a parameter.

I get an error message when I run this code in the curser.

Is there any way to run this code in a different way.

I'm trying to drop databases as well where database name is a paramerter, can I do so?





@DatabaseName varchar(30)




Getting list of tables with Identity Columns



I'm new to SQL Server, could somebody help me with the query for

Getting the list of tables with indentity columns i.e to check the key info in the system tables along with column data types.

Thanks in Advance


not using tables: how do i align two columns, with textboxes, labels, dropdownlists, radiobuttonlis


problems with my CSS:


the Address (line 2) textbox ,City textbox, State dropdownlist and Zipcode textbox are vertically cramped (not equally spaced apart). 

the City label, State Label, and Zipcode labes are not horizontally aligned.

the Contact Type label and the Email Address label are not horizontall aligned. 



<asp:TabPanel ID="tpAdd" runat="server" HeaderText="Add" >
                <div id="wrapper">
		<div id="content">

			<div id="left">

				<!-- 	use a container to avoid using padding and border on #left
						which causes cross-browser inconsistencies with width -->
				<div class="left-container"><br />
                <p style="margin-left: 40px">
                    <asp:Label ID="lblFirstName" runat="server" Text="First Name:"></asp:Label>
                    <asp:TextBox ID="tbFirstName" runat="server" CssClass="txtbox"></asp:TextBox>
                    <br />
                    <asp:Label ID="lblLastName" runat="server" T

comparing two database tables to all find matching columns



is there any query to find matching columns from two database tables(not system tables).




Thanks and regards, Rishabh

Unable to access custom extended property


When I try to access the .ExtendedProperties["RequestChangeRequired"].ToString() in the onTaskChanged_Invoked method on a workflow I get the error:  "Object Not Set To Instance of an Object".

I have a custom content type on a task list in a custom workflow.  I want to set my Task to either Approved, Major Change or Minor Change.  So i have 3 buttons on the .aspx page for the content type when the users edit the task.  If they click the Minor button the following code is executed:

public void BtnMinor_Click(object sender, EventArgs e)
            Hashtable taskHash = new Hashtable();
            taskHash["RequestReviewerComment"] = RequestReviewerComment.Text;
            taskHash["RequestApproved"] = "false";
            taskHash["RequestChangeRequired"] = "minor";
            taskHash["Approved"] = "false";
            taskHash["Status"] = "complete";
            SPWorkflowTask.AlterTask(m_task, taskHash, true);

            SPUtility.Redirect(List.DefaultViewUrl, SPRedirectFlags.UseSource, HttpContext.Current);

Then in my onTaskChanged_Invoked method the following code is executed but it fals when it tries to access the "RequestChangeRequired
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