sql-server

What is @ in Sqlparameter objName = new Sqlparameter ("@jobfolder", SqlDbType.Text)

What is @ in Sqlparameter objName = new Sqlparameter ("@jobfolder", SqlDbType.Text) ...

Sync Framework with SQL DB's: Getting Started

I have an app that uses SQL Enterprise to store all data in 4 different DB's. I needed to build in the ability to work "offline" for my users. I accomplished this through Merge Replication to local SQL Express installs for everyone. This "Works" but feels like the sledge hammer approach. For instance, I am replicating all 14000 peo...

Linking Oracle with SQL Server

I'm trying to link SQL Server 2005 to an Oracle 10g database. I've installed the Oracle client on the SQL server and validated that I can connect to the Oracle database using both tnsping and sqlplus. When I try to run a query in SQL Server I get the following: OLE DB provider "OraOLEDB.Oracle" for linked server "ORA_CSSA2APD" returne...

Best way to browse an mdf file from a local computer?

I'm working on an ASP.NET MVC site which will have a database. While I'm in this very early testing/concept phase I'm not hosting the database anywhere, just inside the local mdf file. What are some tools I can use to connect to the local test server so I can browse the tables and run test queries against the information in them without ...

How to find the shortest distance/ travel time between two airports?

The problem was created by me, discussed with my co-workers and no one seem to have an idea. Thus, thought, I can ask the experts here. I've the following table FlightInfo and the fields are Start Destination Flight_Duration The goal is to find out, the shortest flight between two cities. The challenge is not all cities have di...

Merge data object table with associated attributes table in a view

Here's the setup: I have several tables that hold information for data objects which have the potential to have various and sundry bits of data associated with them. Each of these tables has an associated attributes table, which holds 3 bits of information: the id (integer) of the row the attribute is associated with a short attribute...

How can I serialize entities from an ASP.NET MVC site to XML ?

I am working on an ASP.NET MVC (in c#) site which connects to a database and takes advantage of the entities framework. I'd like people to be able to modify the information in the database from the site (since it seems to me to be much easier to display and validate data via an ASP.NET MVC site than a Desktop app while being much easier ...

Why is SQL server not using my index? (Filtering over joined indexed views)

I have two indexed views, v_First and v_Second. These views work great when I have a WHERE clause that filters only based on one of these views, however as soon as I have filter criteria based on both views I get two clustered index scans and poor performance as a result. My query is: SELECT * FROM dbo.v_First (NOEXPAND) JOIN dbo.v_Se...

When to use recursive table

Hi All, I have a need to build a schema structure to support table of contents (so the level of sections / sub-sections could change for each book or document I add)...one of my first thoughts was that I could use a recursive table to handle that. I want to make sure that my structure is normalized, so I was trying to stay away from deo...

Convert datetime variable into string in SQL Server

Anyway I can convert a datetime variable into string in SQL Server? ...

Why am I getting a segmentation fault with the SQL Server ActiveRecord adapter?

isql runs just fine: kobey:/etc# isql -v censored censored censored +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | ...

Search Problem in SQL Server

I need to search in a table for items which have all of my desired values in a column i.e. I have table : ID : 1 2 3 3 2 2 2 1 1 3 VALUE : 5 6 5 3 6 7 2 1 9 0 I want to give a StoredProc a list of values for example ("6,7,2") and it returns me all IDs that have all the given values in this case it would only returns 2 If I wanted ...

How to add the column by default in sql server 2005

I have 2 tables called login and Roles. In the login table, I have these fields: CREATE TABLE [dbo].[login] ([Id] [int] IDENTITY(1,1) NOT NULL, [Uname] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [Pwd] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, CONSTRAINT [PK_login_1] PRIMARY KEY CLUSTERED([Unam...

Deployment .net 4.0 application

I intend to develop an application using .Net 4.0, and intend to use EF4 but I am little concerned with deployment of the application. My target audience will be small businesses and application domain will be related to routine accounting. There are several similar solutions already available in market and good thing about them is the...

Should we start with multiple small-grained databases for an app that may scale massively

We're developing a new eCommerce website and are using NHibernate for the first time. At present we are splitting our data into multiple SQL Server databases, divided per area of functionality. So we have one for UserInfo, one for Orders, one for ProductCatalogue and so on... Our justification for this decision is twofold really: th...

Convert sql subquery to list or varchar

Hi, I want to know if we can convert a subquery result to comma separated list in varchar datatype. For eg. If I have a product table. And I have product image table with foreign key of product. now I want to list all product with select query that should have a column with list of productImage table's pk list for each product. I'm us...

How to write a SQL to cascadingly accumulate rows of data?

I have a work plan in DB as follows. For instance, the first row means that Team A has 10 hours' work to do in June (SP1006). Team Sprint WorkHours A 1006 10 A 1007 20 A 1008 30 A 1009 40 B 1008 50 B 1009 60 B 1010 70 I want to derive it into the following form to show: at the end of each mo...

What is the Best way for database desktop application permission managing ?

Many desktop applications use SQL tables to manage their users permissions and roles. In fact they restrict access to some parts of application in their application code. It means they need a constant connection string to SQL server with maximum permissions. My target is C# 2010, Sql Server 2005 or 2008. What if with any reason someone...

Is it possible to connect to SQL server in iPhone?

Hi Friends, Is it possible to connect to SQL server in iPhone?. I want to create a new application and i want to retrieve the data from SQL Server and displayed. Previously it created using ASP.NET and SQL Server. Now my client wants to display the datas which is retrieved in SQL server data base. But the database contains the huge amou...

SQL Server: how to compare two tables

Hi. I have problem with comparing two tables in SQL Server. I have first table [Table1] with text column where I store my content and second table [table2] with column of my keywords. And now I want to compare all my keywords against my content and get a list of keywords with number of occurrences in the content. (clear enough?) ...