This tag is for SQL Server 2008, major build version 10.00.xxxx.

learn more… | top users | synonyms (1)

-1
votes
3answers
70 views

Alternative of a query

I have a query : SELECT TOP 21 * FROM ( SELECT ROW_NUMBER() OVER ( ORDER BY contacts.id ) AS row_number, contacts.id, contacts.first_name, ...
4
votes
1answer
60 views

How can I script out a copy of the backup to multiple locations?

Is there a way to script a copy of the backup file to multiple destinations? For example, the following will split the backup into 3 segments which make up the entire backup file. But, I'm looking to ...
0
votes
1answer
27 views

How can I write to replicated environments without impacting production? [duplicate]

Are there any methods (mirroring, snapshot replication, change tracking, etc...) available in SQL Server 2k8 which would allow me to replicate production data to several individual development ...
6
votes
2answers
177 views

Figuring out the physical size of a group of tables in SQL server

I have a group of about 30 tables, and I want to know the physical size on disk of all of these tables (plus indexes). Is there an easier way of doing this than through the GUI in SQL server 2008 R2? ...
1
vote
2answers
67 views

SP or query to dump “password policy” checkbox for all logins

sp_helplogins doesn't show a column for this. I need a listing of all logins, with the status of their "Enforce password policy" checkbox. This is for an auditor, and the standard practice is for ...
0
votes
0answers
234 views

CHECK constraint ignored during INSERT SELECT

I have the following 2 tables (simplified): CREATE TABLE dbo.[StagingTable] ( HostName [nvarchar] (max) NULL ,UserName [nvarchar] (max) NULL ,AccountType [nvarchar] (max) NULL ) CREATE TABLE ...
1
vote
0answers
81 views

Restore of SQL service master key not required to decrypt data after migration?

This is a bit of the opposite of how this question is usually asked-- I used the following to create a database master key, a certificate, and a symmetric key: Here's how I created the certs/keys ...
2
votes
2answers
132 views

How to transfer database from SQL Server to DB2?

I have a database file on disk called project.mdf. I want to import this into IBM DB2. How do I import this database?
0
votes
0answers
44 views

SQL Server JOIN with COUNT [closed]

I have two tables I'm trying to query across. One contains an entry for every time a user tunes to a particular channel in our middleware. The second is normalized table containing station ...
1
vote
1answer
111 views

Unique constraint on multiple nullable columns Sql Server

We have a PriceCombo table with the following columns: id (not null), a_id(null),b_id(null),c_id(null), discount(not null). We are using this table to figure out which price to assign various combos ...
0
votes
1answer
159 views

SQL Server Error - HRESULT E_FAIL has been returned from a call to a COM component

I have a huge 200MB .SQL file. When I try to open this in SQL server management studio 2008, I get the error -Error HRESULT E_FAIL has been returned from a call to a COM component. What could the ...
1
vote
2answers
349 views

Protect SQL Server from hackers

Today, my SQL Server 2008 is attacked by hacker from IP address in China [4300 Login failure in last 7 hours]. I contacted GoDaddy support and below is what they told me. EXEC sp_readerrorlog 0, 1, ...
3
votes
1answer
89 views

Minimal Logging Conditions in SQL

I have written a script to test out the claims made on this page http://technet.microsoft.com/en-us/library/dd425070(v=sql.100).aspx in the table titled Summarizing Minimal Logging Conditions about ...
0
votes
2answers
62 views

How can I replace constants 5,6 & 8 in sql instead of in condition

In the following query, I would like to make the values in the IN dynamic. SELECT DISTINCT party_id INTO #tmp_new_part FROM #party_approval WHERE party_approval_type_id in (5,6,8)
0
votes
1answer
67 views

Transactional Replication-Creating New Publication (for 800GB SQL Server 2008 DB) taking too long [closed]

I am trying to setup a transactional replication (which was done successfully in two earlier attempts but had to redo this time for some specific reasons on the remote distributor database server) ...
1
vote
1answer
195 views

MS SQL Server accepts non-SSL connections even with Force Encryption enabled on the server side

I am forcing encryption on my MS SQL server. My intention is to reject any client connection that does not use SSL to connect. Am I on the right track? Here are my detailed steps : makecert -r -pe ...
2
votes
1answer
86 views

Find statements related to sys.dm_db_missing_index… tables (SQL Server)

I have read up different articles related to SQL Server 2008 on how to find out missing indexes using the tables sys.dm_db_missing_index_groups, sys.dm_db_missing_index_group_stats etc. One thing ...
0
votes
1answer
56 views

Accepting only SSL connections to MS SQL server [closed]

I have followed http://support.microsoft.com/kb/316898 to force encryption on my MS SQL server. My intention is to reject any client connection that does not use SSL to connect. Am I on the right ...
0
votes
2answers
149 views

Grant a login of Sql server authentication the same permission of a Windows group login with Windows authentication?

Update: I am trying to make it easier for the login to have the permissions on multiple databases. I already have a Windows group login with Windows authentication. The Windows users in the group can ...
1
vote
1answer
89 views

How to find what prevented in getting a lock?

Sometimes my update statements fail after 3000 milliseconds with 'Lock request time out period exceeded' error. That 3000 limit is coming from my application through SET LOCK_TIMEOUT 3000 setting, ...
17
votes
3answers
439 views

Index on Persisted Computed column needs key lookup to get columns in the computed expression

I have a persisted computed column on a table which is simply made up concatenated columns, e.g. CREATE TABLE dbo.T ( ID INT IDENTITY(1, 1) NOT NULL CONSTRAINT PK_T_ID PRIMARY KEY, A ...
0
votes
2answers
119 views

Force spool to avoid creating temp tables?

I have the following query which join pivoted data of several very big tables and it runs very slow. I tried to created the temp table for each pivoting and it runs much faster. Is it a way to force ...
1
vote
0answers
87 views

Is it possible to configure Reporting Services to emit browser compatibility headers?

We have a dashboard that hosts some Reporting Services (2008) reports within frames. The dashboard runs in the browser's standards compliance mode, but this is causing some of the reporting services ...
1
vote
2answers
244 views

High cpu usage on SQL Server

We have a customer server containing SQL Server 2008R2 with about 50 databases. The issue is that the CPU usage reaches 100% (or close to it) and it lasts for a couple hours. This typically happens in ...
2
votes
3answers
246 views

What ports does SQL Server need to communicate with a web server?

If I have a web server trying to communicate to a SQL Server through a firewall, and the firewall is completely closed both ways (inbound AND outbound), I know I have to open port 1433 from the web ...
3
votes
2answers
106 views

Alert doesn't work?

I've created an alert for long run queries. However, the history is always empty even I set the value to 1(second). The following is the generated script. Is there anything wrong? /****** Object: ...
0
votes
1answer
137 views

Getting File not found error doing point in time database restore in SQL Server 2008

So I'm testing out some of our DR stuff and tried to restore a point in time backup from one of our main databases to a new database on the same server. I am admin on the box and I'm RDP'd into the ...
1
vote
1answer
175 views

How do I resolve issue with deleted table in SQL Server Database Diagrams?

I am working on a database design using the SQL Server Database Diagram tool. I created a table with the name dbo.Example and before defining any columns, attempted to save. Got an error that SQL ...
1
vote
4answers
319 views

SQL Server Page Life Expectancy sharp drop

I'm trying to put my hands on the reason this SQL Server slows down sporadically. There are no patterns detected so far. It's a SQL Server 2008 R2 running on a Windows Server 2008R2 VM on top of ...
8
votes
2answers
152 views

Should I add page level compression before adding the primary key, or after?

Situation Data warehouse on Sql Server 2008 Enterprise 36+ million row heap (don't ask), with 60+ columns 750k added monthly No primary key defined (I have now identified one) No compression What ...
0
votes
0answers
264 views

How can Sql Server have an Index Allocation Map error on object ID 0, index ID -1

EDIT: After much research the page at issue does not track any data pages. I still have a the question, but since I can safely fix the issue with out any data loss it is more of a learning question ...
1
vote
2answers
2k views

SQL Server 2008 Database Restore Error - Cannot open backup device 15105

I am trying to restore from a backup and getting the following error Msg 3201, Level 16, State 2, Line 1 Cannot open backup device 'Z:\FULL_BACKUP.bak'. Operating system error 3(failed to ...
1
vote
1answer
119 views

SQL Server 2008 database restore

I have database Registered and I backup that database from right click on database and backup and it is store registred.bak file. After I format the system once again I want to restore that database ...
11
votes
1answer
385 views

Is using DISTINCT as a hint in subqueries useful?

Does adding DISTINCT in the following example have any impact on the query running time? Is it wise to use it as a hint sometimes? SELECT * FROM A WHERE A.SomeColumn IN (SELECT DISTINCT ...
0
votes
1answer
196 views

How to show NULL results from query?

i'm trying to create a procedure with filters for search. If the parameter is "NULL" the value of parameter will be column value; Here my problem: When my parameter and column value is NULL. I have ...
0
votes
0answers
48 views

Merge replication web sync pull error

I have some problems with web synchronization for the Merge Replication. I repeated every step described here but I have always the same error: Security Error ....Unable to connect to the URL ...
0
votes
0answers
50 views

Best way set clustered primary key on a partitioned table?

I have the following table. create table T (K1 date, K2 int, K3 varchar(10), C1 int, C2....) The table will be partitioned by K1 (K1 has low selective. the data will be appended in the order by ...
1
vote
2answers
215 views

Why does OBJECT_ID return NULL in a computed column?

I'm trying to produce a usage report for some stored procedures in my database. The view view sys.dm_exec_procedure_stats contains some of what I need, so I decided to start here. SQL Server keys ...
0
votes
0answers
35 views

Error creating spatial index sqlserver

I am creating spatial index on sqlserver table. CREATE SPATIAL INDEX [SIndex_udt_cell_SP_GEOMETRY] ON [udt_cell] ( [SP_GEOMETRY] )USING GEOMETRY_GRID WITH ( BOUNDING_BOX =(80.0713, 26.389581, ...
2
votes
2answers
301 views

SQL Server 2008 upgrade to SQL Server 2012 on a cluster

I have a Windows 2008R2 2 node cluster with SQL Server 2008 clustered. How do I prevent the cluster from failing over while I am applying the SQL Server 2012 to the alternate node first? Any pointers ...
3
votes
0answers
92 views

SQL Server 2012 Resource Governor and memory used by CLR

In SQL 2012 memory used by CLR is now part of what is controlled by "MAX Server Memory" a) Does Resource Governor in SQL 2012 Enterprise (MAX_MEMORY_PERCENT for resource pool) governs CLR memory? ...
1
vote
0answers
54 views

find total money of parent node of tree according to a particular pattern

actually i am working on a project in which members are added in a tree pattern, and get the payment accordingly. My tbltestingtree structure is ass follow: Id ParentId IsLeft ...
0
votes
2answers
48 views

Query Takes more time in SQL Server 2008

I have a table in SQL Server 2008 with 553,386 rows and every day it is increasing by about 400 rows. Now when I full scan of the table (Select * from) it is taking 23 sec. Is there any solution to ...
6
votes
2answers
521 views

Slow SQL Server Database (approx 2TB) - high CPU due to index fragmentation?

I've posted this over at ServerFault but didn't have much luck getting a response. I have a fairly large SQL Server database (~2TB). Most of the data is in one table (~6 billion rows). Two weeks ago ...
0
votes
1answer
44 views

Database mirroring is limited to an original database

Database mirroring is limited to an original database and how many mirror copies?
2
votes
1answer
150 views

Doing a point in time restore with CDC enabled; Possible?

I discovered this week, the hard way, that the database restore options NORECOVERY and KEEP_CDC are mutually exclusive. So, this begs the question. How do you do a database restore, keeping CDC ...
6
votes
5answers
498 views

Move SQL Server 2008 database from machine A to B with no downtime

I got a bit of a problem. I have a SQL Server database in box A which has approximately 60gb of data. I need to move this to a new machine but I cannot have downtime at all. Every second that goes by ...
4
votes
2answers
402 views

Composite Primary Key efficiency as a Foreign Key

I have a table with a Composite Primary key (consisting of 4 columns) which is used to ensure no duplicates are entered into the table. I am now in need of a new table which will need to reference the ...
4
votes
3answers
131 views

How do you see which database on a Server uses most resources

I have a database server with a couple of databases on it. How can I see where any resource pressure may come from? I would like to get a table of: Database Name Batch Requests per second CPU ...
2
votes
1answer
115 views

SQL Server agent option in SQL Server Express

I am using SQL Server 2008 Express. I don't have SQL Server Agent option in it. How can I enable it? I have searched on internet, but couldn't find anything. Do I need to install anything? Please ...