SQL Server 2008 (major build version 10.00.xxxx). Please also tag with sql-server.

learn more… | top users | synonyms (2)

3
votes
1answer
1k views

Restoring SQL Server Database Command Line Error

I have a restore database script in a SQL file, and I'm trying to restore a backup generated from one DB to a new DB (that exists). That SQL file is being executed by SQLCMD on the command line. The ...
1
vote
1answer
103 views

Where does it make sense to store Indexes for partitioned tables?

Prior to table partitioning, all the indexes were stored on a separate drive, per this question. Now that I partitioned a couple of tables, SSMS is offering to store indexes in the partition scheme. ...
3
votes
1answer
2k views

How should I deploy these SSRS reports?

I need to make a decision about deployment and security of some SSRS reports and would like some advice on what the most appropriate method is. We have 40+ sites that have access to information for ...
3
votes
1answer
926 views

Why am I getting Table scan on a partitioned table query?

I have table Inventory_Break partitioned on IR_ID (int). I also created a non-clustered index for IR_ID on the table. When I run the following: SELECT * FROM dbo.INVENTORY_BREAK WHERE IR_ID ...
14
votes
3answers
7k views

Does the partition key also have to be part of the primary key?

I am partitioning a table based on a column that is not a primary key? I've read some conflicting information today on whether the partition column must be a part of the primary key. My gut says no, ...
4
votes
0answers
489 views

SQL Server 2008 replication scenario

First of all sorry about my english, and most importantly, my database ignorance, I'll do my best ;) Until now, the scenario that I have is as follows: In a server under our LAN, we have a database ...
3
votes
2answers
106 views

can access to a view be controlled by access to a referenced table?

I have a table Table_A and a view View_A that is a select of the contents of Table_A. If I deny SELECT on Table_A to a user, the user can still use the view View_A. Is there a way that I can force ...
0
votes
3answers
2k views

How can I connect to SQL server by just using local ip address

Currently I am connecting to SQL server using 192.168.1.157\MyInstance. I would like to connect to SQL server by just using 192.168.1.157 i.e if I type IP addressin SSMS it should connect properly ...
4
votes
2answers
89 views

what replication option should I choose?

Just looking for some feedback here, there are lots of replication options out there, and I'd like to try something that those more expert than I have found to be successful. Here's my scenario: 1 ...
5
votes
2answers
159 views

Mechanics of partitioning

Imagine the following hypothetical database structure. Basically it's a top down structure (Country has Orders, Order has OrderLines, OrderLine has ShipLines, etc...). I want to partition my SQL ...
12
votes
4answers
5k views

Rebuilding Indexes, DB now 10x the size

I have a SQL Server database (2008 R2 SP1) that was about 15 gigs. It turns out maintenance hadn't been running in a while, so I created a maintenance plan to rebuild all the indexes, they were very ...
3
votes
3answers
13k views

Physical memory usage approaching 100%(96%) [duplicate]

Possible Duplicate: SQL Server 2008 R2 “Ghost Memory”? Context: Windows Server 2008 R2; 32GB RAM; Application: SQL Server 2008 R2, several Connectors to Write Data into SQL ...
11
votes
5answers
2k views

UPDATE with JOIN on 100mm records, how to do this better? (in T-SQL)

I need to update 100 million records in a single table, in effect, normalizing the table by replacing the varchar value of a column with simply an ID. (I say "replacing" but really I'm writing the ID ...
3
votes
2answers
2k views

SQL Server 2008 Query Saved in Logs?

Every time I create a query and run it to create a report I save the query in my Projects folder in case I have to rerun the query in the future or if I have to modify it for any reason but it seems ...
3
votes
1answer
858 views

DENY EXECUTE on one schema object hides other objects in same schema

I have five stored procedures in a schema [XTR], the users are all in one AD group [AD\Users] and have db_datareader and public assigned to them. On one of the stored procedures I don't want to give ...
8
votes
2answers
3k views

Do indexes consume memory?

I am just starting to learn about memory usage on SQL Server. When using the query in the answer to the question SQL Server 2008 R2 "Ghost Memory"?, I discovered that a single database is ...
5
votes
2answers
591 views

Can I prove my database does not have memory issues?

(This is a continuation of do indexes consume memory) A fellow database developer believes we are having memory issues. He has seen increased run times in some standard queries - going from under 10 ...
2
votes
1answer
372 views

Reconciling dm_os_windows_info windows_sku values, gathering same info from pre SQL Server 2008 R2 instances

I'm developing an inventory system for RDBMS deployments. I'm starting with SQL Server, and later will be pulling in info for Oracle & other RDBMS deployments. When you query [dm_os_windows_info] ...
12
votes
3answers
8k views

SQL Server 2008 R2 “Ghost Memory”?

We have a dedicated SQL Server 2008 R2 machine that is experiencing some strange memory issues.. The machine itself has plenty of resources including two quad-core processors, 16gb of RAM and 64bit ...
9
votes
5answers
224 views

What is the best way to find out how many records do not have a proper phone number in SQL Server?

I have a field that people historically could use to freely supply a value. I need to identify the records which do not have an appropriate value so I can clean them. I've been looking around in SSIS ...
4
votes
2answers
221 views

Checking a wide table for nulls [duplicate]

Possible Duplicate: Test if any fields are NULL I am new here. I have a table with 70-odd columns. Is there a way I can check the number of rows with at least one null value in any column ...
3
votes
1answer
183 views

sql server active active configuration with same database names

I have a SQL Server 2008 Enterprice in a clustered environment and in active-active mode. By active-active mode i mean that both instances are active and serving requests to their databases. ...
1
vote
1answer
207 views

Updating a table based on condition

I have a database having a staging_table. From this table, entries are added to other table named Profile. Whenever staging_table is updated, it checks whether all its entries are present in Profile, ...
8
votes
1answer
561 views

What is the actual lowest possible positive REAL number

MSDN says that the range of REAL numbers is - 3.40E + 38 to -1.18E - 38, 0 and 1.18E - 38 to 3.40E + 38. Apparently the true lower limit is much lower. The following script populates a REAL column ...
4
votes
1answer
1k views

Daily database maintenance using SQL Server 2008 and a stored procedure

I have created a database maintenance plan using wizard though that link for SQL Server 2005. I have created a Maintenance Plan for SQL Server 2008 and it works fine. Now I required to complete the ...
2
votes
1answer
179 views

Optimising a query using hint locks

I have a stored procedure that is being called very frequently. For some database servers it is as often as 20 times per second. Unfortunately because different clients call this procedure, I can't (...
2
votes
1answer
3k views

Can't create table or database in sql server as permission denied in database master . (Logged in with windows authentication )

Can't create table or database in sql server as permission denied in database master. Log in authentication is Windows authentication (./SQLEXPRESS)
6
votes
1answer
2k views

Cross Database Chaining vs. Trustworthy Option

Recently, we had a stored proc request that required access across multiple databases. Of course this is not uncommon to have but in our case, earlier we used service accounts and this service account ...
3
votes
1answer
713 views

EXECUTE AS does not appear to be changing security context

We have legacy code that still makes use of xp_cmdshell calls. When we migrated to SQL Server 2008, we created a stored procedure that used code after the following pattern: EXECUTE AS 'DOMAIN\ID2' ...
0
votes
2answers
3k views

Is it possible to join derived tables to actual in Access 2007

Is it possible to join derived tables to actual tables in Access 2007 like in SQL Server 2008? I have an example below: SELECT * FROM --MyOtherTable is a "real" table MyOtherTable ...
2
votes
1answer
36 views

How to set the language of a doc to a DB field

Is there a way to set the language of a document body to a value fetch from the DB in SSRS? I tried with a simple expression and I got this error. I wonder what the best workaround is
1
vote
2answers
566 views

Merge Replicate and Mirrors

I am preparing some scripts to setup merge replication in our production environment. After completing the export from UAT, I've come across something that doesn't appear like it would work in the ...
4
votes
1answer
1k views

can I create an SSRS group without adding the group to the box itself and without using Active Directory?

I want to know if it is possible to create a group "internal" to SSRS without having to add the group to the ReportServer box itself. I do not have permissions to the box to create groups and/or add ...
2
votes
1answer
3k views

Looking for a Trigger to change inserting strings?

I have an MSSQL Server 2008 Database. There are some tables in my Database like below : table1, table2, table3, .... each table has a NVARCHAR(50) field (Name) Now, I wanna change the strings that ...
8
votes
3answers
11k views

When should indexes be dropped and recreated?

We are constructing a data warehouse that initially will be 1 TB and will grow around 20gigs every month. For certain tables we are doing daily ETL processes and others we are doing weekly/monthly. ...
2
votes
1answer
695 views

MS SQL 2008 Express - Database Tuning Advisor

I want to use DTA, but on my website I have an Express Server version. Can I backup my DB on Express server, restore it on my personal computer with Enterprise Version, make some tuning by DTA and ...
2
votes
1answer
1k views

How can I check the integrity of disabled foreign key relationships for each individual table? (SQL Server 2008)

I'm porting a huge legacy database that many different legacy frontends depend on. When I'm finished, a new frontend will be running alongside all the old legacy frontends minus the frontend I ...
1
vote
1answer
15k views

Installing SQL Server 2008 Express Edition in quiet mode issue?

I want to install SQL Server Express 2008 in quiet mode. I know that we can use /ConfigurationFile="ConfigurationFile.INI" parameter to install SQL Server from a configuration file. The following is ...
3
votes
1answer
384 views

Why CDC records nothing while being enabled?

I enabled Change Data Capture on some tables in a Microsoft SQL 2008 database. Both of the following queries return 1: select top 1 is_cdc_enabled from sys.databases where name = N'<DatabaseName&...
2
votes
1answer
4k views

Cannot fetch the rowset from OLE DB provider “SQLNCLI” for linked server X

I am getting this error while doing concurrent read from same table through linked server. Time out setting is alright. When this error happens, I also start getting the following error for the same ...
6
votes
1answer
2k views

NESTING_TRANSACTION_FULL latch

Production SQL Server 2008 performance is far below expectations. Simple single-table queries sometimes are working for 5 seconds in the mid-day compared to 250ms after hours. We cannot find which ...
7
votes
1answer
2k views

Msg 2534 : DBCC CHECKDB allocation errors

We recently moved our intranet production database from an SQL Server 2008 to an SQL Server 2008 R2 brand new server. The backup Job have been failing since migrating, due to DBCC Errors (Check ...
-1
votes
1answer
83 views

Index Proposals

As a theoretical database question, if you are asked 'which indexes would you propose and why?' are the answers from primary, clustering and secondary index? How would we know if we should introduce ...
4
votes
1answer
4k views

Database file size from sys.master_files and sys.dm_io_virtual_file_stats are different

Im using query to find out database file size. I'm using system view and DMV, because i do want to find out both- actual file size and theoretical (in case of sparse files) file size. Select ...
3
votes
1answer
369 views

Microsoft SQL Server 2008 R2 Developer Edition Data Tuning Advisor tool

I have Microsoft SQL Server 2008 R2 Developer Edition installed on my machine which has Win7 64 bit OS. I am not able see Data Tuning Advisor tool in my SSMS. Before this installation my machine ...
3
votes
1answer
589 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. ...
2
votes
0answers
655 views

SSIS - Derive column values based on join/subselect from a non-table source

I have a flat file source that contains a lot of duplicate records, which have the same key fields but differ by their "changed date". I need to split this up into two outputs, one for the "latest" ...
1
vote
1answer
1k views

Merge multiple table output but indicate which tables the records came from

I have an application with a function that uses a stored procedure (SQL Server 2008 R2) to pull in and arrange data from one table. Now, I’ve been asked to make it pull from two tables, but it’s not ...
1
vote
2answers
261 views

SQL Trigger to verify account, if not verified dont process stored procedure/transactions

Is there a way to create a trigger or function to check a user against the database and if not verfied, the following stored procedure is not ran. I would like this option for verification check ...
0
votes
1answer
79 views

View in SQL Server 2008

I am in need of getting data from multiple select queries. So I thought of creating two views and to inner join them to get my data. My questions is: which option is better creating a view, ...