sql-server

Which control to use for working on data from databas

want is, can perform all operations on a table of a database, that is create delete insert records edit records/update etc. have used all the controls gridview datalist detailsview formview listview i would like to have your opinion as to "which control is the best to use, easy to program, and is user friendly, simple coding all...

Eliminating outliers by standard deviation in SQL Server

I am trying to eliminate outliers in SQL Server 2008 by standard deviation. I would like only records that contain a value in a specific column within +/- 1 standard deviation of that column's mean. How can I accomplish this? ...

What is the difference between Trusted_Connection and Integrated Security in a connection string?

I'm curious what the difference between the token "Trusted_Connection" and "Integrated Security" in SQL Server connection strings (I believe other databases/drivers don't support these). I understand that they are equivilent. ********** Update I gave it to adrianbanks for the nice table of synonyms he found. The etymology which I inclu...

Sql server convert/cast int to varchar independent of db language/collation

I would like to convert/cast some int or bigint to varchar (in tsql). But I would like it to be in English regardless of database language, collation, etc. (I need to parse it back on the client side) Basically I am looking for tsql equivalent of this C# code 1234.ToString(CultureInfo.InvariantCulture) What should I do? Is this lan...

unable to connect to sql server analysis services on windows vista

I just installed sql server 2008 developer edition on my windows vista machine. The installation was successful. Reporting service is working fine. But I am not getting any option to connect to "Analysis Services" in sql management studio. The only options i get for "Server Type" while connecting are - 1. Database Engine 2. Sql Serve...

SQL Server - Select AS temp_name FROM table WHERE temp_name = something?

You know how you can assign a temporary column name to a return value in a SQL statement like this? SELECT something+this+that AS myvalue FROM mytable Is it possible to use the temporary name myvalue as a conditional? SELECT something+this+that AS myvalue FROM mytable WHERE myvalue = 10 I can't seem to figure out the syntax to do t...

cannot we pass the table as a parameter in stored procedure..?.

SET QUOTED_IDENTIFIER OFF go CREATE PROCEDURE ps_StudentList_Import @PathFileName varchar(100), @tablename varchar(100) AS DECLARE @SQL varchar(2000) BEGIN SET @SQL = "BULK INSERT '"+@tablename+"' FROM '"+@PathFileName+"' WITH (FIELDTERMINATOR = '"",""',ROWTERMINATOR = '""\n""') " END exec(@SQL); go EXEC ps_StudentList_Impor...

mobile application cannot see remote sql server!?

Hello all, I am sorry for bothering you with my probably low level question. I would like to develop a very very very simple application which will connect the MS SQL SERVER in my notebook and will be run at hand terminal-with windows mobile 6. Here is the code which i used : Dim strSQL As [String] = "SELECT COUNT(studentid) AS tot...

SQL Server export, back-up without to stop the server

Can anyone tell me how can I make back-up to a database to to export it to a different database (SQL Server or mysql) without to stop the server ? thank you in advance for any help ! ...

PHP - Intermittent SQL Server Connection problems

I'm performing a small load test on my Centos PHP server, which is connecting to SQL server on Windows 2003. It's doing about 60 tps. Around 1-10 out of every 1000 connections fail when I start up the load with a "cannot connect to the database." However, I don't see any noticeable drop in performance. Does anyone know how I might go...

How to reorder records (SortOrder column) after deleting a record in SQL Server?

I was wondering what the most efficient way is to reorder my records after I delete a record. Basically I have something like (ItemID, SortOrder). So when I delete an item, the SortOrder column will no longer be incremental. I want to re number sort order so that the numbers are incremental again. I was thinking maybe I could do this wi...

SQL sub queries - is there a better way

This is an SQL efficiency question. A while back I had to write a collection of queries to pull data from an ERP system. Most of these were simple enough but one of them resulted in a rather ineficient query and its been bugging me ever since as there's got to be a better way. The problem is not complex. You have rows of sales data. ...

SQL Server Backup Set "Description"

When manually backing up a database in SQL Server 2008, there is an area to enter a Description for the backup set (below Name) But how do I review the description when restoring a database? ...

what is the correct SQL to get "most used query"

i have a table called Rides id car_id distance i have another table Cars id name i want to run a query that return the most drives per car (on cars that i have rid greater than once) so the results i am looking for are something like this (to be returned in descending order): Ford 10 BMW 8 Ferrari 5 Jeep 4 I have: sele...

Hosting WCF service on IIS...

I am trying to host a WCF service using IIS, (works fine in Cassini). However when I host it in IIS I get the following error: "A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)" I ...

SQL Server Import and Export Wizard error message Export table to flat file 'data conversion failed'

Hi all, when I use SQL server import and export wizard to export a table to a flat file, it keeps giving me error message, stating that data conversion failed because of the column **. Does anyone know the reason to this issue and how to fix it? the problem source column is nvarchar(200) in sql server tables. Thanks for that. Ling ...

Help with SQL Trace

I have setup SQL Profiler as follows - Template: Tuning Save to dbo.myTable Event selection: Duration greater than or equal to 2000 (ms) This will record TextData, Duration, SPID, DatabaseID, DatabaseName, ObjectType, LoginName for the events RPC:Completed, SP:StmtCompleted & SQL:BatchCompleted. I exported the script for the SQL Tra...

Calling SQL Server stored procs from Delphi with arguments?

I'm trying to call SP_SPACEUSED from Delphi 2010 using ADO. I can call it without arguments by using TSQLStoredProc, and setting the StoredProcName. This gives me the database size. I now need a specific table size, and SP_SPACEUSED takes a single arugument, @objname. How do I pass this as an argument. I have tried passing this as a para...

Change path for default SQL Server trace

How do I change the path for the default trace in SQL Server? Can this be done with SQL Management Studio or do I have to use sp_configure Thanks ...

using a same column in place of another

I have a table which have 3 fields: id, name, reporting to which have other ids: ID NAME REPORT ------------------- 1 asd 3 2 vv 1 3 dv 2 I want name to be printed in place of ids in the report column: ID NAME REPORT ------------------- 1 asd dv 2 vv asd 3 dv vv Can somebod...