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

learn more… | top users | synonyms (3)

17
votes
8answers
3k views

T-SQL : Is string a Palindrome?

I am a beginner in T-SQL. I want to decided whether an input string is a palindrome, with output =0 if it is not , output =1 if it is. I am still figuring out the syntax. I am not even getting an ...
1
vote
1answer
18 views

Transactional replication using articles filters and delete operations

I have a problem with my transactional replication when I use articles, filters, and delete operations. When I insert the new data into the publisher all the data that meets the specified filter is ...
1
vote
0answers
28 views

SQL Server cannot find local SQL Server accounts

All local SQL Server accounts are getting a windows application event log The description for Event ID 18456 from source MSSQLSERVER cannot be found. Either the component that raises this event ...
1
vote
1answer
115 views

Copy Data between two databases

I have the following situation. An application writes logs into SQL Server 2012 Standard edition database. The incoming data are too big to leave in the operational DB because the application also ...
2
votes
1answer
171 views

Last user update for a table

Since my server was started one month back, I am getting 2015-07-31 as the value of last_user_update for a table. Does that mean my table’s data hasn't been modified (inserted, updated, deleted) ...
2
votes
3answers
95 views

To find SQL Server is actually used or not?

I have an SQL Server 2012 and a 2008R2 running in my environment. I need to decommission the server if the server is not actually being used. I did go through this and this where connection count is ...
0
votes
0answers
23 views

Can we track data changes on all SQL Server tables based on primary-foreign key relationships?

Let's say I have a Customers table with primary key as Customer_ID and 10 more SQL Server tables with Customer_ID as foreign key. Without keeping triggers on all 11 tables, is there a way to track ...
0
votes
1answer
10 views

Implementing a Scalable shared reporting platform

Im starting to implement a Shared Platform that will host multiple BI/Reporting applications. The platform is required to be as scalable as possible and im also thinking how to achieve Load Balancing ...
2
votes
2answers
19 views

Stopping SQL Server Log Reader Agent In 2012

We implement Transactional Replication with 2 publishing servers, 4 publications and 1 subscribing server. I need to shut down our distribution server for several hours. When restarted, will the Log ...
0
votes
1answer
51 views

comparing left join and outer apply doing the same thing

I have an update trigger on a table that that insert rows in another database/table the query look like insert into otherdb.table select manyfield from inserted left join (select id, ...
0
votes
0answers
25 views

index on Inserted Deleted table inside a trigger

since Inserted and Deleted table in trigger doesn't seem to have index on them (correct me if i'm wrong) what is the best practice to speedup operation? is it creating a @table with index or #table ...
0
votes
1answer
159 views

Replication Configuration

I had a SQL Server 2008 Express edition as a Default instance and I am having SQL Server 2012 Evolution and SQL Server 2014 Evolution are my named instances. When I was trying to configure ...
2
votes
0answers
27 views

Does Trace Flag 8295 applies to SQL Server 2012?

I've been searching about the undocumented Trace Flag 8295. It's been introduced with KB 2476322 in SQL Server 2008 and "'Creates a secondary index on the identifying columns on the change tracking ...
1
vote
3answers
46 views

SQL Server Select in XML field

I need a help with the situation below: In my table SQLServer 2012 have a field with xml values, I would like to make a select of the data in that field and show the result in the form columns. ...
0
votes
0answers
13 views

SSIS package for Table copy dynamically [duplicate]

I wants to copy a table structure along with data dynamically using SSIS 2012 from a DB server to another DB server. The server and database exist physically. The user would provide 5 parameters. ...
4
votes
1answer
82 views

Slow Delete's of LOB data in SQL Server

I have a tables for logging, and a stored procedure to purge old data that has very slow DELETE performance, beyond what makes sense to me. I am looking for how to modify the tables or DELETE ...
0
votes
2answers
34 views

Error When Trying to Run Subquery

I am having issues getting my subquery to run properly. Everything runs quickly and correctly until I add the subquery. I get the error: "Msg 4145, Level 15, State 1, Line 66 An expression of ...
7
votes
3answers
9k views

How to changes or update local server connection in Maintenance plan job

Two days back our client changed one of our Dev Server name After Server Renamed, All my maintenance jobs and other jobs are failing because server name mismatch. We are using sql server 2012 ...
2
votes
1answer
43 views

What happens when two separate processes perform a full backup against the same database?

I have an instance of SQL Server 2012 RTM running. I have two separate applications that want to do a backup of a database lets call them "AppFull" and "AppFullCopyOnly". AppFull does a full ...
1
vote
1answer
38 views

Capitalize only the first letter of a name

I have a table Vendors that contains a column VendorContactFname, which is written in lowercase. I want to capitalize only its first letter. I am thinking of concatenating an Upper on the first ...
3
votes
1answer
168 views

SQLCMD stuck on “set textsize 4096”

I am using SQL Data Compare to generate a script that updates data in a QA database (SQL Server 2012). The script is around 500mb and I added a GO every 100 lines. When I start the script with: ...
0
votes
0answers
18 views

Database migration from SQL2005 to SQL 2012. SQL groups Creation with Securables

I moved 7 databases to MS SQL server 2005 to MS SQLserver 2012. Both SQl are on different servers. I copied window level user group and created SQL server level groups in SQL server 2012. Now my ...
3
votes
1answer
94 views

Help with SQL SERVER 2012 Licence

I am planning to buy SQL Server 2012 for development and I have gone crazy with Microsofts complicated licencing policies.I had been searching the internet for valid answers from last few days and ...
3
votes
1answer
2k views

Removing secondary replica from SQL Availability Group causes large log file

Due to an unforeseen hardware error, I had to take our secondary replicas down for maintenance. This was really due to a storage issue and, it was decided at a higher level, to purchase a new storage ...
2
votes
1answer
36 views

Relating 2 tables with possible wildcards?

I am having trouble getting the desired results when trying to relate the following tables. NULL in the following table essentially means that if it is not an exact match with another row then choose ...
4
votes
1answer
222 views

Partition by ascending and descending performance

I have a table, and for a given set of fields a, b and c, I need to get the first and last rows ordered by d and e, and am using ROW_NUMBER to get these rows. The relevant part of the statement is... ...
2
votes
1answer
177 views

SQL Server 2012 - Dropping Snapshots takes hours

We recently did a SQL Server upgrade from 2005 to 2012. We have a nightly job that drops a snapshot of an active database. The snapshots gets created again later in the day. Before upgrading, in SQL ...
1
vote
1answer
44 views

Unable to set user/group as principal on a proxy

I'm organizing permissions on our SQL Server instance. I want to stop using a SQL Server account, and instead grant permissions to Active Directory groups, and then add user and service accounts to ...
0
votes
1answer
30 views

Restore a database with compression on a non-enterprise edition SQL Server

Is it possible to restore a compressed an object from backup without the Enterprise Edition? I'm getting the following error after a RESTORE DATABASE operation. Msg 3013, Level 16, State 1, Line 2 ...
0
votes
1answer
42 views

Same query same data different server different query plan

I have a query that hits a view, which references other views etc...several levels down. The query plan is a bit complex. I run the query on 2 different servers. On both servers, the number of rows ...
0
votes
0answers
17 views

Errror in Ag VALIDATE SHARED LOCATION

i Have this error when i create new AG Database Do any one have experience with this issue note: share network location not share in WSFC it's on another server all node and sql Services users ...
0
votes
1answer
28 views

Returning only the row with maximum value from related rows

In the example below how do I get the rows where the swap id is the maximum value in relation to the reservationId? I am currently joining multiple tables to get customer, reservation, room etc ...
5
votes
2answers
82 views

What sort of exec requests don't have a sql handle? (sys.dm_exec_requests)

I have crafted a query against SQL Server 2012 that looks like the following: SELECT r.session_id, r.sql_handle, t.text -- more details excluded for brevity FROM sys.dm_exec_requests r CROSS APPLY ...
0
votes
0answers
8 views

How can I import data from a NetCDF file into SQL Server?

I'm being asked to investigate the feasibility of importing data from a NetCDF file into SQL server. The file could be upwards of 300-400Mb and provided 4 times a day. However I'm only interested in ...
12
votes
11answers
14k views

Sql Server Management Studio slow opening new windows

After upgrading both sql server and management studio from 2008 to 2012, the management studio 2012 is very slow when new query windows and dialog boxes are opened. Even right click on tables is slow. ...
6
votes
2answers
163 views

Does table size matter?

I have a table like this (with more columns though): CREATE TABLE [dbo].[MyTable]( [SnapKey] [int] NOT NULL, [SnapDt] [smalldatetime] NOT NULL, [Company] [varchar](4) NOT NULL, ...
0
votes
1answer
27 views

sql server 2012 Express bulk-insert fialed due to message Operating system error code 5(Access is denied.)

I used my personal laptop computer (Samsung RV520) OS: Windows 7 home premium (x64 bit) SQL Server 2012 Express version 11 I encountered an error when execut the code below. error message: Msg ...
2
votes
1answer
61 views

Why is Include Actual Execution Plan not included in @@Rowcount when it produces a row count?

While updating a column in a table the last day I was shown a new technique by our Senior DBA to reduce reads and contention. The pseudo-code is WHILE [always true condition] BEGIN UPDATE ...
4
votes
2answers
369 views

Outer self join filters vs subqueries

I have a table storing information about tickets. There is one record when ticket is sold and another when ticket is used. There is a column called TransType which is set to either 'sold' or 'used' ...
6
votes
3answers
219 views

Execution Plan is NOT using INDEX and uses Table Scan

I know when it comes to using an index or a table scan, SQL Server uses statistics to see which one is better. I have a table with 20 million rows. I have an index on (SnapshotKey, Measure) and this ...
10
votes
3answers
322 views

Is total_elapsed_time in DMV sys.dm_exec_requests completely inaccurate?

I am running SQL Server 2012 and am trying to put some queries together for monitoring using the DMVs. However, when looking at the total_elapsed_time field in the sys.dm_exec_requests DMV, the ...
0
votes
0answers
18 views

Log shipping restore: Only members of the sysadmin fixed server role can perform this operation

On my secondary, I am seeing many messages like these in sysjobhistory from the LSCopy and LSRestore jobs for each database: Could not log history/error ...
0
votes
0answers
1k views

tsql to find out sql server alias

Using TSQL, is there any way to find out SQL server alias configured at configuration manager? Such as follows? Thanks!
0
votes
0answers
30 views

Move/ Migrate SQL Server 2012 Virtual machine (Win 2012) to new Physical host [closed]

There are virtual sql servers on d/f physical hosts and I want to know what is the recommended way to move them to One physical host (Hyper-V) running multiple VM's in one data center and have same ...
7
votes
1answer
203 views

Low PLE on NUMA node 000, high on 001

I'm looking at PLE (Page Life Expectancy) across NUMA nodes on our SQL Servers, and came across a rather weird distribution. NUMA node 000 has a very low PLE compared to 001. I'm unsure why this is. ...
0
votes
0answers
56 views

SQL Server data file growing

We have an odd situation happening with one of our tables in our database and I am hoping someone can shed some light on it. This table has 3 columns id(bigint), ...
2
votes
1answer
2k views

SQL Server Audit Specification - filter DML by all but one user

I'm setting up a database audit. I'd like to capture any DML change that is issued by database user other than the service account related to the application. In short, this is to prove to our ...
0
votes
0answers
28 views

I do not see much performance between implicit & explicit transactions

DBCC SQLPERF('sys.dm_os_wait_stats', CLEAR); IF OBJECT_ID('tempdb..#wait') IS NOT NULL DROP TABLE #wait GO /************************************* ** Create a test database ...
0
votes
0answers
9 views

Workload Capture

Hopefully this is a straight forward question. But if I want to capture a workload then all I need to capture are: RPC:Completed SQL:BatchCompleted I don't need to capture SP:StmtCompleted do I, ...
1
vote
1answer
22 views

Accessing file share from ETL package in SQL Always-On configuration

How can I access the file share from ETL? Here are my environment details: I have 2 nodes in a windows cluster. node 01 and node 02 SQL Server 2014 is installed on both the nodes. Both are Windows ...