Microsoft's SQL Server is a relational database management system (RDBMS) that runs as a server providing multi-user access to a number of databases. It originated from the Sybase SQL Server codebase, which is why both products use the extension of SQL called Transact-SQL (T-SQL).

learn more… | top users | synonyms (2)

0
votes
1answer
8 views

Execution Plans Differ for the Same SQL Statement

As a background to this question the details can be found at this link. In a nutshell: I have 2 SQL statements that are almost identical except for the RIGHT table. The LEFT JOIN is the same and the ...
0
votes
0answers
8 views

Can user defined roles cause problems with colliding permissions?

I recently ran into a problem with an application crashing accessing a SQL Server 2008 database. An "APPCRASH" was recorded in the Event Viewer, but I have little else to go on. The tables are owned ...
0
votes
1answer
17 views

Find out beforehand how many records a query has

I develop reports in ExtJS resulting of queries in MSSQL 2012. I use Ext.Grid with paging, therefore I can use offset to limit the amount of records a query will return. But for this ExtJS feature to ...
0
votes
0answers
8 views

How to determine is a value exists in a column within a partition

I have a set of data where I need to look at partitioned data and determine if a value exists within that partition. Example data: AccountNumber Code Status Credited ...
0
votes
2answers
30 views

Quickly clone a database in SQL Server Management Studio

For testing purposes, I often have to clone databases (onto the same server). Currently I do this by creating a backup and restoring it as a new database. I would love to have such a functionality ...
0
votes
1answer
13 views

Can't cast a SPROC parameter?

I have several sprocs that take a date/time input, one of which takes a date only in the form of an nvarchar because it utilizes dynamic SQL. When I try to cast the variable going into the sproc I'm ...
0
votes
1answer
23 views

Need to query records based on Date only (Sample Query given)

sSQL = " SELECT ordID, ordName, ordDate, ordShipping, ordStateTax, ordHandling, ordTotal, ordDiscount, ordPrivateStatus FROM orders WHERE (ordStatus = 7) " I want to display orders that ...
0
votes
1answer
22 views

Counting SQL Server Transactions

Is there a method to count total transactions by type (read/write) by day/hour/peak? ...
0
votes
1answer
22 views

SQL weight multiplication

Hi all i have two columns in a table : +--------------------+----------------+ | Units/Pk | PackWeight/Vol | +--------------------+----------------+ | 1.0000000000000000 | 150g | ...
0
votes
0answers
15 views

Convert Teradata Database to SQL Server 2012

I am just wondering if anyone has any experience, knowledge, or recommendations on migrating a Teradata database to SQL Server 2012. I have never worked with Teradata before so I am unfamiliar with ...
2
votes
0answers
25 views

When does SQL Server acquire locks?

The list of isolation levels in SQL Server found here states that write locks acquired within a transaction are retained until the end of the transaction. However it doesn't mention anything about ...
1
vote
1answer
30 views

Cannot install SQL Server 2012

I'm trying to install SQL Server 2012 on Windows Server 2012 Standard and got this message: SQL Server Setup has encountered the following error: The resource ...
0
votes
1answer
16 views

Add linked server from SQL-Server to MySQL: “Data source name not found” (Error:7303)

I'm trying to link my SQL-Server 2005 on Windows Server 2008 R2 with MySQL 5.5.40 on a different computer. I have followed this guide: ...
0
votes
2answers
39 views

SQL Multiple JOINS Interpretation order [on hold]

I have a big problem of using multiple joins in one SQL Statement. For example i have 10 Tables which they are tbl1,tbl2, tbl3,..,tbl10. I would like to select some columns from each table from tbl1 ...
0
votes
1answer
19 views

How to Audit 2 or more SQL Logins (server principals) using SQL Server Audit

I need to audit the few SQL Server Logins, I have used filters while creating Server Audit by using CREATE SERVER AUDIT [audit123] TO FILE ( FILEPATH = N'D:\' ,MAXSIZE = 2048 MB ...
0
votes
0answers
24 views

Can I optimize a left join for a single match?

Consider a join A LEFT JOIN B ON A.id = B.a_id: B.a_id is nullable -- most but not all B records point to an A record. A can, at most, only have one matching B record (business logic). Not all A ...
1
vote
1answer
29 views

Should I used varchar(max) or varchar(4000) SPARSE?

I have a "comment"-type column that is rarely used -- around 6% non-null in a population of 3 million records. The average length (when used) is 6 characters, and the max so far is around 3KB. A ...
1
vote
0answers
15 views

How to query against legacy data that needs to be cleaned up?

I have an existing SQL Server DB with 3 tables (note: this is a made up example, but modelled after a real problem). Artists : contains music artists MusicRecords : contains information on music ...
0
votes
1answer
21 views

Copy of a database with an existing database with schema and data in sql server

I have two databases one is having master kind of tables and other will have transaction data. I should create a new database with a structure of an existing database to my clients. Here is the ...
6
votes
2answers
319 views

What effect will reducing the size of a varchar column have on the database file?

We have a number of tables in our database that have VARCHAR(MAX) columns where a VARCHAR(500) (or something much smaller than max) will suffice. Naturally I want to clean these up, and get the sizes ...
1
vote
1answer
27 views

Trigger AFTER INSERT on tables with different columns

I'm writing a trigger that works after an insert. This is what I have: create trigger trgInsereQuestao on tblquestaoOpcao after insert as begin set nocount on; insert into ...
0
votes
0answers
18 views

Fencing a failed application node to isolate it from SQL Server

I have a multi-node server application that is backed by SQL Server 2012, often in a clustered or AlwaysOn AG/FCI HA configuration. My application monitors the health of the application nodes (not the ...
1
vote
2answers
25 views

Unable to find how a table is being populated

Using SSMS2014 w/ SQL Server 2008 R2. I have a table that I am trying to find out how and from where data inside it is coming from. (I didn't create the table and am unable to contact the person who ...
0
votes
0answers
19 views

How to sync two tables which are on different databases and servers using SSIS?

I am relatively new to SQL Server's tools. I am on the following situation: On several stored procedures on a database D1 on server S1, I need to use data that is stored on a database D2 on server ...
1
vote
1answer
32 views

How to get paged resultset from a table?

I am trying to get paged resultset from a table (Notes). So, I am passing the last offset id (@LastOffset) value along with the page size (@Count). My approach to achieving this is: Sort the table ...
0
votes
1answer
31 views

How to verify if a SQL Account is still used?

We have a SQL Server Login on a SQL Server 2008, and no one seems to know if the account is actually being used or not. It is assumed it is being used, as it is configured in a Linked_Server ...
0
votes
1answer
15 views

SQL Server Service's Log On As account

I just inherited a set of new servers and whoever set them up left the "Log On As" account as the default "NT Service\MSSQLSERVER". I'd like to change that over to an Active Directory service name. I ...
0
votes
0answers
30 views

Can I create a constraint to a subset of data? [duplicate]

Here's a simplified view of my database |---------------| |-----------| | ORGANIZATION | | CONTACT | |---------------| |-----------| | OrgId | | ContactId | | OrgName ...
0
votes
0answers
31 views

Rowversion column in every table - Bad practice?

I'm currently providing my application with concurrency checks. For that, I'm using Entity Framework combined with SQL Server's RowVersion / Timestamp column. Now I've thought about adding a ...
0
votes
0answers
28 views

SQL Server 2012: query to see queries that are consuming more resources [duplicate]

I'm trying to find/build a query to show me those queries that are consuming more resources in SQL Server so that I can optimize them or at least have a statistical idea of what is really happening. ...
1
vote
1answer
48 views

What is the query that updates the Column in a table

I have a column in a table that I don't know who is updating it . The table name is dbo.Events and the column name is [Status] and this column values are 1 or 2 . I am trying to find the query that ...
0
votes
0answers
28 views

Application is hanging when database upgraded from SQL Server 2000 to SQL Server 2008 R2

Presently we are working with SQL Server 2000, the database is perfectly working with our software for retail sales counter application developed with VB 6.0. But after upgraded to SQL Server 2008 R2, ...
0
votes
0answers
12 views

Sql Server 2014 AppRole not able to create temptable in tempdb

we have created Application Roles in sql server 2014 and grant the "Execute" permission on the tables and stored procedures. when i execute sp_setAppRole and then the stroredprocedure. the simple ...
0
votes
1answer
22 views

Optimizing a DMV query

I have found a query that is a major performance issue in my environment. I looked at the actual execution plan for this query and found out the main problem is the remote scan (98%). Its remote ...
-1
votes
2answers
28 views

SQL Server Temp Database Monitor Tools [on hold]

Please suggest best tool to monitor temp db activity to find the objects which have excessive temp db usage.
-3
votes
0answers
30 views

Backup and Restore

What are the Negative Aspects backup and Recovery in sql server Over these points. Full Backup and Restoration Point in Time Restoration Restoration in Same Instance Restoration in Different ...
1
vote
0answers
10 views

Merge Replication: Updates to Schema

We have a main SQL Server which replicates to two backup servers via continuous merge replication. There are regular updates to the schema. Regular changes include: Adding new tables and ...
0
votes
1answer
22 views

SQL Server error log entry : Error: 17806, Severity: 20, State: 14

I have error in my log for a few weeks, I searched a lot but I couldn't found useful answer. I did closed SQL Server port for public IP, but I have problem yet. Error: 17806, Severity: 20, State: ...
8
votes
3answers
118 views

Best way to migrate a huge SQL Server database with low downtime over network

Problem definition Our database server needs to be transferred to an other datacenter. It runs on Microsoft SQL Server 2012 Enterprise (64-bit) and contains two databases of about 2TB and 1TB. ...
0
votes
1answer
38 views

SQL Server 2005 and Windows 8.1 - Getting error 1053 when trying to start sqlexpress service

We've been running SQL Server 2005 and Windows 8.1. Today for the first time we can't get sqlexpress running in services. It was running fine yesterday. Getting error 1053 - service did not ...
2
votes
2answers
44 views

Backup compression in SQL server 2008R2 and above

Recently we got a new server to take care of and found that there are two data drive: S: 1 TB where resides 10 databases(mdfs and ldf's, though they should be on different drives but that's how we ...
0
votes
0answers
16 views

How to setup a trigger for updated records

Prod database "Mother" Copy of database "Father" Here's my scenario I need help with: I have a database that has a table called User_Group table on our Production db "mother". The dev team wants me ...
2
votes
0answers
62 views

This Extended Events session works on Dev but not on Pro. Why? [on hold]

I do have the following Extended Event session on my Dev and Pro boxes: CREATE EVENT SESSION [sp_showplan] ON SERVER ADD EVENT sqlserver.query_post_execution_showplan(SET collect_database_name=(1) ...
-3
votes
0answers
36 views

SQL Pivot by data [on hold]

I have this procedure : alter proc rel_manipula(@inicio datetime,@fim datetime) as select A.codigoins, b.nomeid ,sum(a.qtd), a.dtmov from com_InsusTrans A inner join com_insus B on b.codigoins = ...
1
vote
0answers
17 views

Severity 20 Error upon disconnecting Dedicated Administrator Connection

Starting working with Dedicated Administrator Connections on SQL Server 2008 R2 servers. All is working fine (once port 1434 was opened), but am getting severity 20 errors when I disconnect the admin ...
1
vote
1answer
41 views

SQL Server 2012 stored procedure runs very slow sometimes

I have a stored procedure with a single large query which takes an ID as a parameter and returns some counts. It has quite a few inner joins and left outer joins but they are all on indexes. The ...
0
votes
1answer
30 views

Sqllogship.exe: replace with powershell?

To get more control, and to enable another transport. Is there a direct replacement in powershell?
-2
votes
1answer
29 views

Sql server sqllogship.exe…full docs?

Are the internals and all the logic of sqllogship documented? Eg so i can manage it directly, without the wizard? Or replace it with my own tool? I find this syntax (which is real, from a live SQL ...
2
votes
1answer
53 views

SQL Server : Index Seek with very high Scan Count

I have a query that joins 2 tables: Documents table, that has DocID as Unique Clustered Index DocumentsRows table, that has DocID, RowID as Unique Clustered Index When I join those 2 tables, I ...
3
votes
2answers
426 views

Storing Japanese characters in a table

I am using SQL Server 2008 R2 and I want to store Japanese characters in one of the columns of my table. Say I want to store Japanese names, how can I achieve that? Is there an easy way?