I have a requirement to turn a table into XML with counts for values.
e.g.
Table
Id , Type, AnotherType
1, This, Widget
2, This, Fimble
3, That, Widget
I want the output something like this. This needs to be dynamic so new columns or facets added would generate the this type of output.
<matrix name="Type">
<facet name = "this" co...
Since the answers did not really cover the problem, I posted this on ASP.Net and completly rephrased it. I will post the edited question here:
I have been using the attachDB connection string and I usually deploy to IIS. The site works fine, however, I made some changes to the database and the newest version would not copy as it said ...
I have a WebTrends ODBC source on server1 and a SQL Server 2005 on server2. I want to connect to this ODBC from SQL Server on server2. So far, I managed to connect to this ODBC from SQL Server which is on same server, using following definition for linked server:
EXEC sp_addlinkedserver
@server = N'WT_ODBC',
@provider=N'MSDASQL',
@da...
i need to generate my sql server 2005 database for testing a multithreaded application. it must be morre than 3 gb at least, what should i do
...
I want to run set of different commands on different tables in parallel and in a transactional way, how can I do that?
More details:
I want all the commands to be distributed over threads but in a single transaction, so if all the threads succeed I'll commit else rollback.
...
How do you convert a Unicode Integer into a Unicode Character in SQL Server 2005.
For example, SELECT UNICODE('$') returns 36.
I am looking for a function that takes 36 and returns '$'.
...
Hi
I'm building a stored procedure which is rather stretching my experience. With the help of people who responded to this thread http://stackoverflow.com/questions/1863527/nested-if-statements-in-mssql-stored-procedure-select-statement I think I'm most of the way there :)
In short, the SP takes a series of paramterised inputs to dynam...
I want to convert a table storing in Name-Value pair data to relational form in SQL Server 2008.
Source table
Strings
ID Type String
100 1 John
100 2 Milton
101 1 Johny
101 2 Gaddar
Target required
Customers
ID FirstName LastName
100 John Milton
101 Johny Gaddar
I am following the strategy given below,
Populate the Customer t...
I'm looking for the easiest way to view what users are logging into my database. We have some old user accounts that might not be getting used anymore. Instead of just turning them off and seeing who complains, I thought there might be some way to monitor who logs in and runs some type of query over the next month or so. What would be th...
For some reason I cannot get my results set to restrict products that only have the price status of "normal'. When I use a where clause like where pricestatus like 'normal' the results set also filters other records. Any ideas here?
SELECT
od.order_id,
ISNULL(p.pricestatus,'normal') as pricestatus,
ISNULL(od.partnumber,'un...
I need a .NET tool, preferably a library, that I can use in SSIS to convert Northing/Easting information from Collins Bartholomew (bartholomewmaps.com) into WGS84 with a ssrid of 4326 - to be used in SQL Server (Geography).
Edit: In response to an answer given, the script looks interesting; do you think it would be easy to create a c# c...
I'm running SQL Server 2008, and trying to run some queries on some poorly stored data that I'd rather not go through and try to clean up (millions of rows to deal with). What I have is a log table with some FK data as a comma-separated string in one table, and an integer PK in another table. I'd like to be able to join the FK list of in...
Following on from a previous question, I'm trying to clean up some data where IDs are stored as a comma-separated list of values. I need to have these broken out into separate rows. I have what a query that works, but is rather slow. Do you have any ideas that would faster than what I'm doing?
SET NOCOUNT OFF
DECLARE @Conversion TABLE
(...
I have an existing ASP.Net MVC project that is using entities / repositories in a separate project. I need to add reporting functionality to this project via SSRS and I'm wondering what the best way is to handle data access for it.
As I have migrator.net and a repository data layer implemented I feel that using the database directly and...
Given an email address column, I need to find the position of the @ sign for substringing.
What is the indexof function, for strings in t-sql.
Looking for something that returns the position of a substring within a string.
in c#
var s = "abcde";
s.IndexOf('c'); // yields 2
...
What are the differences in database terminology between MsSQL and MySQL?
Can a mysql instance have more than one database? It appears that it can only create different schemas.. However the sql command is "create database".
In MsSQL you can create multiple databases.. each have a default schema of dbo?.. but multiple schemas in a data...
Possible Duplicate:
T-SQL WHERE col IN ()
What is the maximum size for a SQL Server query? (# of characters)
Max size for an IN clause? I think I saw something about Oracle having a 1000 item limit but you could get around this with ANDing 2 INs together. Similar issue in SQL Server?
UPDATE
So what would be the best approach i...
My client is using Advantage Database Server and wants to move to SQL Server but obviously wants to move all his clients data as part of the upgrade over to SQL Server.
I've thought about writing an app to do the transfer but thinking it might be more trouble than its worth.
What would you recommend?
...
If a DataSet contains a column that is a timestamp or other binary value, its associated DataGridView throws an ArgumentException, when displaying any data in that column. That is, assume you have some table containing a binary column such as:
CREATE TABLE [dbo].[DataTest](
[IdStuff] INT IDENTITY(1,1) NOT NULL,
[ProblemColumn] T...
I'm dealing with some really pain in the ass servers, and I'd like them to just use transactions without DTC (for now so I can concentrate elsewhere). I use multiple databases within the scope, so the typical behavior is to promote, but I want to avoid it. What would the behavior be of an in-doubt transaction under this model, if it's ...