sql-server-2008

is it possible to add line from Database to text file in the server ?

hi i have sql-server 2008 database that in the main server. i have 10 terminals that connect to this server and work against the database. i need that every new inserting to database through any terminal - in the server this line will inserting to text file (every line) can i do it ? thank's in advance ...

MS SQL SERVER BACKUP Issue

In sql server 2008, i have taken Full backup type of my database and database was successfully done.My question is while restoring it how can i check or know that my whole backup was perfect ? ...

Finding efficient overlapped entries in a SQL table

What is the most efficient way to find all entries which do overlap with others in the same table? Every entry has a start and end date. For example I have the following database setup: CREATE TABLE DEMO ( DEMO_ID int IDENTITY , START date NOT NULL , END date NOT NULL ); INSERT INTO DEMO (DEMO_ID, START, END) VALUES (1...

Strange Values in SYS.DM_TRAN_LOCKS table RESOURCE_ASSOCIATED_ENTITY_ID column

I’ve been trying to understand some strange values in the RESOURCE_ASSOCIATED_ENTITY_ID column of SYS.DM_TRAN_LOCKS when RESOURCE_TYPE is “OBJECT”. Although these should be object Ids, I cannot determine what object they actually refer to. I’ve tried everything I can think of, including querying all system tables with columns of type IN...

distance between two points across land using sql server

I am looking to calculate the shortest distance between two points inside SQL Server 2008 taking into account land mass only. I have used the geography data type along with STDistance() to work out point x distance to point y as the crow flies, however this sometimes crosses the sea which i am trying to avoid. I have also created a p...

How to register System.DirectoryServices for use in SQL CLR User Functions?

I am porting an old 32-bit COM component that was written in VB6 for the purpose of reading and writing to an Active Directory server. The new solution will be in C# and will use SQL CLR user functions. The assembly that I am trying to deploy to SQL Server contains a reference to System.DirectoryServices. The project does compile wi...

SQL - Two foreign keys that have a dependency between them

The current structure is as follows: Table RowType: RowTypeID Table RowSubType: RowSubTypeID FK_RowTypeID Table ColumnDef: FK_RowTypeID FK_RowSubTypeID (nullable) In short, I'm mapping column definitions to rows. In some cases, those rows have subtype(s), which will have column definitions sp...

What is the sql statement for searching in text using MS SQL Server 2008?

Hi If I have text sotred in my DB, for example: "There are 2 books on the table". Maybe the user wants to search for "books" or the user wants to search in this text for any thing. What is the best SQL Statement to do that?. Thanks in advance. ...

Keep local MS SQL 2008 DB table and remote SQL Azure DB table in sync

Hi there, I have a dedicated server which hosts a Windows Service which does a lot of very heavy load stuff and populates a number of SQL Server database tables. However, of all the database tables it populates and works with, I want only one to be synchronised with a remote SQL Azure DB table. This is because this table holds what I c...

vb6 ADODB connection string to sql server 2008

I recently migrated a database from sql server 2005 to 2008 on windows server 2008. Clients connect fine from their XP machines and so does the SQL Management Studio 2008. I have also tested a remote connection using LINQPad which worked fine. However on my VB6 app, the connection string seems to give me problems. Any ideas what I'...

Using Full-Text-Search in order to find partial words (SQL Server 2008)

Hello, I'm trying to build a facebook like search for my software. I'd like to query the table customers. I've set up a FULLTEXT Index and tried the next query SELECT * FROM Customer where CONTAINS(*,'*ann*') The query does return all the customers named Ann, but it doesn't return all the customers name Anne. Is there a way to cre...

A transport-level error has occurred when receiving results from the server

I'm getting a SQL Server error: A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 0 - The handle is invalid.) I'm running Sql Server 2008 SP1, Windows 2008 Standard 64 bit. It's a .net 4.0 web application. It happens when a request is made the server. It'...

Selecting row in SSMS causes Entity Framework 4 to Fail

I have a simple Entity Framework 4 unit test that creates a new record, saves it, attempts to find it, then deletes it. All works great, unless... ... I open up SQL Server Management Studio while stopped at a breakpoint in the unit test and execute a SELECT statement that returns the row I just created (not SELECT FOR UPDATE, not WITH ...

How to connect from vs 2008 to sql server 2008

How can I connect from vs2005 to remote Sql Server (Sql Server 2008 ) when I connect I have amessage mean that is not support connecting from VS2005 to Sql Server 2008 ...

Help on choosing which SQL Server 2008 scale-out solution to pick (replication, ...)

I am currently crossing the jungle of SQL Server scale-out technologies like replication, log-shipping, mirroring... I have the following constraints on my choice: I want the read-only load to be spread accross the primary and the secondary (mirror, subscriber) server Write load can be sent directly to the primary server The solution ...

Convert row to column using sql server 2008?

Table name is Looupvalue id Ptypefield Value 1 1 D 2 1 E 3 1 F 4 1 G 5 1 H 6 2 FL 7 2 IF 8 2 VVS1 9 2 VVS2 10 2 VS1 11 2 VS2 12 3 0.50 13 3 1.00 14 3 1.50 15 3 2.00 16 4 Marquise 17 4 Round 18 4 Pear 19 4 Radiant 20 4 Princess Lookupvalue table value convert roow to ...

Connecting to database on web host in Visual Studio or Sql Server Management Studio

I have a web site developed locally with a local Sql Server database. I also have a web host that provides one Sql Server database for my site. Now I want to deploy the application, and I would like to be able to manage the remote database from the Server Explorer in Visual Studio. I have the connection string used in the application, wh...

Trouble connecting to SQL Server 2008 using UDL

A legacy VB app was working with SQL Server 2000 on an XP box, using the connection string (in an ADODC): FILE NAME=link.udl This UDL points at the database... Provider=SQLOLEDB.1;Password=secret;Persist Security Info=True;User ID=sa;Initial Catalog=maindb;Data Source=DBXP The database was migrated to a new Windows Server 2008 box runn...

Undo Table Partitioning - SQL Server 2008

I have a table 'X' and did the following CREATE PARTITION FUNCTION PF1(INT) AS RANGE LEFT FOR VALUES (1, 2, 3, 4) CREATE PARTITION SCHEME PS1 AS PARTITION PF1 ALL TO ([PRIMARY]) CREATE CLUSTERED INDEX CIDX_X ON X(col1) ON PS1(col1) this 3 steps created 4 logical partitions of the data I had. My question is, how do i revert this part...

Performance optimization for SQL Server: decrease stored procedures execution time or unload the server?

We have a web service which provides search over hotels. There is a problem with performance: a single request to the service takes around 5000 ms. Almost all of the time is spent in database by executing storing procedures. During the request our server (mssql2008) consumes ~90% of the processor time. When 2 requests are made in paral...