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

learn more… | top users | synonyms (2)

2
votes
3answers
865 views

Determine last usage date of a linked server

We have a tonne of linked servers on our database server that we would like to clean up. Is it possible to determine the last date a linked server was used? e.g. the last time a query was performed ...
1
vote
1answer
405 views

How to use HTTP Connection Manager in Script Component? (Not Script Task)

I'm trying to perform the same scenario as in the following link; Create a SSIS Script Component as a Data Source that uses a pre-existing HTTP Connection Manager to retreive a page with GET and emit ...
1
vote
2answers
72 views

How to order by alphanumeric codes in SQL Server [closed]

I have a table with some project codes. These codes are e.g.: B001, B002, Z15001, Z14001, P003,... I need this result table: Z15001 Z15002 ... B001 B002 ... C001 C002 ... Z14099 Z14098 Z14097 ... ...
2
votes
1answer
370 views

Cross Apply without a function

I would like to run a query very similar to this on one of my production databases: -- Setup the table (Already there in my real scenario) create table dbo.MyTable(MyValue int, MyGroup varchar(5)) ...
1
vote
1answer
68 views

Can we create indexes on views in SQL Server? [closed]

Can we create Indexes on a view in SQL Server 2008? I have heard about indexed view, which can give performance improvement, but the problem is data refresh on those views: Can it be auto updated, ...
5
votes
2answers
141 views

best way to consolidate data

I have three select statements which have the bulk of their columns which are the same except a few. So here is an example select *orgid='0' ,'P' as OrgType* , Lang ,*cast(Null as varchar) as ...
0
votes
1answer
53 views

LDF files vs. TRN files vs. Tempdb.MDF+LDF files.:

We have a dilemma… We have all of our MDF and LDF files in the same…\192.168.6.22\d$\Program Files\Microsoft SQL Server\DATA\Production...folder. We have all of our TRN and BAK files on ...
-1
votes
2answers
36 views

database Compatibility 90 to 100 changing causes any problem

We are planning to change Compatibility level of databases from 90 to 100. Would this cause any impact on application side? If yes then please guide me, what steps or measures we need to look upon ...
12
votes
2answers
549 views

SQL Server 2008 Performance issue with very strange resolution

I'm a long time DBA (12 years in SQL). I'm running SQL Server 2008 Enterprise in a Win 2008 clustered environment. 128gb memory and 32cpu in each cluster node. Not wimpy. I've got the weirdest ...
0
votes
4answers
51 views

Left Outer Join doesn't give expected result. What am I missing?

My objective is to find records that exist in Table 1 but do not exist in Table2. No record has a NULL value. I am using the following code, but it is not giving me the expected results. Select ...
1
vote
3answers
75 views

Can you Schedule a job inside another job?

I have many jobs that need to run but they cant run at the same time. the first step of each checks to see if any others are running if yes it waits a little bit and checks again. This can lead to a ...
1
vote
1answer
140 views

Selecting rows from same name table from multiple databases in single result set

For some reason, I have a table Table_1 in n databases (same name and schema structure) instead of one single databases. The columns are like this: | Column_1 | Column_2 | I can select data from ...
2
votes
4answers
2k 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 ...
-1
votes
1answer
49 views

How to merge same values in a column and rows

How can i merge same Stock item value and get the sum of both value in the table This is Query: select Invoice_TBL.InvoiceNo ,Invoice_TBL.ClientNo ,Invoice_TBL.ClientFullName ...
2
votes
0answers
37 views

Code required to make column not nullable

I have a table where I mistakenly allowed NULL values in a column: CREATE TABLE EXAMPLE ( EXAMPLE_ID INT IDENTITY(1, 1) NOT NULL, FOO_ID INT, CREATED_ON DATETIME DEFAULT ...
1
vote
2answers
70 views

How to pull number code from strings buried in parentheses?

I have string data (ProductDescription) that includes product names and ID numbers and need to pull the ID numbers for cross-referencing... Data Samples: Widget (1234) Different Widget (123) Many ...
1
vote
2answers
999 views

How do I normalize a database with lots of many-to-many relationships?

I am building a database that is based around a business project, in this case called a "Program." Each Program will have multiple Reports, Clients, and Partners. My first thought was to place each ...
9
votes
2answers
10k views

Suppress SQL Server Management Studio auto complete

Is there a way to temporarily suppress SQL Server Management Studio's auto-complete while typing a query? I don't want to disable auto-complete completely just say hold down some key while typing in a ...
1
vote
3answers
287 views

MS SQL Server 2008 Transaction log file back up failure

I've done some reading around this subject here and on StackOverflow but nothing really answers my question enough for me to go forward. I'll explain we have a MS SQL 2008 server running, the ...
2
votes
2answers
62 views

How to DENY access to EXEC for a role

I have a read-only database user that I do not want to be able to run the EXEC command. I ran the following command: DENY EXECUTE to db_USERROLE_deny Which completed successfully, however when I ...
2
votes
1answer
80 views

How to display the query result separately for each item in an IN clause? [closed]

Maybe it's a novice question, but I am trying to get the sum of balances for each account present in the table. I am trying the below Select SUM(BALANCE) from dbo.account_balances ...
4
votes
3answers
19k views

Login to SQL Server using Windows Authentication

I have an (.Net Console App) EXE which connects to various SQL databases using SQL server Authentication with appropriate credentials. Now there is change required in the EXE to use windows ...
6
votes
1answer
423 views

Move live SQL Server database to a new server

I have a production server running SQL Server 2008 Web Edition, and it has to keep running 24x7 with almost no down time, and it's the time for us to move to a more advanced server hardware, also it's ...
4
votes
0answers
1k views

Receiving error Error: 18059, Severity: 20, State: 1 in the SQL Logs

I'm using SQL Server 2008 Sp3 Lately I'm having errors in the SQL Logs: Error: 18059, Severity: 20, State: 1. The connection has been dropped because the principal that opened it ...
1
vote
2answers
789 views

Oracle Linked Server query error

We have a problem with a query from a SQL Server 2008R2 - 64bit to an Oracle Linked Server. We use the Oracle 64-bit driver for Windows. When we query a certain table we get the following error: ...
8
votes
2answers
450 views

Mirroring the Distributor

Has anyone had success with mirroring the distribution database? We have a dedicated server as a Distributor. It handles all our push replication from prod to reporting. We'd like to build an ...
2
votes
1answer
187 views

Aborted restoring from back up Sql Server 2008

I started restoring from backup using (WITH REPLACE, RESTORE WITH RECOVERY) and realized that it was a mistake, so I stopped restoring. Now this db is unavailable and has a 'Restoring' status. Can ...
0
votes
2answers
10k views

How to print out the query SQL text of a transaction by querying the “fn_dblog” or DBCC LOG('DataBaseName')?

At some point in the last 24 hours some changes were made to a customer SQL server 2008 (v 9.0 SP4) by one of a couple if possible applications that use the DB. Its not particular critical, but it ...
2
votes
2answers
3k views

SQL Server db user mapped to windows login not in SQL Server logins

I am on a SQL Server 2008 where I login with DOMAIN\USER_A On my database I can see this login is mapped to the user dbo of that database. What I don't understand is that DOMAIN\USER_A is nowhere to ...
4
votes
1answer
99 views

Find what data is placed in a datafile

I have a database with 5 .ndf (secondary) datafiles on SQL Server 2008 R2. (Each of these datafiles is assigned to a separate filegroup.) I want to know what data is there in those files. Is it ...
0
votes
2answers
67 views

Having DB Mirroring and Replication together

Can anybody help me understand why do one go combination of Database Mirroring + Replication. Why can't I just have Database mirroring for high availability of my database. What is the need of ...
1
vote
1answer
165 views

how service sid operate under the covers?

This question is out of curiosity and it left me in confusion whether service account as any role to play in SQL Server startup and shutdown? Can anybody explain how SQL Server 2008 Service Sids work ...
3
votes
1answer
106 views

How to monitor load on database server

Could anybody please suggest me a way to monitor the load on my database server? What perfmon counters should I monitor on daily basis and confirm that load on the server is increasing day by day [or] ...
-2
votes
1answer
79 views

SQL Server procedure optimisation

I need to optimize the procedure below (SQL Server 2008) and badly need help: I am thinking to reduce search space o Splitting the joins and create intermediate (smaller) results o Force the most ...
0
votes
2answers
64 views

How to configure DBPROP_COMMANDTIMEOUT?

How to configure the property of DBPROP_COMMANDTIMEOUT ? Can this property be configured in Database ? Thanks.
4
votes
2answers
16k views

SQL Server 2008: The database [dbName] is not accessible

I got this error from another person and I've run out of ideas. I can access this database without any problems, the database is in MULTI_USER mode, the person receiving the error is a user, etc. The ...
-1
votes
1answer
20 views

SQL statement for comparing actual products and plan products

I need some helps for writing SQL statements to compare count of actual products and plan by like below 2 Input tables: CREATE TABLE PRODUCT_PLAN ( PRODUCT NVARCHAR(50), START_TIME ...
0
votes
1answer
49 views

Saving SQL Server DMV's for later use [closed]

Is it possible to save DMV's in SQL server database backup, which can be restored on different server, I mean with master db details( views and all)? If not, what's the best way to maintain 2 ...
0
votes
2answers
78 views

How to create a VIEW in SQL Server [closed]

I have a user table and I need to create a VIEW so a user can only see their own data/row. How could I achieve this? I have been searching online but I can't find anything useful User with user_id, ...
0
votes
0answers
44 views

Strange SSIS-Package problem ( ASYNC_NETWORK_IO)

I've read a lot of posts here about this warning. Have been searching on the Internet, but not like this case. We are having problem with integration services packages. When I run the query (that ...
1
vote
1answer
26 views

can log shipping to log shipping?

I have one production SQL Server 2008 Database with log shipping set up for that server in US. I have a account in the log shipping database so I could sometimes run query on log shipping database. ...
0
votes
0answers
16 views

Identify Purchases or Redemptions with the Same Single Trade Profile but Attributed to Multiple Channels

I want to identify Mutual Fund Purchases or Redemption with the same system source ('System'), firm ('Firm Id'), CUSIP ('Product Cusip'), trade date ('Trade Date'), settle date ('Settled Date'), trade ...
0
votes
0answers
15 views

Does splitting to multiple databases has performance impact? [duplicate]

I am scaling an old application which was designed to have ten databases. These databases are related to each other. The database is SQL Server 2008. The databases combined size is less than a GB. I ...
2
votes
0answers
31 views

How long does the final phase of an online index creation take?

In reading the whitepaper: Online Indexing Operations in SQL Server 2005 it says: The online index build process can be roughly divided into three phases: Preparation Build Final ...
5
votes
1answer
2k views

SSRS Merge Data Across 2 Group Values

I have created a report for SSRS 2008 which produces the results below. What I am looking to achieve is for those results in pink, AD, to be under both AM and PM with the text centered i.e. merged ...
0
votes
1answer
44 views

Creating database with a relative path

I am supposed to be testing a piece of software that uses mssql express as the backend for data storage. When it is creating its databases, it tries to create them in my home directory that is on a ...
6
votes
2answers
7k views

The database principal owns a schema in the database, and cannot be dropped message

I am trying to delete a principal from the database but can't because it owns a schema. When I go to edit the user, however, the box to uncheck schemae is blue and unremovable. How can I remove the ...
1
vote
1answer
67 views

Backup SSRS Encryption Keys Using Powershell

I have made the following script from google for backing up the SSRS Encryption keys: cls $pwd = "sa@123@123" $SSRSClass = Get-Wmiobject -namespace ...
4
votes
1answer
65 views

How to tell if a backup file contains CDC?

Using SQL Server 2008 through to 2014, I know how to backup and restore a database with Change Data Capture enabled (CDC), but what I am looking for is a way to query a full backup file to determine ...
10
votes
5answers
14k views

Save Results as CSV *with* headers in SSMS

With SQL Server 2008 R2, when I save the results as a CSV there are no headers. I can work around this by copying and pasting with the "Copy with Headers" , or just grab the headers and paste them in ...