Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

SQL Server 2012 (major build version 11.00.xxxx). Please also tag sql-server.

0
votes
1answer
23 views

how to identify the default mail configurations in sql server

In Sql server, we can setup multiple email configurations out of which only some were set to default. I have tried using the following query to get the list of accounts select * from msdb.dbo....
0
votes
2answers
31 views

Divide data in single column to multiple columns

I have source data like Name Is_Trget a Yes s No d Yes f Yes a Yes S No from this source data expected output is Name Is_Yes Is_No a 2 0 s 0 2 d 1 ...
0
votes
0answers
28 views

Error establishing connection to SQL Server

I know the standard solution for this is to start the SQL Server service but I did this and it is still throwing this error. The error message is: A network-related or instance-specific error ...
0
votes
0answers
12 views

Failover Cluster went down in a 2 Node Cluster

While doing updates all the resource group were in node2 (active) but somehow the disk witness was in Node 1 and after the updates when i rebooted the Node 1 (passive) the whole cluster went off. Is ...
0
votes
0answers
42 views

IO Test for SQL Server

I was trying to use DiskSpd to check IO subsystem performance but one thing I was confused about is regarding the -T switch, which (according to the documentation) is the number of threads per file. ...
1
vote
1answer
29 views

SQL Server 2012 R2 Transaction Log needed to create database mirror?

There's a somewhat lengthy discussion of Transaction Logs in Microsoft's instructions for setting up a database mirror. We've never bothered with Transaction Logs in the past; do we really need to ...
0
votes
0answers
27 views

Running SSIS package as SQL Server agent job without installing Integration Services

I have set up a SQL Server agent job that runs an SSIS package stored as a File System (on a shared drive) on my SQL Server 2012 (remote) Production DB Server. I have created proxy account and am ...
0
votes
0answers
19 views

Retrieve all system admin users activities in SQL Server 2012

I need to log all the system admin users activities in a SQL Server 2012 server. Is there any T-Sql query I can use to retrieve this information? If not, how can I get this information quickly?
1
vote
1answer
21 views

Migration from SQL Server 2008 R2 to SQL Server 2012 SP2

I have many backups on my SQL Server 2008 R2 system, and I must restore them on new SQL Server 2012 SP2. My question is, after the restore on new SQL Server 2012, what can I do to verify that ...
6
votes
2answers
667 views

Computed column cannot be persisted because the column is non-deterministic

I know this is not the first time this type of question has been asked. But why in the following scenario is the persisted computed column being created "non-deterministic". The answer should always ...
0
votes
2answers
39 views

Insert into a table selecting data from a sub query [on hold]

I would like to insert a few data into a table selecting data from a subquery having multiple joins. I tried the following way: insert into mytable (columns) select * from (select columns from ...
1
vote
1answer
14 views

Get data from a MDX linked server and use it on a FROM clause on SQL without OPENQUERY

i have the following SQL query on SQL Server 2012: WITH MdxQuery (field1,field2,field3) AS ( SELECT field1, field2, field3 FROM OPENQUERY(my_linked_server, 'my_long_mdx_query') ) SELECT * ...
0
votes
2answers
39 views

SSIS ETL or CDC - real time DWH reporting

I am currently working on SSIS package for continuous incremental data loads of the tables (40 tables now and expected to increase in near future) from OLTP system to a Reporting database residing on ...
1
vote
1answer
57 views

Standard process during a disaster [closed]

In our environment we have a 2-node Failover cluster instance and log shipping for disaster recovery. Failover cluster is the primary site and log shipping is on DR. 2 node: same data center; log ship ...
0
votes
0answers
15 views

Migrating VM SQL Server databases from Azure to RDS AWS

I have two SQL Server VMs in Azure. I would like to migrate all the databases in the SQL Server Management Studio to RDS. Any suggestions?
1
vote
1answer
32 views

Why am I getting an error about truncation when running an SSIS job?

hoping someone can help me out. I have no idea what's going on with this job. It runs every week night and always comes back with the same errors. There are about ten files that are written. We pull ...
0
votes
1answer
24 views

Same SSRS report, two different subscription names

I would like to know how to change same SSRS reports from one subscription name to two different “from” names?
0
votes
0answers
20 views

Access Denied issue, SQL Server LocalDB on Windows Server 2008 R2 SP1

Running SQL Server LocalDB 2012 and 2014 on Windows Server 2008 R2 SP1 VM I have some bizarre issues which don't happen when running on Windows 7 or Windows 10. I can create databases, save data to ...
1
vote
1answer
31 views

Quorom Configuration for 3 Node Windows cluster

We have 2 node onsite and the 3rd node on DR and there is no disk witness. Due to maintenance I set the DR site to be primary and the other 2 nodes to be manual in asynchronous mode and after both ...
2
votes
0answers
42 views

PAGEIOLATCH_EX Wait on Target table of insert..select query

We are running SQL Server 2012 on Windows 2008 R2 with 256GB RAM and 90% memory allocated to SQL Server. No other Apps run on the server. I have a scenario where I’ve to copy a Source (staging) table ...
1
vote
2answers
36 views

Can I install SQL Server 2012 Express edition on a same machine with 2012 SQL Server Standard version

As I would like to say that we are going to downgrade the SQL Server Standard 2012 SP1 edition with SQL Server Express 2012 SP4 in one Production Server. For the time being I want to keep the SQL ...
0
votes
1answer
27 views

SQL Server account permissions for New ReportServer database from wizard

I'm trying to create a ReportServer database on a different server (Server_AT) other that my Reporting Service server (Server_RT). ON Server_AT, I created the RSExecRole as per the script here. Then ...
0
votes
1answer
21 views

How to accomplish such insert-or-update strategy?

Programming stored procedures isn't my strongest point when it comes to programming, but I'm trying to get better. I've stumbled upon a business requirement that's kind of hard for me and I was ...
-4
votes
0answers
16 views

One person can have many human friends (many to many) sql [closed]

One person can have many human friends (many to many) - Shoaib has three friends (ydk,nabeel, adnan) - Adnan has four friends ( ydk,shoaib, shahbaz,Imran) - Shahbaz has three friends (adnan, qaisar,...
0
votes
1answer
29 views

How to change the SQL Server Backup file (.bak) file default icon?

As I would like to say that by mistake the SQL Server 2012 backup file (.bak) open with wordpad. Due to this reason all backup files of SQL Server (.bak) file change with wordpad icon in entire the ...
4
votes
0answers
67 views

SQL Server High Hash Match and Sort

I have an SQL statement that is taking about 40 seconds to run and the only thing I see is an high hash match and sort. I have added indexs to the temp table but still taking an long time to complete. ...
0
votes
1answer
24 views

Select sales from different stores and group by product

I have three tables (SalesTable, StoresTable and ProductsTable) and the structure is the following: --StoresTable StoreId Name 1 Store 1 2 Store 2 --ProductsTable Id Description 1 ...
0
votes
2answers
35 views

Stored procedure that insert data and return value [closed]

can anyone fix my problem ? i wanted to return the value "SERIAL EXISTING" but i can't make it happen. i already doing it overnight. CREATE PROCEDURE ADDHARDWARE @serial varchar(100), @location ...
0
votes
1answer
21 views

What happens with a synonym if the table which its based on gets deleted?

we are working on a project to implement a large ERP system. We found out that one of the tables has a synonym to another database. Both databases are in the same instance. Our project leader has ...
1
vote
1answer
329 views

Is it possible to concatenate query results to form a new query?

I have now: SELECT TABLE_SCHEMA , TABLE_NAME , COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = 'NNN'; This gives me several hundreds of rows, because several tables contain ...
0
votes
1answer
70 views

TempLog.ldf Grows Too Large

We have a stored procedure that we run regularly. It blows up the size of TempLog.ldf from nothing to 150 GB in the course of 3-4 hours. What's going on and why is it so big? TempDB.mdf is a constant ...
0
votes
1answer
34 views

How to calculate conditional running additions in SQL Server 2012

I have a table with below mentioned structure create table #test ( ID int identity(1,1), A int, B int ); and having data as ID A B 1 9 NULL 2 9 1 3 9 2 4 8 NULL 5 8 4 6 8 ...
2
votes
1answer
49 views

How do I copy the structure and contents of some tables from one database to another?

How do I copy the structure and contents of the tables below in SQL Server Management Studio from database SNO_TEST to SNO_TMP (on the same server)? The names of the tables are ADMIN_ErrorLog, ...
11
votes
5answers
1k views

How do I limit a SQL stored procedure to be run by one person at a time?

I have a stored procedure that basically selects values from one table and inserts them to another, a sort of archiving. I want to avoid multiple people from doing that at the same time. While this ...
-2
votes
0answers
37 views

run script on sys.dm_exec_query_stats in the Query list result update top 200 and @Param1

I run this Script: SELECT dest.TEXT AS [Query], deqs.execution_count [Count], deqs.last_execution_time AS [Time], (select case when dest.TEXT like '%select%' ...
2
votes
1answer
67 views

Spike and time out errors every x th minute

I have very complicated situation here. Application team was reporting that they see spikes and errors every 20 mins. We checked what was running and found log backups. So we tuned log backups using ...
1
vote
1answer
41 views

How to create an INSERT/UPDATE/DELETE trigger

My knowledge with triggers is very poor. I want to create an INSERT/UPDATE/DELETE trigger on a tableA with column names (A1,A2,A3,A4,A5,A6). After the triggers fires, I want to put that data in ...
4
votes
1answer
182 views

How to send secure emails using sp_send_dbmail

When using sp_send_dbmail to send an email on SQL Server, how do you specify that the email be sent in an encrypted format? I found a thread discussing including the string "[SECURE]" in the subject ...
1
vote
1answer
109 views

Extended Event Session Keeps Stopping

A few months ago I added an extended event to track blocked processes and deadlocks, with a file output to track occurrences. Every now and again, I check the log file, but find that the extended ...
-3
votes
2answers
52 views

Oracle multi-tenant vs SQL Server [closed]

I am from SQL Server background and recently getting my hands dirty with Oracle 12c. I came across few features of Oracle called multi-tenant, Container Database and Pluggbale database. Can somebody ...
2
votes
1answer
29 views

Storing draft version without any constraint checks

If a system allows users to save draft (not versioning but kind of like partial save) of their work in database, I can think of 3 ways. I see similar questions being asked here already but I could ...
0
votes
0answers
32 views

Recommended RAM for 350 GB database in SQL server 2012 Enterprise Edition [duplicate]

I have two instances on the same server; one is for TEST and another is for DEV. TEST Total Database Size: 350 GB Memory allocated: 30 GB DEV Total Database Size: 350 GB Memory allocated: 20 GB ...
0
votes
0answers
19 views

Snapshot replication from SQL Server 2012 to SQL Server 2008R2

We are using snapshot replication as a standby to replicate prod data for a month from 2012 to 2008R2 after migration from 8R2 to 2012, just as a rollback process. Using snapshot replication for 10 ...
0
votes
1answer
40 views

Is it possible to support multiple snapshots / store a snapshot / restore from a snapshot to a state with another snapshot?

So, I would like to have a snapshot structure like the following: A snapshot 1 is taken. Some code is run, then a snapshot 2 is taken. Then some more code is run, and the database is reverted to ...
0
votes
2answers
34 views

How can I only UPDATE if the user was created?

I got A cursor with some ifs like this one: IF @ROLE='RW' BEGIN SET @COMMAND =' USE '+QUOTENAME(@DATABASE)+' CREATE USER '+QUOTENAME(@...
0
votes
0answers
18 views

SQL Server 2012 to Oracle 12c migration

I am very new to Oracle world and I am trying to migrate a SQL Server 2012 database to Oracle 12 using SQL Developer. Looks like I am able to migrate the database successfully as I got a popup saying "...
1
vote
0answers
19 views

Is it possible to deny a connection from changing ANSI_PADDING to OFF?

Our application occasionally throws errors if we ever apply filtered indexes because some of the C# application connections change the ANSI_PADDING to OFF for some routines. Is it possible to deny ...
2
votes
0answers
35 views

To cluster or not to cluster? That is the question!

I have a table with just one (nvarchar) column for tracking IDs that have been used, to ensure they aren’t duplicated. Should I use Clustered or Non-clustered Index for this? The only two operations ...
0
votes
0answers
57 views

When restoring logs in log shipping, when does the restoring stop

We are using LS for reporting purpose. LS backup runs on primary every 15 minutes. On Secondary nightly restore via LS restore job is done daily at 10 PM. While the nightly restore job is running, ...
1
vote
0answers
26 views

Incremental load from SQL Server through Oracle into Teradata [closed]

I have data in SQL Server but in that table there is no data column. How we can load data through Oracle using HIGH WATER MARK, based on Id column we can move the data into Teradata. How can we do ...