Microsoft's SQL Server is a relational database management system (RDBMS) that runs as a server providing multi-user access to a number of databases. It originated from the Sybase SQL Server codebase, which is why both products use the extension of SQL called Transact-SQL (T-SQL).

learn more… | top users | synonyms (2)

1
vote
0answers
156 views

How do I use MDX scripting in SQL server 2005 Business Intelligence Development Studio to create the following Member? [closed]

I am using Microsoft SQL server 2005 Business Intelligence Development Studio to build a cube. I need to calculate a member called INCREMENTAL OVERTIME. INCREMENTAL OVERTIME is based off of the ...
3
votes
1answer
444 views

Is it possible to make a reference to the result of an aggregate function in a SELECT clause from the same SELECT clause?

I'm not a Database Administrator--just a Software Engineer. I would like to know if it is possible to reduce the following T-SQL query: SELECT SUM(Price * Quantity) as 'Total', SUM(Price * ...
12
votes
5answers
4k views

Best way to store units in database

I have inherited a large (SQLServer) database with hundreds of columns that represent amounts of one thing or another. The units for these values (e.g. "gallons", "inches", etc) are stored in the ...
2
votes
1answer
3k views

SQL Server Rebuild/Reorganize Fragmented Indexes causes CRC error or consistency errors

In our test lab I've been experimenting with different jobs to keep our critical indexes from becoming too fragmented. I'm currently using the approach described here: sys.dm_db_index_physical_stats ...
0
votes
2answers
720 views

Creating a test database from Production database (different machines & servers)

I'd like to set up a test database on a separate server. Production database is MS SQL Server and the test server is a *nix box so I'd like to have the test server running either PostgreSQL or MySQL. ...
11
votes
2answers
10k views

Performance difference between Clustered and Non Clustered Index

I was reading Clustered and Non Clustered Indexes. Clustered Index - It contains Data Pages. That means the complete row information will be present in the Clustered Index Column. Non Clustered ...
0
votes
1answer
2k views

how do I merge two views

I have basically two views named customerV and productV. the SQL statement in the customerV view is : SELECT CUSTOMER_REGISTRATION.SURNAME, CUSTOMER_REGISTRATION.OTHER_NAME, ...
4
votes
1answer
5k views

Why does sqlcmd -Lc not show the local instance?

I have two machines, each with a default instance of SQL Server 2008 installed; each exhibiting a different behavior. On PC1, when I run sqlcmd -Lc, I do not see PC1 in the list of SQL servers on ...
15
votes
1answer
21k views

Varchar(Max) field cutting off data after 8000 characters SQL Server 2008

I have a field to store some data, the field is declared as varchar(Max). To my understanding this should be storing 2^31 - 1 characters but when I enter some content over 8000 chars it cuts the rest ...
2
votes
3answers
7k views

Microsoft SQL Server says my login is disabled, even in single user/DAC mode

I'm locked out of a local database, and the single-user mode option that has worked for me in the past isn't working for me here. I could use some options to try. It's saying the account is disabled, ...
2
votes
1answer
579 views

use variable table in OLE DB source

I try to export data to a flat file from OLE DB source. Here is what I do under OLE DB source editor. In SQL command Text: declare @t table (customerid varchar(100),[enrollment_Date] ...
2
votes
0answers
341 views

going from heirarchical XML to heirarchical SQL tables then SQL to c# objects to go to user view, how should I store the data in the databases?

Hi I'm getting my data from a web service using their getData call and it comes in as fairly chunky heirarchical XML, first everything all at once, like <allData> <product1> ...
8
votes
2answers
8k views

View delete statements in the Transaction log

Is it possible to view delete statements that have recently occurred in the Transaction Log?
4
votes
1answer
856 views

Does SQL Server evaluate functions once for every row?

I have a query like this: SELECT col1 FROM MyTable WHERE DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE())) BETWEEN col2 AND col3 ; This gives a tooltip on the execution plan ...
6
votes
1answer
5k views

Why does SQL Browser service get disabled?

I have an intermittent problem with a software installation package that installs our product (written using InstallShield/InstallScript). During the process of the installation, we restart the SQL ...
3
votes
2answers
367 views

Reduce load off primary server by using log shipping, or mirroring, or something else?

I have previously asked the below question about LogShipping frequencies, but I think I might be approaching this problem incorrectly (LogShipping frequency) Problem I have a high volume site that I ...
4
votes
2answers
557 views

Using surrogate key after merging the person's data?

This question is about business intelligence with sql server 2008 R2. If you have a person named Jim Brown with his birthdate and social security number (SSN) being located in three different source ...
2
votes
1answer
3k views

Configure second SQL Server Alias for named instance

In my devopment environment (Win 2008 server) are running two sql server 2008 instances (default and named instance). Already one Sql alias is configured and pointing to the default instance. I want ...
5
votes
1answer
340 views

SQL Server SMO Method “Discover()”

I think I just found the coolest thing every with SQL Server SMO and PowerShell. I was asked to get a script together to find the owner of every object in an instance of SQL Server. I found a script ...
2
votes
2answers
654 views

LogShipping frequency for backup/copy/restore

I wish to create a LogShipping job that runs every 5 minutes. What is the best way to do this so that the backup/copy/restore does not collide? Maybe Sql server knows how to handle this, but I was ...
13
votes
2answers
10k views

Why index REBUILD does not reduce index fragmentatation?

I have used ALTER INDEX REBUILD to remove index fragmentation. In some cases REBUILD does not seem to remove this fragmentation. What are the reasons why REBUILD does not remove fragmentation? It ...
6
votes
1answer
466 views

Is there a way to DENY CRUD operations on connections from linked server?

I have a SQL Server instance, RPT1 (2008 R2), that was set up for "power users" to run their own queries. This server is linked to our production reporting server, PRD1 (SQL Server 2008 instance), ...
4
votes
2answers
200 views

Does a dual key or single key lookup perform better on a table with a lot of data?

We have table where rows unique between 3 columns. GroupA, GroupB, ProductID. GroupA & GroupB are used in combinations to Group sets of ProductIDs and will always be used to lookup sets of ...
2
votes
2answers
2k views

Network-related or instance-specific error

I have a problem when I run my web project. I get this error : A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was ...
5
votes
2answers
1k views

What permission is needed to set Database read-only?

I am dbowner of a database which I want to set read-only. (through sql management studio). When I try that I get a permission error (297) Which role is needed to perform that action?
3
votes
1answer
3k views

SQL Error while connecting with SQL server Authentication

While I am trying to connect to SQL Server using SQL server Authentication , I am getting the following error. A Connection was established with server but then error occurred during the login ...
2
votes
1answer
691 views

How would you implement conversation groups/ locking for multiple users of a Service Broker Queue?

How do you implement conversation groups for multiple users using their own instance of the user applications but sending related messages to the service broker queue? Any good example of this kind ...
3
votes
5answers
6k views

Are there alternatives to the TOAD tool for SQL Server? [closed]

Are there any great tools as an alternative TOAD to be used for SQL Server? The tool can be commerical or open source.
2
votes
1answer
446 views

Schedule replication of SQL Server views to MySQL remote database

I have a Microsoft SQL Server 2005 Database inhouse I have to publish some information on the internet and I can't (for security policy) query this database from the web server. So I came up with the ...
3
votes
1answer
416 views

why do SSRS reports run longer for a particular user

We have been receiving complaints from a particular SSRS user that her reports run slow. I investigated in the ExecutionLog table in the ReportServer database and I observed something strange. ...
15
votes
2answers
5k views

Restore database excluding FILESTREAM data

Context We are developing a system with a large-ish database in the bottom. It is an MS SQL database running on SQL Server 2008 R2. The total size of the database is about 12 GB. Out of these, ...
11
votes
3answers
1k views

Where to learn SQL Server Service Broker?

Are there any good resources to learn Service Broker? I'm looking for a newbie-friendly guide.
2
votes
2answers
1k views

Trouble with Alerts and Notifications on SQL Server 2000

I'm trying to set up alerts and notifications in SQL Server 2000, but they are not working. I'm testing them for Agent scheduled jobs, and I get a note saying: NOTE: Failed to notify ...
3
votes
2answers
487 views

can I convert an integer to base-2 without a function

Here's a bit of a challenge. I am working with the table ReportServer.Schedule and there is a column called DaysOfWeek. I may not be using the proper terminology here, but this is an integer from ...
6
votes
1answer
239 views

Is it recommended to clear the query plan cache

Pretty much as the title describes. I have just checked a SQL Server and noticed there is a lot of query plan bloat that can be fixed by proper parametrisation. After making the changes to the code, ...
2
votes
2answers
2k views

Replace cursor with set-based approach

I am looking to replace my cursor-based solution if possible in a particular stored procedure. If it makes any difference, this is running on SQL Server 2008 R2. I am looking more for an algorithm ...
2
votes
1answer
2k views

Connection to localhost dramatically slower than to network server

I have an Excel VBA application that connects to a SQL Server 2008 R2 database through ADODB. When I'm on the network at work, the connection is almost instantaneous. When I am at home working with ...
3
votes
1answer
2k views

Export multiple tables among servers

We currently have an SSIS package that exports about 70 large tables nightly, with truncate and load at the destination. Our tables keep changing, we sometimes add some tables and remove some and ...
3
votes
2answers
135 views

Inconsistent information from different DMVs

I've a server with 12 GB of physical RAM. I just lowered its 'Max Server Memory (MB)' setting from 10 GB to 8 GB. If I look at the processes' committed memory in Perfmon, I see: select * from ...
2
votes
1answer
6k views

Full and differential restore with two backup files - SQL Server 2008

We are trying to establish a maintenance plan with 2 separate backups. One full backup over the weekend and differential backups through the week. [the differential backup has a "_diff" appended to ...
7
votes
4answers
27k views

Update existing rows with squence number/char or any unique data

I added a new column in the Table X This column "cn" has to be unique and mandatory, but old data don't have any value. How to update the existing records with sequecely or random unique data? ...
2
votes
1answer
103 views

Updating SQL Server 2008 R2 using slipstreamed source

I have a requirement to create a SQL Server 2008 R2 SP1 setup media. I have done this using slipstream method as recommended by Microsoft. I can only use this to create new installation. But is there ...
2
votes
2answers
487 views

Can you edit the context menu options?

Is there a way (registry hack is acceptable) to remove options from the context menus in SSMS? Specifically I'd like to remove the delete option from the context menu when you right click on a ...
8
votes
3answers
5k views

How to boost performance of virgin queries in MS SQL Server?

I have ASP.NET web site that does it's own independent caching of data and data does not change for long periods of time, so it does not need to query SQL Server second time with same query. I need to ...
11
votes
1answer
6k views

How can I force SQL Server Management Studio to update metadata?

Metadata in SSMS isn't updating unless I shut it down and restart. I've tried disconnecting from the server and reconnecting while the SSMS session is active, but that isn't working. Steps to ...
9
votes
1answer
973 views

alert when any job in a job category fails

Is it possible to set up an alert in SQL Server 2008 that will send an e-mail anytime a job in a specific category fails? I am wondering because I would like to set up an e-mail anytime an SSRS ...
2
votes
1answer
104 views

Point in time database restore

I am trying to restore my database using point in time using .bak file. I selected the back from using the from device option. File is shown its type is full as i give the some back data and time. The ...
3
votes
1answer
603 views

Will an index that is a partial key of the begining of another index perform any better than the longer index?

If I create an index that is a partial key of the begining of a second index, will SQL Server get any significant gains retreiving the results from the simpler index, when the search criteria matches ...
5
votes
1answer
1k views

Mitigate negative effects of shrinking

Closely related to this question from a few weeks ago, but the answers didn't discuss how to do the dirty deed. Here's the situation: We now 15 GB data in a database, but a logging bug in an ...
1
vote
1answer
298 views

When was the syslogin's password last updated?

In SQL Server, I see there's a field in syslogins titled "updatedate" which is a timestamp of the last time the login was updated. What constitutes an "update"? My goal is to only get a timestamp ...