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

learn more… | top users | synonyms (2)

2
votes
0answers
41 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
votes
1answer
134 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 ...
1
vote
2answers
120 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
3answers
100 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 ...
13
votes
1answer
298 views

SQL Server recreating plans each day

We have this problem in our production environment. Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64) - Enterprise Edition (64-bit) on Windows NT 6.1 (Build 7601: Service Pack 1). SQL Server ...
0
votes
0answers
50 views

The database Forms is not accessible. (ObjectExplorer)

I tried one of my Microsoft SQL Server Database Take offline (Task -> Take Offline), its takes long time(more than 1 hour) later is closed and now when i checked my Visual Studio Manage Console, its ...
2
votes
1answer
93 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 ...
2
votes
2answers
68 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 ...
4
votes
1answer
107 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
83 views

How to configure DBPROP_COMMANDTIMEOUT?

How to configure the property of DBPROP_COMMANDTIMEOUT ? Can this property be configured in Database ? Thanks.
-1
votes
1answer
22 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
63 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
79 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, ...
1
vote
1answer
29 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
18 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
16 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 ...
0
votes
0answers
57 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 ...
2
votes
0answers
41 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 ...
0
votes
1answer
72 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
1answer
540 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
1answer
113 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 ...
5
votes
3answers
134 views

Is there an advantage to not partition aligning an index?

I have the privilege of managing a large partitioned OLAP table. While reviewing this table I noticed one of the indexes is not aligned with the partitioning scheme. Since the author is not ...
0
votes
0answers
31 views

SQL Server Windows authentication: VMs versus others

This really seems like a weird one to me. I have two VMs of interest, one is running Win2k8 R2 x64 and the other is running Windows 7 X64. The server is hosting SQL Server 2k8 while the latter has SQL ...
1
vote
1answer
37 views

How to manually invalidate a pull merge replication snapshot from the publisher

XY Problem background info: I have a pull replication publisher in which I want to add or alter a index and have those changes be applied to the subscriber. The solution to that problem I would like ...
2
votes
2answers
63 views

idera - why it restores databases faster

We have a 2gb live database that takes forever restore whenever I need some live data to test something. If I use idera it takes 5 mins at most. When I use the restore database command it can take ...
1
vote
1answer
64 views

Identity seed increased when using IDENTITY_INSERT

Running this snippet on SQL Server 2008 produces different result than on SQL Server 2014. I need them to produce the same result. My scenario is that I am writing unit tests (using tsqlt) and this ...
-1
votes
1answer
36 views

Substract dates from previous row

I couldn't see any question matching this one so I made this question. I have this result from my code and the last thing I need is to substract the dates so I get the real dates: | EmployeeId ...
1
vote
1answer
329 views

high PAGEIOLATCH_SH waits on server [closed]

EDIT: I know this question is closed, but I hope it will help someone. The problem is on our disks ( cluster ). Using PerfMon, I could create some counters ( disk reads and writes ) and the reads ...
1
vote
1answer
153 views

Error when trying to access linked server from another machine

I have created a linked server from a Excel source and when I query or test the connection from the locally from the server everything is good but if I try the same from another machine with DBMS I ...
1
vote
1answer
126 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 ...
3
votes
2answers
72 views

What happens with statistics when reverting to a database snapshot

Lets say I have a database FOO for which I created a snapshot (named FOO_snap). Now I'll run thousands of queries on this DB. After that I will revert DB to FOO_snap. Will I lose all of the statistics ...
1
vote
1answer
725 views

SQL Server 2014 .bak file error - The media family on device 'D:\..' is incorrectly formed

Worst case scenario - the server crashed and the 2014 SQL Server .bak file had to be recovered from the failed disk. The .bak file I have is over 20gb in size but is unusable when trying to restore ...
0
votes
1answer
73 views

SQL Server 2008 R2 error on database engine

Database 'msdb' cannot be opened. It has been marked SUSPECT by recovery. See the SQL Server errorlog for more information. (Microsoft SQL Server, Error: 926)
0
votes
1answer
69 views

Analyse and report disk usage growth historically

Is it possible to use historic information to show disk usage growth? I haven't keep much in the way of database setup and disk usage information. So I can't say how much disk growth has occurred in ...
4
votes
1answer
123 views

SQL Server : parsing with XPath Performance

I have a UI that allows a user to select certain data points they want to filter the results by. There are things such as location, department etc. Once they have selected all of the options, I ...
1
vote
0answers
21 views

Dynamic Paramterized Replication to a PUSH subscription

I have a publication that I want to filter by suser_sname() filter. This works perfectly fine when I'm using a pull subscription. However, I need to use a push. How do reflect this suser_sname() as ...
0
votes
0answers
142 views

Problem running SSIS package remotely using PoSH

For various reasons I'm trying to run an SSIS package remotely using Powershell. I've enabled remote scripts on my server using the following command. Set-PSSessionConfiguration -Name ...
2
votes
2answers
92 views

Running a T-SQL job under another user

I cant find my proxy user to "Run as" that user !? I am confused which kind of proxy user is appropriate to run a job with a simple T-SQL command. (I have created a credential and proxy but cant find ...
0
votes
2answers
73 views

Query to get data in one status not in another status

I have a table with status column with different status values like 'A','C','E','I'. My data is like this: ---------------------------------------------- TagNo TruckNo VerifiedDateTime ...
0
votes
0answers
40 views

SQL Server consuming large amount of RAM [duplicate]

I have Server 2012 with two 2.10 Ghz processors and 64GB of RAM. I have SQL server 2008 installed on this server. but this SQL server is consuming 70-80% of memory. I have limited SQL memory to 24GB ...
0
votes
0answers
20 views

Is it possible to retain access to table that will be dropped and recreated?

I have a GIS table which is small and is dropped and recreated from MAPINFO. Each time I drop and recreate that table I grant access to roles created. Is it possible to sustain access during drop and ...
1
vote
3answers
579 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 ...
-4
votes
0answers
48 views

Not able to attach database backup file .bak into SQL Server 2008 [closed]

I have a database backup file named iyym.bak. How can I attach the database to my SQL Server 2008? I tried inside SQL Server Management Studio the following: right click on data base folder in ...
2
votes
1answer
78 views

SQL Server : GRANT REFERENCES Fails With Msg 15151 as Windows User with sysadmin role and also as 'sa' [closed]

Okay, what am I missing? Someone please hit me with the proverbial clue-by-four. On SQL Server 2008 R2, I execute this command: GRANT REFERENCES ON ASYMMETRIC KEY ::IRESKey to XYZZYEXT; I get this ...
0
votes
0answers
31 views

Informatica is causing Convert_implicit in SQL Server 2008

In our project a datafile is loaded into SQLServer using Informatica. The source column is defined in Informatica as UniChar.60 The target column in SQL Server is defined as varchar(60) But when the ...
33
votes
2answers
209 views

SQL Server unpredictable select results (dbms error?)

Below is simple example, which returns strange results, that are unpredictable and we cannot explain it in our team. Are we doing something wrong or is it SQL Server error? After some investigation ...
0
votes
1answer
63 views

DB Permission: User can drop only their created db's?

I want to set permission against a user, which can create database and drop on their created databases neither any database. Any idea/suggestion ?
0
votes
2answers
49 views

Mapping a Login to a User

On my production system I login to SQL Server with CPSDOM\mconnors. When I execute SELECT CURRENT_USER; it returns CPSDOM\mconnors. We use Windows authentication on our DBs. On my test system I ...
0
votes
1answer
105 views

SQL Server Deadlock on delete

I have a query like this: with xx as ( SELECT [FilePath], ROW_NUMBER() over (partition by [FilePath] order by [FilePath]) as RowNumber FROM [dbo].[foo] ...
0
votes
2answers
89 views

Find tables with modified data after a specified datetime [duplicate]

I am performing few inserts and updates on my database using tool provided by app supplier. I want to compare the updated database and backup after running the tool. But my database size is around ...