Tagged Questions

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

learn more… | top users | synonyms (1)

0
votes
0answers
13 views

self referencing tables with SQL and entity framework

I have many tables in a database and the tables are nearly identical. There are limitations currently on what objects reference other objects. For example I have company,contact and project. Contact ...
1
vote
1answer
59 views

Error on DDL statement never invokes CATCH

When I try to close the SS Management Studio window below is the error I understand that DDL statements are implicit COMMIT and the below WARNING message is because BEGIN TRAN never COMMIT or ...
0
votes
0answers
40 views

Size of Table Now vs 2 Years ago [on hold]

I am trying to Analyze the growth of the data/tables within a database. I would like to analyze how much Data is currently present in a table and how much there was 2 years ago. There are date fields ...
2
votes
2answers
36 views

Multiple Instance with different service packs in SQL Server

I would like to install a Default instance with SQL Server 2008 R2 RTM and I want to install another named instance with SQL Server 2008 R2 SP2. Is this possible?
0
votes
0answers
47 views

Two instances sharing same system database?

I have a situation that I encountered with one of my clients, that I have never seen before. They are running SQL Server Express 2008 R2. There are two instances of SQL Server installed - a default ...
0
votes
3answers
44 views

Login failed for user even though it has read access

I have a SharePoint server which is using service account "spsharepoint". For some reason this user has started giving 'Login failed for user DOMAIN\spsharepoint' when I checked SQL Server logs. ...
-1
votes
1answer
15 views

Protect SQL Server Express data file

I need to protect a Microsoft SQL Server 2008 data file (.mdf) against restoring/attaching on another machine. I'm aware of TDE or Transparent Data Encryption but unfortunately this option is not ...
0
votes
0answers
31 views

Any caveats using SQL Server 2008 CDC off replicated tables?

Main TRX System ---- Replicated to ---> "Archive" --- CDC/ETL --> Some NOSQL DB... For performance reasons we never run any ETL off the main transnational system only off the archive. I ...
-1
votes
1answer
32 views

Use of MAX data types when over >8000 characters. (error exceeds the maximum allowed for any data type (8000) [closed]

I have a column in one of the table of my SQL Server database which can have more than 8000 characters. As maximum allowed character length for a column in SQL Server is 8000, how can I store the data ...
0
votes
0answers
42 views

Table design for optimum performance

For example let's say I have to create a table called Employee with columns EmployeeID, Name, DOB, Address, DepartmentID[FK]. So I create the table as follows with a primary key and a nonclustered ...
0
votes
0answers
30 views

Secondary File Group is not online in SQL Server

In my database there are two file groups PRIMARY and SECONDARY. The .ndf file is in SECONDARY file group. I just wanted to backup only the secondary file group. So ran following T-SQL... BACKUP ...
0
votes
0answers
16 views

Problem when querying audit file when audit is enabled

I'm trying to audit DML operations for a specific principle on a database. For this, I configured Audit under Server -> Security and Database -> Database Audit Specifications and enabled both of them. ...
2
votes
1answer
52 views

Get a specific row from a TSQL common table expression

I have this tsql code to recursively get the whole workgroup hierarchy for a specific workgroup (WgID 283 here): WITH GroupList(WgID,WgParentWgID) AS ( SELECT WgID,WgParentWgID FROM ...
0
votes
0answers
35 views

Create a trigger to increment value before insert if duplicated [closed]

I want to create a trigger to increment value of my VisibleNo field if it gets duplicate value. My Application is my multiple users at same time . When at first suppose two users open application it ...
0
votes
0answers
43 views

SQL Server : error 15208 Level 16, State 1, Line 1

Trying to Backup a certificate from SQL Server causes this error: Msg 15208, Level 16, State 1, Line 1 The certificate, asymmetric key, or private key file does not exist or has invalid format. ...
0
votes
2answers
40 views

RAM usage is increasing in database server with time [duplicate]

RAM usage is increasing in database server with time. When we restart the SQL services it take around 4 GB but after day or two it increases to 11-12 GB and even further. Application is hosted on ...
1
vote
2answers
50 views

Deciding on a replication strategy

We have several dozen small-medium (<1Gb) databases on our SQL Server 2008R2 (Standard Edition) server, with one or two more being created every month. The server itself is a fairly well spec'd box ...
2
votes
1answer
76 views

Will FILLFACTOR = 99 slow down my SQL Server?

I have read this today: Closely related to index rebuilding is the fillfactor. When you create a new index, or rebuild an existing index, you can specify a fillfactor, which is the amount the ...
0
votes
1answer
36 views

View permission to SQL Server logs on SSMS GUI

I would like to give a user see SQL Server logs from GUI, not through xp_readerrorlog. I was just wondering if this was possible? Thank you.
1
vote
1answer
38 views

What happens if an index build is cut half way through?

Today I ran a create NC index but stopped the execution after running for 1 hour 46 minutes. The main reason being I started to get worried about the disk space getting lower. It consumed roughly 10 ...
0
votes
1answer
17 views

Migration script fires 'The data definition language (DDL) command cannot be executed at the Subscriber'

Yesterday I had run a migration script, produced by Visual Studio 2008 schema compare option, on a SQL Server 2008 database. It had run correctly. But today, when I executed the same script, it threw ...
0
votes
0answers
52 views

unable to bring database online from recovery pending

I am trying to bring a SQL Server database online and accessible that is in Recovery Pending state. The SQL Server service uses an Active directory account that is a domain administrator and a ...
-1
votes
2answers
50 views

about latest row in sql server

I have table like id name When I inserted new row after that, I want to know which is the latest record in my table .. How to write a query for this ? I don't want to use any primary key or ...
0
votes
1answer
46 views

Removing some English token words (such as “are” or “or” etc.) from the system stoplist of full text search?

One of our table has full text catalog on it. It contains some data in a language other than English which makes some words such as "are", "or" useful. There is no stop list defined but these words ...
0
votes
0answers
29 views

Full text catalog missing a keyword

We have a full text catalog on one of our databases but one keyword does not work. e.g: select * from table where name = 'jon' -- result set returns as expected select * from table where ...
0
votes
1answer
60 views

Return rows one at a time from variable table

I have a database which contains job numbers, each job has a list of invoices and a list of journals. Its an IRQ request accounting system. In order to see which jobs have a zero balance I'm ...
2
votes
1answer
144 views

Difference in space used

When reviewing the space used by datafiles in SQL Server, there is a large difference betweens what SQL reports and Windows. How can this be explained?
4
votes
5answers
209 views

A query that lists all mapped users for a given login

When looking at the properties of a particular login, it's possible to see a list of users mapped to that login: I profiled SQL Server Management Studio (SSMS) and I see that SSMS connects to every ...
2
votes
1answer
39 views

Can autoshrink permanently damage a database? [duplicate]

I've been given the task of finding out why our server is slow. I ran a stored procedure I downloaded called sp_Blitz. It let me know that our database had auto-shrink enabled, and to disable it. So, ...
0
votes
2answers
42 views

Is there anything wrong with creating a very large log file?

I've been given the task of finding out why our server is slow. First of all I did not set this server up. Is there anything wrong with setting the initial log file size to 70GB? That's what ours is ...
0
votes
0answers
30 views

Where statement involving isnull/case

Here is my query: [SuggestedRetailPrice] > 0 AND (ISNULL( CASE WHEN [AdEnd] < GETDATE() THEN [AdPrice] END, [BasePrice]) )/[SuggestedRetailPrice] > 0.8 ...
1
vote
1answer
18 views

SQL Server log for revoke statements

I am trying to figure if SQL Server has a feature to log when a user fires statements as revoke, delete from, etc. It would be great to see which user has fired the command, date and time, and which ...
0
votes
1answer
69 views

Why is Excel File Opened Exclusively By Another?

I'm creating an SSIS package to loop through a series of Excel files (.xls). I create my while loop container and then create my data flow, which includes an Excel source. When I edit my Excel ...
2
votes
1answer
108 views

Paging in SQL Server: Is an order by clause required? (currently, rows are being missed)

We have some code that pages through a SQL result. (Currently running on SQL Server 2008) We notice that when paging is done, some rows are not returned. Let me clarify this a bit: nHibernate ...
0
votes
1answer
23 views

Is it possible for unique column to contain multiple null values SQL Server 2008 [duplicate]

I want to migrate data contained in an Oracle Table A to SQL Server. The table A contains a column CIN with unique constraint but mutliple null values. The problem is that SQL Server is rejecting the ...
0
votes
1answer
51 views

Select Statement to generate result, for Group by per second and link with Table

i tried to search in existing queries but didnt find any related thread. i would like to run a query in user table (for example), and like to get output result on per second bases. and give me zero ...
0
votes
0answers
28 views

Error when start to attach mdf - : parameter name: ncolindex actual value was -1 (Microsoft.Sql Server.Grid Control)

Got the following error when first attempted to attach a database parameter name: ncolindex actual value was -1 (Microsoft.Sql Server.Grid Control) What does this mean and how do I correct ?
0
votes
0answers
26 views

SQL: Dynamic Pivot Column, In the column's row value How to get Top 1 value

In my following query I need to get the top 1st record's value in pivot row value. So basically I get all parts and if there is a service entry with that part and a revision number I used that ...
0
votes
3answers
51 views

How to enable windows authentication on server that is not part of domain

We have an SQL server instance running on a standalone server (not part of the organizations domain network). Is there any way that we can use windows authentication to logon to sql server without ...
0
votes
1answer
30 views

Machine account causing a Token-based server access validation failed with an infrastructure error

As the error suggests the SQL log is filling with the error: Login failed for user 'xxx\xxx$'. Reason: Token-based server access validation failed with an infrastructure error. Check for previous ...
1
vote
1answer
22 views

Copy related records from 3 tables to another 3 tables and maintain the relationship between them

I have 3 tables that sore orders, order items and order item comments . I need to copy the data for one order to 3 new tables that have the same structure and maintain the relationship. the order will ...
5
votes
3answers
246 views

Corrupted mdf file causing the backup job to fail

We have ran into a problem with one of our SQL server 2008 databases. It appears that something is corrupted in its datafile and this has caused our daily DB backup jobs to fail. The last successful ...
5
votes
1answer
180 views

What is a non-clustered index scan

I know what table scan, clustered index scan and index seek is but my google skills let me down to find a precise explanation into non clustered index scans. Why and when a query uses a non clustered ...
1
vote
2answers
73 views

How to get statement which causes error 3609?

How to find out which statement causes error Msg 3609, Level 16, State 1, Line 4 The transaction ended in the trigger. The batch has been aborted.? The code seems very straight-forward: -- 1. Check ...
1
vote
1answer
52 views

Oracle OLEDB Connections hang in SQL Server: Can I restart Instance?

There is a killed/rolled back query on this instance that was originally attempting to execute a SELECT on a remote Oracle Server via OLEDB. This query was running for over two days before it finally ...
2
votes
0answers
46 views

SQL Server migration from 2005/2008 to 2012 [duplicate]

We need to upgrade two SQL Servers for our projects to SQL Server 2012. Since we’re not db-admins or familiar with such migrations, I wanted to ask you if you could tell me what we have to be aware of ...
1
vote
1answer
30 views

What happens on the primary when log cannot be restored on the secondary on Log Shipping

I would like to setup a log shipping but I have a concern as to what would happen if the restore operation on the secondary would fail for some reason. I want the primary database keep working no ...
2
votes
1answer
44 views

How do you calculate the CPU Affinity Bitmap?

I am trying to calculate the bitmap for my 32-core server. I want my instance to use cores 30 and 31. I know that CPU 0 gets assigned a value of 1, CPU 1 gets assigned a value of 2, CPU 3 gets ...
0
votes
1answer
49 views

Why the operation is not rolled back?

I have the following code in a trigger (AFTER INSERT, UPDATE): BEGIN IF @@TRANCOUNT > 0 ROLLBACK TRANSACTION; RAISERROR('Does not allow modifications in the past', 16, 1); RETURN; END; ...
0
votes
1answer
36 views

Database state set to an earlier state before creating new indexes

This is a remote server (SQL Server 2008). We are trying to get benchmarking of some stored procedures. One stored procedure was taking avrg 44 seconds, we have checked this approx 20 times for a ...