for SQL Server 2012, major build version 11.00.xxxx. Released April 1, 2012 with a projected end-of-life date of 7/12/2022.

learn more… | top users | synonyms (2)

2
votes
1answer
80 views

Is it advisable to add indexes to a data warehouse's staging area?

We have a data warehouse built in MSSQL 2012, Staging area, EDW, cubes and reports. In the staging area, the tables are a 1:1 copy of those supporting the systems used to fill the DWH with. The ...
0
votes
1answer
37 views

Sequence and table with the same name?

Can we have a sequence and table with the same name? I am trying to create a sequence with the same name as an existing table, but I get this error: There is already an object named 'XYZ' in the ...
0
votes
0answers
49 views

Are heterogeneous joins between MS Access and SQL Server tables really so bad?

I'm developing a multi-user Access 2013 application with an Access backend on a fileserver. At first I'm going to finish my stable Access application which works fine for the moment. However, I plan ...
1
vote
0answers
37 views

How to get usage based optimization working on SSAS?

I have set up the configuration for SSAS to log the usage into the database, since the table did not exist I let it do that. However SSAS created the table OlapQueryLog under the schema of the SSAS ...
2
votes
2answers
100 views

Datetime column vs Date + Time columns

I am designing a table for a system that saves a number of logs. We are looking at ~200 entries per second. We are using SQL-Server 2012 Enterprise Edition. I have a question regarding breaking up a ...
0
votes
1answer
125 views

Can connect to SQL Server 2012 via OSQL and SQLCMD but not via SSMS

We have individual developer edition SQL Server 2012 databases set up on each of our developers PC's. All PC's are Windows 7, firewall is disabled and everything runs fine. We're now looking to ...
2
votes
1answer
58 views

Is there any difference on performance when choosing DISTINCT or GROUP BY to bring distinct values?

I would like to know if there is any difference concerning performance when choosing DISTINCT or GROUP BY to bring distinct rows from a query. I've tried comparing the execution plans, but they seem ...
1
vote
1answer
112 views

SQL Server 2012 performance degradation

We are running SQL Server 2012 SP1 on Windows Server 2012. The issue we have is that after some time the server automatically reboots. Checking the logs did not show any errors. When looking into ...
0
votes
3answers
54 views

Lost my SQL Server 2005 host, SQL Server 2005 database import into SQL Server 2012?

My SQL Server 2005 host died, but the database related LUNS were on a SAN and still exist. Is there a way to use my SQL Server 2012 host to recover that database or import it in some way?
1
vote
1answer
111 views

Script not allowed to create schema objects when generating tables despite db_owner role

I am looking to make a "schema only" (no data) copy of a database on my local server. I used Tasks -> Generate scripts to script the tables from my existing database and then after creating the new ...
1
vote
1answer
143 views

Trigger to audit table changes

I have created a trigger to audit changes to a table: CREATE TRIGGER [dbo].[iudt_AutoAuditChanges] ON dbo.CPTCategoryMaster AFTER INSERT,DELETE,UPDATE AS BEGIN SET NOCOUNT ON; ...
1
vote
2answers
17 views

We have copied a drive that had a db on it and I need to open the db on a new server

Before I got here, they copied the old servers drive to an external disk. Then they blew away the old server. Now that they have a new server and SQL 2012 is installed, they would like to see the db ...
1
vote
1answer
72 views

SQL Server USE ignores IF block

I want to shrink the transaction log file of several databases using a maintenance plan. Those databases are mirrored, therefore the shrink task cannot be executed on the MIRROR databases, but the ...
1
vote
0answers
58 views

Identity in a view treated as ordinary int - migrating from SQL Server 2000 to 2012

I'm migrating a very old platform from a SQL Server 2000 backend and MS Access 2003 as its frontend to SQL Server 2012 backend and MS Access 2010 as the frontend. This obviously means a bit of ...
2
votes
1answer
46 views

Permissions to see and script objects, but not alter them?

I am a software developer. I have a production database that I need full ddl read access to, but not any ddl write or execute access. Is there a script I can send my DBA that will grant me full ddl ...
1
vote
2answers
25 views

How to update information of the data of column in the table matching the certain text?

I have a condition where i need to update the only matched case of the data in the table. For an example I have a #test table Sample data are Firstname Lastname ABCDEF GHIJKL BFGABCF FGYUTY ...
9
votes
1answer
214 views

SQL Server 2012 Page Life Expectancy resets to 0 after about 50 days

I've noticed an odd behavior on a 2-server HA cluster and I was hoping someone could confirm my suspicion, or maybe offer some other explanation... Here is my setup: A 2-server SQL 2012 SP1 ...
1
vote
0answers
32 views

SQL Server 2012 Page Life Expectancy resets to 0 after about 50 days [duplicate]

I've noticed an odd behavior on a 2-server HA cluster and I was hoping someone could confirm my suspicion, or maybe offer some other explanation... Here is my setup: A 2-server SQL 2012 SP1 ...
8
votes
2answers
189 views

Creating index on computed field: string or binary data would be truncated

I have a table Foo with the following fields: ID bigint not null identity(1,1), SerializedValue nvarchar(max), LongValue as TRY_CAST(SerializedValue as bigint) Now I want to create an index on ...
0
votes
2answers
68 views

Does CAST(DateTime AS DATE) cause the entire table to be CAST before comparison? [duplicate]

This is a very common need in the WHERE clause of our SQL statements: CAST(Something.CreationDate AS DATE) BETWEEN CAST(@firstDate AS DATE) AND CAST(@lastDate AS DATE) All of the fields are of ...
7
votes
1answer
104 views

Query plan cache bloated by ad-hoc queries, even with “Optimize for Ad-hoc Workloads”

I've been noticing what I thought to be unusual issues with our query plan cache, where the plans in the cache were never more than a day old. Through running the following query (courtesy of ...
3
votes
1answer
110 views

Print message comes out in batches

I have simple query WHILE ( @counter < 50 ) BEGIN BEGIN TRANSACTION PRINT 'Counter = ' + CONVERT(VARCHAR(4), @counter); WITH CTE AS ( ...
-2
votes
1answer
52 views

Retrieve SQL statements - No backup, No query tracing [duplicate]

I know that my question probably don't belong here but I would be really so thankful if someone has the skill for solving this out. I have recently made several update statements that I shouldn't ...
0
votes
2answers
110 views

SSAS tabular browse excel relationships not working

I'm currently building an education data warehouse. I have three factless fact tables for distinct set of grades due to the fact i have no measures (i'm not aggregating anything), the grades are ...
0
votes
1answer
204 views

Restore master database from SQL Server 2008 R2 on SQL Server 2012

I have a process that restores all my backups on a centralized server for testing. I have recently upgraded this server to SQL server 2012, and now I am getting an error when restoring master from SQL ...
1
vote
1answer
68 views

After Restore Log_reuse_wait_desc of Replication

I'm wondering if anybody has ran into this issue before and has any suggestions on what's causing it/how to fix it. We are restoring a database into lower Dev environments and after the restore the ...
1
vote
0answers
59 views

New database server hardware and software inserts slower than old setup [duplicate]

We are upgrading our database hardware and software. The previous server is about 5 years old and is running SQL Server 2005 while the new one is SQL Server 2012. Every hardware component is faster in ...
1
vote
1answer
125 views

Impact on SSRS of migration of SQL Server from 2008 to 2012

As part of my project, we are upgrading SQL Server 2008 R2 to SQL Server 2012. We have a separate SSRS 2008 instance running on a separate machine which interact with these existing 2008 database ...
3
votes
2answers
92 views

How to create a secondary read-only reporting database with < 15 minute latency

We have a 2012 standard edition instance that is doing log-shipping of 2 related databases every 15 minutes to a secondary 2012 standard edition instance for DR purposes. Although it provides ...
0
votes
3answers
206 views

I can't restore my database on SQL Server 2012. Exceeds size

I'm trying to restore a database from a .bak file. The file is only 89.3 mb large. I'm using the restore with replace option, so that all other data in the database is removed. We are just trying to ...
1
vote
0answers
135 views

Calculate the compound interest with variable annual rate

I'm moving this question from SO Some years ago I was asked to create something to calculate the current value of a lot of insurance policies, I came out with a query that worked fine, but I was ...
2
votes
1answer
23 views

Reading from subscriber during Transactional Replication

When using Transaction Replication, are there any restrictions around selecting data from the subscriber whilst transactions are being applied to it? i.e. can selects be made against tables to which ...
2
votes
2answers
99 views

How to do a one-time log shrink on a database with transactional replication

I have inherited a 10 GB database with an 80 GB log [only 3% in use according to DBCC SQLPERF(logspace)]. It seems safe to assume the extreme log growth was due to problems from long before I was ...
11
votes
3answers
554 views

Get streak count and streak type from win-loss-tie data

I made a SQL Fiddle for this question if that makes things easier for anyone. I have a fantasy sports database of sorts and what I'm trying to figure out is how to come up with "current streak" data ...
3
votes
1answer
76 views

Multi-Site clustering on Windows 2012 for SQL Server 2012

I am hoping someone can point me in the right direction here. We are trying to do a proof of concept for a 3 node multi-site cluster on Windows Server 2012 R2 for our SQL Server environment. There ...
1
vote
3answers
94 views

Moved Model Database and now my SQL Server doesn't work

I moved my Model data and log files: ALTER DATABASE Model MODIFY FILE (NAME = 'modeldev', FILENAME = 'D:\Data\model.mdf') ALTER DATABASE Model MODIFY FILE (NAME = 'modellog', FILENAME = ...
0
votes
1answer
95 views

Keyword Search a single SQL Server table for multiple search terms and create a new table from results?

I am not a database administrator. Most of my experience is with MySQL. However I think what I want to do is in the realm of possibility. I want to text query a single large table in a SQL Server ...
1
vote
2answers
535 views

SQL Server 2012 copy database failed

I want to make a copy of database in the same SqlServer . so, When i using the Copy Database Wizard, it throw error: ( I did this steps with a test DB and it works fine !!!!) config: sa user ...
2
votes
2answers
80 views

Backup name in Maintenance plan

I used to have SQL Server 2005 installed on my server. In my maintenance plan, the backup name format was like this: mydatabase_backup_yyyymmddhhss.bak. Now I am using SQL Server 2012 but I am ...
5
votes
2answers
131 views

Any advantage of having a second index with included columns on a primary key?

I'm reviewing our database and noticed that on a particular table we have the following indexes: Table: Col1 INT IDENTITY(1,1) Primary Key Col2 INT ... about 15 more columns .... ColN ...
2
votes
1answer
75 views

Replace consective numbers from a string

So if I have a table with values: Name ID ---- --- James 100 James 101 James 102 James 200 James 201 James 202 Alex 100 Alex 101 Alex 102 Alex 105 Alex 106 Alex 109 ...
0
votes
0answers
25 views

SQL Get result as a column

Is it possible to get a result as a column? The SELECT query will only need to return one record, however, at the time of querying the database it will not know what attributes are in the table, and ...
1
vote
1answer
91 views

Understanding sys.dm_exec_query_stats execution_count vs creation_time

I've just downloaded the SQL Server 2012 'Performance Dashboard Reports' and am having some issues interpreting the data shown by one of the results and linking it back to the DMV ...
-1
votes
1answer
92 views

Backup and Restore Database Method

I have a production database. I am using FULL recovery model. I am taking regular FULL backup every week. I am planning to take LOG backup every day. Now, if my database crashes or failed to load due ...
2
votes
1answer
319 views

SQL Server PerfMon: Compilations/sec > Batch Requests/sec

I've been looking at various PerfMon metrics on one of our client's SQL Server instances trying to get a good gauge of where our database (or server) could use improvements. One measure that has me ...
3
votes
2answers
314 views

Looping through values stripping 1 character at a time

I want to loop through values and strip 1 character at a time from the values and display the result. So if I have a table with values: ID ___ 34679 13390 89906 I want the result to look like this ...
1
vote
1answer
74 views

Is there a common approach to encrypting data at the database level?

Is there a common approach to encrypting data at the database level? The application I am working on will be storing sensitive data that only users of the system themselves will be able to view.
1
vote
1answer
167 views

Retrieve next queue item

I have a simple table in SQL Server 2012 which implements a processing queue. As data has been inserted the query to retrieve the next item has gone from <100ms to a constant 5-6secs. I would be ...
1
vote
0answers
29 views

Change version number of maintenance plan package

We have a Maintenance Plan on SQL 2012 that has been running fine. I made a change to it yesterday using SSMS 2014. When the plan ran last night I got the following error: The version number in ...
2
votes
1answer
214 views

AlwaysOn Availability Group Automatic Failover does not work

Playing with AG setup I have the WSFC up and configured with two nodes in one availability group called DevClusterOnline. Both nodes (DEV-AWEB5 primary, DEV-AWEB6 secondary) are running Windows Server ...