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
0answers
25 views

Must declare the scalar variable “@Shopping” [closed]

DECLARE @Shopping xml; SET @Shopping = '<?xml version="1.0" encoding="UTF-8"?> <root> <row> <EmpID>1</EmpID> <EmpName>User1</EmpName> ...
5
votes
1answer
143 views

Sudden poor SELECT performance on a large table with existing indexes

My company uses a software suite in which the only thing I can truly modify is the database. We've always had performance issues (mostly hardware problems that we hope to resolve soon), but lately ...
2
votes
1answer
25 views

Determine which trace flags are set as a startup parameter vs. enabled globally?

Probably a quick question. We are looking to test out a couple trace flags as startup parameters in our environment, and while I know we can use DBCC TRACESTATUS to get global-scoped trace flags, it ...
0
votes
0answers
29 views

Retreive data EXEC SQL for temp table? [closed]

Is it possible to retrieve the data from usage of EXEC SQL and paste the data inside of a temp table? If yes, can you possible show me? I have a sample of data in this link ...
0
votes
1answer
34 views

Usage of ExecSQL in UDF?

Problem: is it possible to use sp_executesql or EXEC inside of a user defined function? Thanks!
0
votes
2answers
53 views

SQL Server 2008 R2 - Memory Allocation

We have a SQL Server 2008 R2 instance that is running on a Windows Server 2008 R2 Enterprise server that has been allocated 128GB of memory. However, it maxes out at 70GB. Can anyone tell me how I can ...
2
votes
2answers
48 views

migrate db's - best way to mirror or replicate a full database

I would like to mirror/replicate my databases to the cloud. The cloud is setup using VPN to my actual machine. I am a bit confused by the options I have and would like to get some light into it. My ...
0
votes
1answer
42 views

How to create a dummy Linked Server in SQL Server 2012

I have a database in two different production servers. I want to keep the schemas consistent between the two. One has jobs that call stored procedures that reference a Linked Server. The other does ...
4
votes
2answers
72 views

Shared connection pool in SQL Server and prevention of cross-database queries

Microsoft recommends that a shared connection pool should be used when running e.g. a SaaS software with one database per customer but with a shared codebase to prevent pool fragmentation: ...
0
votes
2answers
26 views

xml parameter to distributed query - difference between SQL2005 & SQL2012

I have inherited an old SQL2005 Enterprise database (on Windows 2003) that allows an xml parameter to a distributed query such as this: exec sp_executesql 'exec [server].[database].dbo.sproc ...
2
votes
2answers
111 views

Mixed SQL Server instances with static and dynamic ports

Let's assume someone has 5 different SQL Server instances running on a server. Initially all are using dynamic ports. Is it safe to restrict one of those instances to use the static port 1433 while ...
0
votes
1answer
33 views

SSRS email Subscription Not Working but local smtp is working

SQL SERVER EDITION- 2008 ENTERPRISE EVALUATION EDITION Operating System- Window Server 2008 R2 I've Created Local Smtp to use gmail id for Subscription of SSRS Report by Email as we don't have an ...
-4
votes
2answers
49 views

About Criteria in T-SQL Statement [closed]

Today the code is: select * from datatable where id is not null However, if I want to retrieve data of id I want to add another criteria in where statement I'm trying to improve the code below ...
0
votes
2answers
21 views

Unable to delete Log Shipping configuration

I need some help with my SQL 2005 server. I am trying to setup log shipping, I've successfully done so for all user-databases, except one. From the looks of it, it once had log shipping configured ...
1
vote
1answer
35 views

Migration from SQL Server 2012 Ent to SQL Server 2014 STD

We recently migrated from a traditional hosting environment with a back end of SQL Server 2012 ENT to an Azure VM running SQL Server 2014 STD. We did all the cool stuff with BPEs on SSD, etc. The ...
0
votes
0answers
39 views

Why does a table take more space in SQL server than in Teradata?

Is there any reason for a table to occupy significantly more space in SQL server than Teradata? The rows and data structure (columns, data types, data type length) are same, no extra objects like ...
0
votes
0answers
34 views

MSSQL Query table returned all rows but keep executing for long time

After database migration to a new server, my web application got many timeouts on particular table, I suspect there is some problem with the table. When I simply try a small table (of 3 thousand ...
-2
votes
1answer
36 views

Usage of COALESCE? [closed]

Today: table abc a b c d ---- ---- ---- ---- 1 null 2 3 null null null 7 null 5 null 4 1 = e 7 = b 5 = f 3 = i 2 = w 4 = o The Goal is to retrieve this ...
1
vote
1answer
40 views

CheckDB error 9003 SQL server 2014

Currently I am restoring SAN snapshots to another server nightly and running weekly checkdbs on that test server. The checkdb is throwing the following errors. The log scan number (105217:402:0) ...
1
vote
2answers
51 views

Unable to restore database backup becouse it is accessed by other connection

--first command use master Go -- second command ALTER DATABASE MyDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE Go -- Third command RESTORE DATABASE [MyDB] FROM DISK = ...
0
votes
1answer
23 views

SQL Server Express 2008 R2 Configuration Manager How To Find It

I run Windows 8.1. I installed SQL Express 2008 R2 over a year ago, but now need to access it from another machine. My problem is that the Configuration Manager (SQLServerManage10.msc) is not on my ...
2
votes
2answers
117 views

What is the recommended method to move databases?

I want to know the recommended method to move a database and data from dev to pre-prod to production in SQL Server. The databases are originally created in MS Access so some upsizing to SQL Server ...
0
votes
1answer
21 views

backup to NAS using sqlcmd

I've been searching for possible duplicates before asking but can't find anything. The closest was Backup SQL Server To Nas but not exactly my case. We have a brand new Synology NAS configured, due ...
2
votes
1answer
33 views

Is worth change databases collation from Latin1_General to Modern spanish, migrating to a new server

We are migrating 3 databases tables from Sql Server 2000 to a new sqlserver 2014. I know that for new databases the recommended Collation for spanish is Modern_Spanish. But what is the recommendation ...
7
votes
1answer
850 views

Why 0 is equal to empty string?

I need some help in finding why the following T-SQL statement returns 1 (true): SELECT IIF( 0 = '', 1, 0) I guess someone has change an ANSI option like SET ANSI_NULLS or something else that is ...
1
vote
1answer
23 views

AlwaysOn Listener and DNS

We have two DNS servers which replicate entried between them and we recently had a DNS issue where some of the listener addresses were removed from one of the servers only. At that point some of our ...
1
vote
2answers
35 views

Restore a newer filegroup backup

So this is my set up. In our data warehouse we have mostly tables that are filled with data from a ETL-process. We do not take backup of these tables since we have an option to do a full reset using ...
0
votes
1answer
44 views

Need to migrate a SQL Server 6.5 Prod to SQL Server 2012 in VM

We are planning to move our SQL Server shop to VM(VMware). We still have one SQL Server 6.5 in production. What would be my course of action/path to move/migrate 6.5 to virtualized SS 2012? It's the ...
0
votes
2answers
44 views

Database Engine vs. Database location

I'm a new user of SQL Server 2008 R2. We work in a Windows domain environment and I have access to multiple servers - by this I mean I have various drives mapped to various servers. I have SQL ...
0
votes
0answers
23 views

Timeout too long on SQL Server 2012 Linked Server to MySQL

We have a statement in a SQL Server 2012 stored procedure that is an INSERT into a temp table from SELECT using OpenQuery to pull data through a Linked Server from a remotely hosted MySQL database. ...
0
votes
0answers
39 views

MSSQL - GRANT EXECUTE permission inside stored procedure

Environment SQL Server 2012 (11.0.2100.60) Situation user is allowed to execute a number of stored procedure; user is readonly denywrite one of stored procedure has an EXECUTE statement; The ...
11
votes
0answers
135 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
1answer
28 views

Best way to remap database login to new database user and keep previous database user

Here's what my environment looks like: Active Directory (mydomain.local) - Groups - group01 - Members - aduser01 SQL Instance - Logins - mydomain\group01 - ...
0
votes
0answers
17 views

Steps to stop and start SQL Mirror server instance in Amazon EC2

I have to stop and start the SQL server instance running on AWS. What are the steps that needs to be followed to get the Mirror server working again. Would the steps described here Should I pause ...
0
votes
3answers
46 views

Load specific element from XML

I have the following xml: <root> <123 type="line"> <aa type="item"> <value>1</value> </aa> </123> <234 type="line"> <bb type="item"> ...
-1
votes
3answers
39 views

Pasting data from Excel table takes very long [closed]

I use SQL Server Management Studio 2012 to import data from Excel sheet to a table on SQL Server. I use the most straightforward way that I just Ctrl+C a table in Excel and Ctrl+V in table edit window ...
0
votes
1answer
27 views

How to serialize on SQL server metadata?

I tried to find an answer in Kalen Delaney's SQL Server Concurrency but there is no mention of metadata. The problem is how to ensure that only one of these reads and index creates executes from one ...
-1
votes
0answers
10 views

TO SSIS PAckage when it found a special characters in the column

I am trying to create SSIS package to fail when it founds a special character. otherthan SCRIPT TASK what transformation we can use? Please help me out. -Ram
3
votes
1answer
80 views

CREATE NONCLUSTERED INDEX ONLINE, DROP EXISTING

I want to add three included columns to an existing non-clustered index. With that I'm solving performance issues in the database. Here is some information about the index: Rows: 112 Millions Disk ...
0
votes
1answer
53 views

Can SQL Server replication be used for Point-of-Sale (POS)?

We are looking for a solution that will synchronize the databases of our POS. The scenario says we have 3 POS with SQL Server Express installed on each machine. We want these databases to be in-sync ...
1
vote
1answer
64 views

Another bad execution plan!

This is running SQL Server 2012 SP2 Enterprise Edition. I have a nightly ETL job that, for a specific SP, is taking way too long to run. During my investigation I found that it was a specific update ...
0
votes
1answer
47 views

How do I pass or fail a job in SQL Server agent based on a return value from a stored procedure?

What do I need to do in order to execute a step in a SQL Server 2012 agent job that returns a bit value back? Basically, I want to fail the job or pass to the next step based on the results from the ...
2
votes
1answer
35 views

When using DBCC INPUTBUFFER to find query associated with spid, is there a way to show variable values of that query?

I have been troubleshooting an issue within a database that has some serious blocking issues. I found the command DBCC INPUTBUFFER a while back that allows me to see the query run for that spid. I ...
6
votes
2answers
67 views

Select lowest ID and calculate deviation from the lowest

I'm trying to create a view. I have some data in my SQL Server database, and I want to order them by their mark1 and mark2. Now when I sort them I want to select the mark1 who has the lowest mark2 and ...
4
votes
2answers
96 views

Transaction log is full due to 'CHECKPOINT' for DB in simple recovery model

For one of our DB's on SQL server 2012 RTM, We could not perform almost any troubleshooting step as the error says: " Transaction log is full due to 'CHECKPOINT" This being a dev database, its ...
0
votes
1answer
19 views

How do I merge two rows only if there is the TagWidgetIds are same but the tagValues are different?

I have this stored procedure which generates the following output. The query which generates the output from the stored procedure is as follows: SELECT tat.[agent-id], ...
2
votes
2answers
44 views

List the underlying objects used in a SQL Server Function

I use the below to get a list of underlying objects in a View: SELECT view_name, Table_Name FROM INFORMATION_SCHEMA.VIEW_TABLE_USAGE WHERE View_Name IN ( 'View1', 'View2' ) ORDER BY ...
0
votes
1answer
33 views

Having trouble designing my preferred backup scheme

First some background: I have two Windows servers running MS-SQL-2014 setup in an availability group (synchronous auto-failover, preferred backup on secondary). They host many databases. Right now ...
2
votes
2answers
38 views

How can I query a remote server using a local function?

I am querying a remote server for which I only have read permissions. I set up a local server with a UDF (since I cannot create one on the remote) that I would like to utilize for the query. When I ...
0
votes
0answers
25 views

Mass update taking to long [duplicate]

After searching through many posts I have come up with the code below to handle updating 200,000 to 2 million records daily. The problem is its still takes hours to complete, I have tried to narrow ...