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
1answer
693 views

SQL - double column used from primary key with autoincrement

I am user the following as primary key in the SqlDB: I am doing the Index as Autoincrement, but it is autoincremented in general not per user. Example userid=1,index=1, then insert another for ...
2
votes
2answers
3k views

Cast NTEXT to INT for calculation and comparison

I need to convert an NTEXT column to an INT so I can perform some checks on it. The first check would be is value = 0, and the second would be if it was an even or an odd number. I've got this ...
1
vote
1answer
247 views

Recommendations on creating user-objects on system database

I want to setup a bunch of Event Notifications on SQL Server using Service Broker for our production database. I've setup a new database on my testing machine, and everything works well. The problem ...
1
vote
2answers
3k views

Adding Row Version to SQL Server table

I have a table in a database with three columns: ID, Key and Value. Everytime I update the record, I have a trigger that sends these updates to another table and creates a new record in it, who's ...
9
votes
3answers
6k views

Storing date as integer (numeric), what are the advantages

Question 1 I am working with a system where date is stored as integer (actual numeric(8,0)) and I have noticed that other systems also store date as int such as cisco in this thread. Example ...
3
votes
0answers
521 views

some SQL Server MSX targets show as Normal, Blocked

I've centralized my farm's jobs in MSX, covering about 70 instances of SQL Server. Seemingly randomly, at least once a week, several instances will stop accepting instructions. Within the MSX window ...
5
votes
2answers
144 views

Are existing entries immediately included into a newly created index?

Suppose I have a table Stuff with a column City and no indices including that column. I populate the table. Then I decide to create an index: CREATE INDEX [StuffOnCityIndex] ON [dbo].[Stuff](City ...
1
vote
1answer
1k views

Elegant way of sending e-mails with Service Broker

Is there an elegant way for sending e-mails using a Service Broker service/queue? I want to setup an EVENT NOTIFICATION for SQL Server, and I'd like to send e-mails to operators for each message on ...
1
vote
1answer
544 views

Setting Alerts for Autogrow

Can I set alerts for an autogrow event in SQL Server (2005 or 2008 R2)? I've searched around and haven't found the 'error number' for autogrowth, if there is one. In case this isn't possible, how ...
2
votes
1answer
2k views

Restoring a DB issues

I am trying to copy over the live database from one server and restore it on the dev server using SQL Server 2005. I have made a backup of the live db and copied the .bak file over to the dev server. ...
2
votes
0answers
2k views

Copy database wizard between servers results in Access Denied error. [closed]

I'm trying to copy a database from SQL Server 2008 R2 to another server, using the Copy Database Wizard in SQL Server Management Studio. I get an error telling me to check the error log on the ...
2
votes
2answers
423 views

SQL Server 2000 DTS package, filter rows using stored procedure returned date

I know very little about DTS packages in the first place (I'm a programmer not a dba) and have been stuck with the task of filtering rows based on the results of a stored procedure call that returns a ...
4
votes
3answers
564 views

Does Snapshot Isolation only give you what has been commited? (And General Snapshot Isolation questions.)

So, I have some deadlocking issues. I have seen two options to resolve it. Add read uncommitted to my db or do Snapshot Isolation and add read committed snapshot. After doing some research into ...
2
votes
1answer
644 views

Replicate SQL Data Inside Firewall to Outside Firewall - Suggestions

Currently I have an internal CRM application that houses all my data and runs my entire company. The front end is ASP, and the back end is SQL. The external site will run SQL What I'd like to do ...
2
votes
1answer
489 views

How to increase the amount of memory sql server uses on the server?

On the db server, we have 4 GB of memory. Currently, the memory utilization of Sql Server 2005 on that server is 1,725,000 K and the total memory usage is stable at 2.04 GB. The Cpu usage on the ...
4
votes
1answer
439 views

What factors prevent and delay TRUNCATE command?

I had a quite large table, perhaps a 50M rows and I had to truncate it. Usually truncate is really fast but in this case it took hours to complete. What are the factors that can prevent truncate ...
2
votes
1answer
848 views

Speeding Up Querying Views

We've got a complicated stored procedure. The biggest pain point of the procedure is a join on a complicated view--it has unions and subqueries. I can't add indexes to it. So, I want to cheat. By ...
3
votes
2answers
209 views

What is the signifigance of a fillfactor of 20?

I have a database for our ticket system in SQL Server express. I was poking around and noticed that a lot of the indexes have a fillfactor set to 20. What is the signifigance of it being set to 20? ...
4
votes
2answers
415 views

Running different instances of SQL Server from different networks on one box

I want to be able to run SQLSMS and select an instance to connect to but the instances are on different networks. I remotely log on to our server and from there, I want to be able to access our ...
11
votes
1answer
815 views

Behavior of data in indexes based on fill factor

Let's say you have a database where the default fill factor is 20. Whenever data is inserted, does it only create pages filled up to 20%? From my understanding, when the data is inserted there ...
2
votes
1answer
1k views

Performance Inserting and Updating Millions of rows into a table

We have a CSV the user imports into the Application. After inspecting the CSV, validating and applying some business logic, we got Inserts and Updates operations we should perform into a ...
3
votes
2answers
463 views

do partitions make sense when dates are not involved?

We are having some discussions about partitioning some application tables in SQL Server 2008 based on their quickly growing size. One is an event table that is typically used for INSERTS (80% of the ...
0
votes
1answer
116 views

Chart creation in BIDS 2008

Due to low reputation point i am not able to include the picture. I am trying to make u guys understand what i am asking for: I had created a report. And that Report contains these fields and ...
1
vote
1answer
165 views

SQL Server 2008 Installation pointers for optimizing Performance and Scalability

We are working for a client with an asp.net/SQL server application which has been using a SQL Server 2005 system until now. The client has decided to upgrade the database to SQL Server 2008 R2 and ...
2
votes
1answer
391 views

Data migration between databases in the same instance

I have two almost identical (structurally) databases: Documents DocumentsOld The original database existed before table partitioning was available, so the solution they found was to create the ...
8
votes
1answer
3k views

Trouble With Database Permissions for sp_send_mail

I am trying to send database mail but I am getting EXECUTE permission denied on the object 'sp_send_dbmail' database 'msdb', schema 'dbo'.. I code I am running is as follows: SELECT SUSER_NAME(), ...
2
votes
2answers
171 views

Anyone Know of Some Desktop Software that Searches an SQL server for a String [closed]

I have a database on a server that's running Microsoft SQL. I would like to find a tool that logs into that server, allows me to search to a string, and returns the tables and fields that contain that ...
11
votes
0answers
281 views

SQL Server Analysis Studio naive Bayes attribute has too many states [closed]

I'm using SQL Server Analysis Studio and I'm trying to train a naive Bayes classifier. I've got an attribute called "item description" that basically represents products you can buy at a store. I've ...
14
votes
3answers
7k views

Are Views optimized when I add a WHERE clause to them?

Does it make a difference if you filter a View inside or outside the View? For example, is there any difference between these two queries? SELECT Id FROM MyTable WHERE SomeColumn = 1 Or SELECT Id ...
5
votes
1answer
93 views

Total locking time

Consider two approaches to update data: Approach 1: Update Table 1, commit Update Table 2, commit Update Table 3, commit Approach 2: Update Table 1, Table 2, Table 3, commit. Now Approach 1 is not ...
2
votes
1answer
309 views

Does the SQL Server optimizer inline function calls in stored procedures?

I'd like to factor out some of the functionality in our SPs into separate functions/stored procedures, but I'm worried about the potential performance penalty. In particular, how efficient will be a ...
8
votes
2answers
1k views

What is an appropriate datatype for an RFID, and is there a standard definition for the format?

I have a database that tracks people based on RFID tags embedded in their shoes. This data arrives in a VARCHAR(MAX) column with other data mixed in, in no particular order. So far, all the RFID ...
6
votes
3answers
4k views

Restoring a database is not working

I have a database called FDB. I have created this database on my PC with SQL Server Express Edition and added one table. I made a backup of this database. The SQL Server version on the server is 2005. ...
2
votes
2answers
914 views

Notification mail not sent on failure

Currently we are having problems with our backups, specifically disk space issues. On investigation it seems the notification mail isn't being sent when the job fails. This is a weird issue as a ...
3
votes
2answers
2k views

ALTER TABLE SWITCH statement failed

ALTER TABLE SWITCH statement failed because column does not have the same ANSI trimming semantics in tables... Does anyone knows how to fix that on already existing table full of data? Well, I've ...
14
votes
3answers
4k views

How can I add a rowversion column to a large table with minimal downtime

Using SQL Server 2008 and later, I want to add a rowversion column to a large table however when I simply ALTER TABLE [Tablename] ADD Rowversion [Rowversion] NOT NULL Then the table is unavailable ...
6
votes
3answers
7k views

Why is this Full Outer Join not working?

I've used Full Outer Joins before to get my desired results, but maybe I don't fully understand the concept because I am not able to accomplish what should be a simple join. I have 2 tables (which ...
2
votes
0answers
52 views

Can you recover to a point in time using the LDF? [duplicate]

Possible Duplicate: How do I get back some deleted records? A coworker accidentally ran an update statement that needs to be reverted. The last backup is about 12 hours old. Is there any ...
2
votes
1answer
461 views

IDENTITY_INSERT seems stuck

I might be forgetting something, but essentially, I'm struggling with IDENTITY_INSERT. I'm trying to move data between tables, both of which have an identity column (similar schema). SET ...
2
votes
1answer
70 views

Would appreciate some advice on using external data with SQL Server 2005

I'm a web developer with a bit of DB experience, but this one is beyond my knowledge. We're trying to set up a new website. The data - products, prices, descriptions etc - are supplied by an external ...
2
votes
2answers
1k views

SQL Server: in what situation can snapshot restore be blocked after SET SINGLE_USER?

In my tests, i have the following script: USE master; ALTER DATABASE [TestDB] SET SINGLE_USER WITH ROLLBACK IMMEDIATE RESTORE DATABASE [TestDB] FROM DATABASE_SNAPSHOT = 'TestDBSnapshot' In some ...
8
votes
2answers
3k views

Is there a way to grant a user access to only all non system views of database?

In SQL Server, I have a user in a particular database and I've been asked to grant them access to all of the non-system views of the database only. I believe this can be done by editing securables of ...
4
votes
1answer
13k views

SQL Server Activity Monitor - Resource Waits - Logging > 1400 ms/sec, how?

I have an SQL Server 2008 R2 server. I open "Activity Monitor", and inside the "Resource Waits" category, I see that the "Logging" category is taking up more than 1400 ms/sec. That doesn't seem to be ...
12
votes
1answer
2k views

Monumental difference in execution time between queries when using RECOMPILE query hint

I have two almost identical queries running on the same SQL Server 2005 instance: The first one is the original SELECT query as generated by LINQ (I know, I know... I'm not the application ...
6
votes
2answers
8k views

SQL query slow-down from 1 second to 11 minutes - why?

Question: I'm porting the below query (listing tables by foreign key dependencies) to PostGreSql. WITH Fkeys AS ( SELECT DISTINCT OnTable = OnTable.name ,AgainstTable = ...
5
votes
2answers
895 views

Running each SQL Server service under different Windows accounts

Besides the Database Engine, SQL Server has some additional Services, namely: SQL Server Integration Services SQL Server Analysis Services SQL Server Reporting Services SQL Server Agent Should ...
1
vote
1answer
511 views

Right Tool for Data Mapping in Relation to Business Intelligence

When you are working as a BI developer you also need to create a data mapping between dimensional modeling and source system. What kinda application to visualize a data mapping?
8
votes
3answers
4k views

Comparing Columns that can contain NULLS - is there a more elegant way?

I know that you can't compare a value to NULL and expect a result without adding something like in the following code... SELECT * FROM A INNER JOIN B ON A.ID = B.ID WHERE A.STRING ...
1
vote
1answer
410 views

How to propagate a grandparent relationship throughout a tree?

I've got a MySQL table with columns id and parent, wherein each row has another row as a parent, except for some special root rows with parent=0. There are no cycles or broken relations. In order to ...
2
votes
1answer
308 views

Review Technical ETL process for knowledge management

I'm looking for source code and all related component/material to review technical ETL process between source database and Data Warehouse in order to increase my knowledge in technical Business ...