sql-server

Learning Oracle for the first time

I am a very experienced MS Sql developer, and a few new job positions are coming my way where I will be working with Oracle on a more daily basis. As with all the technologies I have learned, I want to know the best places and books to get started and up to speed with designing and developing with Oracle, but with pure C#. What resourc...

What are some good SQL Server 2008 w/ ASP.NET Website Hosting Providers?

What are some of the Hosting Providers out there that support SQL Server 2008 and ASP.NET 2.0/3.5? I am already aware of DiscountASP.NET (I host my blog with them), but I'm wondering if there are any other good hosting companies. GoDaddy hosting is good too, but they don't support SQL 2008 yet. Also, I'm open to finding Shared, Dedicat...

sql server log in failed for WPF c# project

i have created a installed sql server 2008 on my win xp box and i am developing my wpf web app on my laptop. when i try to create a connection with code i get a security error, i try connecting with the user/password combo with managment studio on my laptop with no issue. This is the code i have, at con.Open() i get the error message th...

Update subset of data in sqlserver

Hi, I have been given the following request. Please give 7% of the current contacts registered to each of the sales associates to the new sales associate ('Peter'). What I decided to do was to get the total records for each sales associate and calculate 7% of the records. For example David has 200 200/7% = 14 SELECT TOP 14 Contact...

what is the differences between sql server authentication and windows authentication..?

what is the difference between sql server authentication and windows authentication...Is there any specific situation of using each authentication..Your comments are welcome...? thanks, sivaram ...

Char(4) as Primary key

Classic database table design would include an tableId int index(1,1) not null which results in an auto-increment int32 id field. However, it could be useful to give these numbers some meaning, and I wanted to know what people thought about using a Char(4) field for an table containing enumerables. Specifically I was thinking of a Us...

Averaging data for points in close proximity with SQL Server 2008

Hi, I have an application which receives GPS data from a mobile device as well as receiving co-ordinate data it also provides signal strength from the GSM network. I am trying to plot the points on a map to display areas of good signal strength and areas of poor signal strength. When I have a few points it all works well, the points are ...

Adobe PDF x64 ifilter

Getting a weird error box when using the 64bit version of adobepdf ifilter for sql server 2005 x64 on a x64 windows server 2003. The exact message box contents: MessageBoxHeader: MsFTEFD.exe - Unable to locate component MessageboxContent: This application has failed to start because adobepdfl.dll was not found. Re-installing the appli...

Time Slot SQL Query

I'm trying to write a query to see if an engineer visited his job in a agreed time slot. This is my query so far: SELECT v.[VISITDATE], CONVERT(VARCHAR, v.[STARTTIME], 105) AS 'Startdate', CONVERT(VARCHAR, v.[STARTTIME], 108) AS 'StartTime', CONVERT(VARCHAR, v.[bookeddate], 105) AS 'BookedDate', CONVERT(VARCHAR, t.[star...

Slow bulk insert for table with many indexes

I try to insert millions of records into a table that has more than 20 indexes. In the last run it took more than 4 hours per 100.000 rows, and the query was cancelled after 3½ days... Do you have any suggestions about how to speed this up. (I suspect the many indexes to be the cause. If you also think so, how can I automatically drop...

Set Based Operations and calling Stored Procedures

I am working on a stored procedure that performs some operations on students in the class In the last step it updates status of some of the students based on some criteria. It is all pretty straight forward but I have a dilemma here. Basically there is an existing sp in the system called pUpdateStudentStatus(studentID, statusID, com...

How to get top "N'th Maximum" value alone from a table in MS SQL?

Assume that there is a 'Employee' table with salary as one of the columns. I want to get the 'Top N'th maximum salary alone from the table. How this can be fetched easily? ...

High performance machine executes SQL queries slower than a normal one?

We have an 8 CPU 2.5GHz machine with 8 GB of RAM than executes SQL quries in slower fashion than a dual core 2.19 GHz with 4GB of RAM? Why is this the case, given that Microsoft SQL server 2000 is installed on both machines ...

Best way to get the next id number without "identity"

I have to insert some records in a table in a legacy database and, since it's used by other ancient systems, changing the table is not a solution. The problem is that the target table has a int primary key but no identity specification. So I have to find the next available ID and use that: select @id=ISNULL(max(recid)+1,1) from subscri...

Error concerned with storedprocedure

set ANSI_NULLS ON set QUOTED_IDENTIFIER ON GO ALTER Procedure [dbo].[rptGGM] ( @FromDate datetime, @ToDate datetime, @PartyName varchar(50), @Type int ) As DECLARE @WhrStr VarChar(500) SET @WhrStr = CASE @Type WHEN 1 THEN ' And E.ATAAir between '+ @FromDate +' And '+@ToDate WHEN 2 THEN ' And D.AT...

How to change identity column values programmatically?

I have a MS SQL 2005 database with a table Test with column ID. ID is a identity column. I have rows in this table and all of them have their corresponding ID autoincremented value. Now I would like to change every ID in this table like this: ID = ID + 1 But when I do this I get error: Cannot update identity column 'ID'. I've trie...

connection string to a SQL Server cluster

Hello everyone, Could anyone point me or tell me how to write connection string to a SQL Server cluster instance? I want to establish trusted connection to a database (initial catalog) of the specific instance of SQL Server cluster. I find for quite some time but can not find official answer from Google. BTW: I am asking for the connec...

SQL Server Dynamic Order By Problem

I'm trying to use a dynamic order by in a stored procedure so I can pass the order I want the data returned into the stored procedure as a parameter. This works fine for VARCHAR fields however if I try to sort an int or datetime field it errors the code I have is as follows DECLARE @ORDERBY INT SET @ORDERBY = 1 SELECT TOP 10 * FROM TBL...

MS SQL Server - Invalid characters in parameter names.

I need to know what are invalid characters to use in a SQL parameter name. Given something simple like SELECT * FROM tblTest WHERE testid = @[X], if X contains a hyphen, for instance, the statement will fail. Can anyone give me a definitive list or point me in the direction of one. Thanks in advance. ...

how to finding out where SQLSERVER databases installed using SQLSMO

Hi i am trying to findout the location of where SQLSERVER datafiles(mdf) logfiles(ldf) installed using SMO. How to do this. i Need to find for both for named instance and default instance and for sqlexpress also can any body help me inthis regard.... Thanks in advance. ...