.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

MSSQL 2008 xml field CDATA content

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :Sql Server

How is it possible to store xml (untyped) content with CDATA tags ito a xml field without automatic removing of the CDATA tag?
At the moment I need a second field varchar(max) to store the real xml contet and I use the xml field for xQuery searches.

But there is a problem is characters like '<' in the node text will be replaced with escaped characters! - for other processes I need the real stored content!
To use a xml schema is not possible because the xml structure can be variable - I need untyped xml.

Any sugestions welcome

Thanks for your response

View Complete Post

More Related Resource Links

MSSQL 2008 R2: Change Server Collation Steps, with user DBs already of desired collation

On the default instance of SQL Server 2008 R2, I want to change the server collation from the usual US default SQL_Latin1_General_CP1_CI_AS to an application vendor's required collation, Latin1_General_BIN.  I understand that changing the server collation is essentially the same as changing the collation of databases master and model -- is that a fair statement? But my main question is, since there are user databases on the server that I would like to preserve, can I not simply detatch the user DBs prior to performing the server collation change, and then reattach?  The database collation of the user databases is already set to Latin1_General_BIN.  This article, Setting and Changing the Server Collation, at http://msdn.microsoft.com/en-us/library/ms179254.aspx says that to preserve the user databases, I should script all DB objects out, and bulk-copy all data out, because the DBs will have to be recreated and repopulated.  Can someone explain why I ought not simply detach and reattach the user DBs, given that they are already of the desired collation (i.e., the same collation that I will be changing the server collation to)? Your help much appreciated. -Tom

Extended stored procs on 64 bit MSSQL 2008

We need to develop some extended stored procedures for 64-bit SQL Server 2008. We have written the DLL in Visual C++ but when we try to register it with the database, we see the following error: [Microsoft][ODBC SQL Server Driver][SQL Server]Could not load the DLL c:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn\xp_test.dll, or one of the DLLs it references. Reason: 193(failed to retrieve text for this error. Reason: 15105).(42000,17750) Procedure(xp_test) Can anyone please tell me if you have come across such an issue and how it was successfully resolved? 

VS 2010 MSSql 2008, ASP.net and Win 7

What is all the confusion about this combination of software?  Thsi appears to be the latest versions and one would think that it would also be the most up to date versions to use with the latest OS.  But I cannot find out where to learn how to use the tools because there does not appear to be any lessons oor tutorials free or paid that provide the latest releases of these tools.  I cannot get a demonstration of installation or a how to use that matches what I have on my system.  This just does not make any sense for this to be this obtuse.  I started out trying to learn ASP.NET and I have found myself in a quaqmire of installation issues operation issues,  warinings etc and yet no definitive tool for learining how to use the latest versions.  Can some one tell me where to go I do not mind paying for a tutorial or course that will get me aquainted with the technology.  AS it is I become more confused at each corner.  I can see  why many people just go with PHP and MYSQL with WAMP SERVER or XAMP.  This is border line ridiculous is this the future of this " powerful technology"?Hoping for the best, MIKE E

Easy install package vs MsSQL server 2008

Is there anything i wont be able to do if i use SQL Server Express Database from the downlod install package offered on asp.net? Ive used MSSQL server 2008 and 2005, but to be honest i think it might be overkill cause im not very familiar with those applications. I just need the database for creating websites. Will i be able to remote connect to my webbhotel host and remotely modify the database on the remote server?Now i have a mess, i have installed both MsSQL 2005 and 2008 and im not even sure wich database is created with what. I would love to just have one simple setup, but im not sure if i can manage to migrate the databases to the new computer with this easy install package.The easy install package contains: ASP.NET and ASP.NET MVC Visual Studio 2010 Express Development Tool SQL Server Express DatabaseThanks for your time!

SSRS 2008 R2 Dataset Field Value Property Data Type not numeric

We're building SSRS 2008 R2 reports using SSAS as data sources.  There are several occaissions where the data types of certain dataset field values that represent cube measures are not numeric.  As such, when these fields are used in an aggregate function they throw an error.  Is there a way to remedy this in the dataset? Thanks for your help.

MSSQL Server 2008 Workgroups install to Win 7 - Compatibility issues

I attempted to install MSSQL Server 2008 Workgroups from the DVD to a Win 7 workstation.  Error "This Program has known compatibility issues.  The directions are to download the MSSQL Server Service Pack.  I downloaded SP 1 and SP 2.  Neither SP will install.  The DVD install also has a run option displayed along with the Compatibility message.  I select "Run" and it appeared to install, with Start\Programs\Microsoft SQL Server 2008\Configuration Tools\ SQL Server Installation Center 64bit.  However, running the 64bit installation process results in no change.  My question is how to install the MSSQL Server 2008 Workgroups on the Win 7 machine.  I would appreciate your thoughts.

MSSQL 2008 R2 - database in restoring mode after backup - forever..

Hi folks,   i have this problem that occourred today with one instance of MSSQL 2008 R2 running on a WIN x64 R2 enterprise server.   i have run a backup maintainance job and now i have two databases in restoring mode for over 4hrs.   my questions are: why are these databases restoring when i was backing up? and why are they not being logged anywhere - i can not find anything on logs, activty monitor, or even Windows Resource Monitor.   i can not see any work been done by MSSQL to restore these databases, and yet they are set as 'RESTORING'.   any suggestion from the community here will be much appreciated as i am banging my head against the wall already.   thanks,   Nicolas    data warehouse | data migration | ETL/ELT | UK | http://www.brainpowered.net

MSSQL Server 2008 Workgroups install to Win 7 - Compatibility issues

The DVD install for MSSQL Server 2008 Workgroups to Win 7 fails due to known compatibility issues.  I asked for help in the Getting Started with SQL Server Forum and followed a recommendation to slipstream installation with SP1. I followed the procedures at http://blogs.msdn.com/b/joaol/archive/2009/03/20/how-to-install-sql-server-2008-with-sp1-built-in-slipstream-installation.aspx I then ran Setup.exe from the C:\SQLServer2008 folder.  It failed with the following .Net Framework error.  (I previously installed .Net Framework Version 4 which is required by the application needing SQL Server.)  Thanks for help. Microsoft.NET Framework Unhandled exception has occurred in your application.  If you click Continue, the application will ignore this error and attempt to continue.  If you click Quit, the application will close immediately. An error occurred creating the configuration section handler for userSettings/Microsoft.SqlServer.Configuration.LandingPage.Properties.Settings: Could not load file or assembly 'System. Version= PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified. (C:\users\PC User\AppData\Local\Microsoft_Corporation\LandingPage.exe_StrongName_ryspccglaxmt4nhllj5z3thcltsvyyx\\user.config line 5). Details... See the end of this message for details o

Is there any way to populate an InfoPath form field with the data from the site content type column?


I have a Form library with a form template.

The templat has a field "Office name" which should not be a fixed list of values, but a dynamical list, feeded from a different type of form. I'm a novice with InfoPath - Sharepoint and I want to find out, how can I can give users a possibility to create and maintain a list of offices and also have this list as a selection list inside main library form - ALL inside one library, if possible.

I assumed that if I publish main form (Itinerary) as a library template form and lookup form (OfficeInfo) as a SiteContent, I should be able somehow to connect to siteContent column and it's information. But I cannot see how - Site Content Gallery is not appering as a Connection item.

Can I use SiteConenct for this purpose or there are other ways to create end-user lookup lists?

Thank you!


How to use Page/Content Field data in a Navigation - how to include images in a navigation?



I look for a hint on how to accomplish the following:

I create a Internet-type of Site based on the Publishing Infrastructure/Features. The site is structured by subsites that are all based on same Masterpages and PageLayouts. In the PageLayouts there are the common fields like Title, Page Content, Page Image. And exactly the last one "Page Image" should appear in the navigation.

Searching the web pointed me to creating a custom PortalSiteMapProvider. In the GetChildNodes I figured out how to get the actual Url to the "Page Image" of a Node in the Sitemap. 

But here I'm stuck. How to I get this information (the image url) delivered to a menu control to actually draw an img src=...?The build-in Nodes don't seem to support such an additional property. And the build-in menu controls (asp:menu, sharepoint:aspmenu) neither.

What do I need to create to make use of the ImageUrl? A custom Web part? or ... ?

Any hints welcome


Thank you


Long time WinXP user, skipped Vista and starting to like 7

Concatenating several rows data into one field Visual Studio 2008


Below is my a example of my table and data.  I am using Visual Studio 2008.  I need to concatenate field customer_report with like field ‘number’.  I added a new SQLDataSource and put the query below into it.


Select Main.number,

       Left(Main.CustomerNotes,Len(Main.CustomerNotes)-1) As "CustomerNotes"

From(Select distinct PS2.number, 

           (Select PS1.customer_report + ',' AS [text()]

MSSQL SERVER 2008 installation Error


Hi all,

At the time of installation of SQL SERVER 2008 R2 (work group edition) on windows server 2003 standard editon the below error message was displayed.

TITLE: Microsoft SQL Server 2008 R2 Setup

The following error has occurred:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)

Click 'Retry' to retry the failed action, or click 'Cancel' to cancel this action and continue setup.

For help, click: http://go.microsoft.com/fwlink?LinkID=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=10.50.1600.1&EvtType=0xBA6E21AA%25400x9A41B222



in event viewer i saw

".NET Runtime Optimization Service (clr_optimiz

Content Query Webpart to show edit item link field in SPS2010


I have a Content Query Webpart in SharePoint 2010 that I would like to surface Documents grouped by content type. I wish to show the edit form or view Properties link as part of the fields shown in the results. When the User clicks on this link, it should take him to the edit form or view Properties page for the document.

Any ideas?

Restoring a Content Database to an earlier MSSQL backup?

We'd like to roll back a content database to an earlier point in time. Is this doable by just shutting down the frontend, and then restoring the MSSQL WSS_Content database, or are there some quirks that we need to take into account?

Create View in an External List that Gets a Field from Another External Content Type via Foreign Key


I currently have two tables in a SQL Server 2k8 database: Locations and Customers

The fields in the Locations table are:

  • LocationName
  • StreetAddress
  • City
  • State
  • ZIP
  • CusotmerID (foreign key joined to Customers table)

The fields in the Customers table are:

  • ID (primary key)
  • CustomerName
  • CurrentBalance

Through SharePoint Designer, I have both tables set up as External Content Types of the same names as the tables and have created External Lists for each External Content Type. All CRUD operations are working perfectly. I added the proper Assocaiation and I've set CustomerName to be the Title of the Customers External Content Type. I can currently use a picker for CustomerID in the Locations List and CustomerName is displayed properly. Also, the default DispForm also correctly displays the CustomerName for any single Location record.

However, I would like to modify the default ReadList so the foreign key (CustomerID) will show the Title field of Customers (CustomerName). However, I am running into trouble finding out how to do this.

Any help with this issue would be greatly appreciated!!


MSSQL 2008 SP1 install fails: A failure was detected for a previous installation, patch, or repair

When attempting to install SQL Server 2008 SP1, I get the "Setup Failure" message below, along with Error code 0x84B20001.  I did read the summary*.txt files from previous installations in "C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log" as mentioned in the error message; the "Final result" and "Exit message" of the previous install is "Passed", so I'm not finding an answer that way.  I have also pasted the version info below.  What would you advise?

A failure was detected for a previous installation, patch, or repair during configuration for features [SQL_DTS_Full,Connectivity_Full,SQL_SSMS_Full,SDK_Full,Tools_Legacy_Full,SQL_BIDS_Full,SQL_SSMS_Adv,SQL_PowerShell_Tools_ANS,SQL_WRITER,]. In order to apply this patch package (KB968369), you must resolve any issues with the previous operation that failed. View the summary.txt log to determine why the previous operation failed.

Microsoft SQL

Is it possible to save "Collections" to a single varbinary(MAX) field/column in a SQL Server 2008 da


I was thinking about the fastest way to retrieve a "set" of objects related to a specific user. For instance, if I was to create a website similar to Flickr where people upload lots and lots of photos(jpegs) what would be the fastest way to be able to retrieve those photos from the SQL Server database. Scenario 1: You store metadata about each file they upload to the website as a single row in a database table. Then when you want to retrieve a specific users uploaded files you simply scan the database file for every row matching the UserID and store them in memory.

SELECT PictureId, UserId, PathToFile, Caption, (etc.)

FROM Photos

WHERE UserId=@UserId

This, of course, gets all the information about all the photos a single user has uploaded. My concern with this approach is when the user activity goes from a few thousand to being in excess of a million.

This approach seems fine for a small website but does this method work for a million plus user website like Flicker or MySpace? When you have a million users and millions more photos does this approach still perform at acceptable speeds?

My idea was to actually attempt to create a collection in memory of "ALL" the PictureIds' for a single user and store them in-memory, in a collection and then save this collection as a single VARBINARY(MAX) field in the SQL

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