Profiling and output caching in ASP.NET MVC

So I was recently hired by a big department of a Fortune 50 company, straight out of college. I’ll be supporting a brand new ASP.NET MVC app – over a million lines of code written by contractors over 4 years. The system works great with up to 3 or 4 simultaneous requests, but becomes very […]

Read XML element from XML Column

I have a XML column in a table with values like <m lingua=”1″> <coloriVini> <i n=”8″ /> <i n=”2″ /> <i n=”3″ /> <i n=”4″ /> <i n=”5″ /> <i n=”6″ /> <i n=”7″ /> </coloriVini> </m> and I need to make a join with values from /m/coloriVini/i/@n with another table with will be displayed […]

Select Distinct From View

lets say that I have view that contains the following data Name Image —- ———- A Image1 A Image2 A Image3 B Image4 B Image5 Now what I want is to select only one row for each Name, doesn’t matter which I just want the result to be for example: Name Image —- ———- A […]

Cube Default Measure

If I execute the following MDX script SELECT FROM [CubeName] It returns an answer giving the total of all the members in for the default measure. Can I write an MDX statement that tells me what the default measure is or is it not possible to query meta-data with MDX?

Incrementing partial PK

I have a table: INSTRUCTIONS: RecipeID Step … RecipeID is generated by another system. There does not need to be an explicit foreign key relation for RecipeID. As I insert steps into Instructions for a particular recipe, I would like Step to increment. When adding steps to a new recipe step should be back at […]

Listing ALL users on a specific database

I would like to list all users on a specific database. When I use the sys.server_principals or sys.sysmembers system views it does not list all the users that appear under the Security -> Users list in the Object Browser in SQL Server Management Studio. Here is what I attempted: USE [Database_Name]; SELECT user_name([memberuid]) as [Username] […]

SQL update – merge data

Issue with a USER_DIM table in a database that has references to other tables in that database like USER_ACTIVITY_FACT via USER_ID. A problem arouse when the original design of the table did not use a proper unique identifier which actually comes from a different database’s EXTERNAL_ID. I can figure how to select the extra rows […]

Synchronizing two SQL Server Instances

I have two network segments and both are connected using the internet, say one as corporate server and another as remote production. I have an Intranet application running in both environments using the single SQL instance, everything works fine. But my production environment internet disconnects frequently, so my application unable to reach corporate SQL Instance […]

Extracting UID from ODBC Connection in MS Access

I have a MS Access front end with tables linked to SQL Server. I used a file DSN to link tables, and upon opening Access database the user has to enter SQL server userID and password. Is there a way to extract that userID (not the password) from the established ODBC connection, for example to […]

Replace values instead of varchar into boolean

I have different database tables, Database 1: Table 1: Id -001(int) Name -xxx(varchar) Male -0 (bit) Female-1 (bit) Database 2: Table 2: Id -1 (int) Ca.Name-yyy (varchar) Gender – M or F (varchar) These are my tables. I want to create insert query from database 2, then i execute to table 1. But I have […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.