sql-server-2005

Non-Clustered Index on a Clustered Index column improves performance?

佐手、 提交于 2019-12-21 03:57:05
问题 In SQL Server 2005, the query analyzer has told me many times to create a non-clustered index on a primary ID column of a table which already has a clustered index. After following this recommendation, the query execution plan reports that the query should be faster. Why would a Non-Clustered index on the same column (with the same sort order) be faster than a Clustered index? 回答1: A clustered index has all the data for the table while a non clustered index only has the column + the location

Slow distinct query in SQL Server over large dataset

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-21 03:49:30
问题 We're using SQL Server 2005 to track a fair amount of constantly incoming data (5-15 updates per second). We noticed after it has been in production for a couple months that one of the tables has started to take an obscene amount of time to query. The table has 3 columns: id -- autonumber (clustered) typeUUID -- GUID generated before the insert happens; used to group the types together typeName -- The type name (duh...) One of the queries we run is a distinct on the typeName field: SELECT

Connect LINQPad to remote SQL Server

僤鯓⒐⒋嵵緔 提交于 2019-12-21 03:42:44
问题 Disclaimer: I understand the question is very basic, but I could not find the answer in Google or here, and can not do it myself with guessed configuration. I want to get started with LINQPad and I have a SQL Server 2005 installed on different machine in the same domain. But I can not connect to that server from LINQPad. Here is the screenshot: What do I put as a Server string? Many thanks in advance! Update 1: SERVERNAME\MSSQLSERVER does make a difference. Instead of Error 26 (Can not find

Cannot connect to SQL Server express from SSMS

戏子无情 提交于 2019-12-21 03:42:31
问题 I have installed SQL Server Management Studio 2005. I can't find my server name when I click browse for more but i know that my server name will be the same as the user name as in the picture below. 回答1: Use . or (local) or localhost for server name if you installed the server as default instance. Use .\sqlexpress or localhost\sqlexpress if you have SQL Express. The server name syntax is Servername\InstanceName If the instance is default you use just Servername. For SQL Express, instance name

Cannot connect to SQL Server express from SSMS

拈花ヽ惹草 提交于 2019-12-21 03:42:09
问题 I have installed SQL Server Management Studio 2005. I can't find my server name when I click browse for more but i know that my server name will be the same as the user name as in the picture below. 回答1: Use . or (local) or localhost for server name if you installed the server as default instance. Use .\sqlexpress or localhost\sqlexpress if you have SQL Express. The server name syntax is Servername\InstanceName If the instance is default you use just Servername. For SQL Express, instance name

How to reference a sql server with a backslash (\) in its name?

人走茶凉 提交于 2019-12-21 03:37:04
问题 Givens: One SQL Server is named: DevServerA Another is named: DevServerB\2K5 Problem: From DevServerA , how can I write a query that references DevServerB\2K5 ? I tried a sample, dummy query (running it from DevServerA ): SELECT TOP 1 * FROM DevServerB\2K5.master.sys.tables And I get the error: Msg 102, Level 15, State 1, Line 2 Incorrect syntax near '\.'. However, I know my syntax is almost correct, since the other way around works (running this query from DevServerB\2K5 ): SELECT TOP 1 *

Is there a SVN plugin for SQL Server Management Studio 2005 or 2008? [closed]

99封情书 提交于 2019-12-21 03:19:16
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . Looking for a "Source Control" plugin to integrate SSMS with Subversion/SVN. Anyone know of one? 回答1: Redgate's solution seems to be for versioning your database, not your files in your Solution Explorer. I've found two options for solution versioning: 1) Setting up TortoiseSVN as an external tool: http:/

What are the pitfalls of inserting millions of records into SQL Server from flat file?

99封情书 提交于 2019-12-21 02:39:09
问题 I am about to start on a journey writing a windows forms application that will open a txt file that is pipe delimited and about 230 mb in size. This app will then insert this data into a sql server 2005 database (obviously this needs to happen swiftly). I am using c# 3.0 and .net 3.5 for this project. I am not asking for the app, just some communal advise here and potential pitfalls advise. From the site I have gathered that SQL bulk copy is a prerequisite, is there anything I should think

Why is using OPENQUERY on a local server bad?

喜夏-厌秋 提交于 2019-12-21 01:26:05
问题 I'm writing a script that is supposed to run around a bunch of servers and select a bunch of data out of them, including the local server. The SQL needed to SELECT the data I need is pretty complicated, so I'm writing sort of an ad-hoc view, and using an OPENQUERY statement to get the data, so ultimately I end up looping over a statement like this: exec('INSERT INTO tabl SELECT * FROM OPENQUERY(@Server, @AdHocView)') However, I've heard that using OPENQUERY on the local server is frowned upon

Local Report vs Server report in ASP .Net Report viewer control

感情迁移 提交于 2019-12-20 23:19:14
问题 In one of the ASP .Net site we are currently working we have a bulk load of SSRS reports. We have forms authentication for the site and reports have already been created and deployed in the report server. We are having so many problems with authentication when we set the report viewer control to access the server report. I just want to know what are the advantages or disadvantages of using Local report vs Server Report Thanks, Raja 回答1: 1- client report don't need to report server for