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)

1
vote
2answers
31 views

SQL view, how to append results from tableB with the results from tableA

I am using SQL server 2012. I would like to generate a sql view where I got all records from tableA. And below these results I would like to have the results from tableB. There are no relations ...
0
votes
1answer
32 views

SQL Server xp_cmdshell: account's access changed - how to avoid restarting the service?

A T-SQL script is running an xp_cmdshell call to stop a local service through Powershell's Stop-Service, say, like this: exec xp_cmdshell 'powershell Stop-Service -InputObject (get-Service -Include ...
1
vote
0answers
32 views

Clarify unique constraint and index, cannot grasp the concepts to 100% [duplicate]

When reading about UNIQUE, I understand the concept but when it comes to the practical part of it, I get confused and I'm unsure of what it means. What I do understand, is that there are two ways to ...
0
votes
1answer
31 views

SQL Server 2012 Express SP1 install still not 11.1

I run the SQL Server 2012 Express SP1 install and it succeeds. After I have rebooted my computer, I do a select @@version But still I only have version 11.0.21600.64. I have tried this on two ...
0
votes
0answers
20 views

Garbage DB Objects Cleansing

How do I find in use db objects from all application pages is there any tool or trick I can use, just like we do search in Visual studio for an object in entire solution
2
votes
1answer
67 views

Is DBCC SHOWFILESTATS an accurate way to see unused space?

We have a few tables each with near 100 million rows of data. A co-worker has these tables setup with partitions based on a date field. Our disk space is starting to run low and knowing that ...
0
votes
1answer
35 views

AWS RDS MSSQL Extremely Slow compared to EC2 with MSSQL

Background - I built a tool which grabs a lot of data from multiple third party APIs and stores it in a MSSQL DB. Then, I built a visualization to display this data in tabular and chart format. ...
-1
votes
1answer
52 views

Add text prefix to SQL server query results [closed]

Using SQL server I need to add text as a prefix to the query result. SELECT COUNT(*) + 1000 NUMBER, + 1000 VALUE FROM WI_WorkflowInstance WHERE WorkflowDefinitionId = 10238 So my current result ...
0
votes
2answers
42 views

How can I add back Identity to a column?

I have a table: CREATE TABLE [dbo].[Question] ( [QuestionId] INT IDENTITY (1, 1) NOT NULL, [QuestionUId] UNIQUEIDENTIFIER DEFAULT (newid()) NOT NULL ); QuestionId ...
-1
votes
4answers
212 views

Database/Storage engine suggestion for a project involving heavy inserts?

I am looking into a project which involves large number of inserts daily.I will have a list of user's (for example a user set of 500k ) , for which I need to monitor daily certain activities ...
2
votes
1answer
37 views

Centralized master data shared among other several DBs

I'm researching and investigating about all possible ways to create a master data database for my portfolio of applications. To give you a quick overview, an example will come in handy: I want to ...
1
vote
1answer
49 views

Find out which client IP and Query using highest network Bandwidth from SQL Server

I want to know which clients (IP or Hostname) are taking highest bandwidth from server and by what query they are taking high bandwidth. Field Names: Client Name/IP, Query, KB transferred, ...
1
vote
0answers
40 views

What are the “additional actions” available for “Recovery Pending” databases?

I've used powershell to run a sql script on several databases on a test server. Disk space was low, so the script failed on 34 out of 75 databases. All fair enough. In any case, afterwards 10 of my ...
-1
votes
0answers
28 views

Generate identity id based on primary key column

i have a table that is structured like below. -------------------------------------------- Id MarketId MarketOrderId OrderId ... 1 1 1 1876870000000000001 2 1 ...
1
vote
4answers
111 views

Is it ok to change from full recovery to simple recovery in Sql Server

I have an old database - a users membership/role that was setup automatically by an ASP.Net 2 application years ago: The Sql Server version currently running is: Sql Server 10.5.1617 The users ...
2
votes
3answers
155 views

Transaction log back up

Another accidental DBA question. We have a DB instance that host 10 databases. This DB server doesn't have any maintenance plan set up. I want to set up a decent maintenance plan that will do a full ...
0
votes
2answers
57 views

Invalid date format in SSIS

I am using BIDS to export data from Oracle to SQL server. I am using OLEDB source and destination. I have around 6 datetime fields in ORACLE out of which two fields give no problem while 4 fields give ...
0
votes
1answer
79 views

Setting up my first SQL Server cluster

I've been working with SQL Server for about 6 years and have completed a couple of certification exams so I consider myself reasonably knowledgeable. I am however, about to spec and build my first ...
0
votes
1answer
33 views

Finding Item's distribution over customer routes

Please help me to find a solution. I have two tables [CustomerMaster and SalesData] as shown below. CustomerMaster | CODE | NAME | ROUTE | DIVISION | |------|------------|-------|----------| ...
0
votes
3answers
65 views

How to Make a Copy of a database?

I have an sql server database and I want to make a mirror copy of it on my local computer. I tried to use the copy database wizard but it fails. It seems me to look at the event log for the reason but ...
1
vote
0answers
39 views

Scheduling a task to run after a SQL SERVER 2012 executes a different set of scripts?

Im working on a project for a job I am interning for. I've had a few months of database design. I am still learning all the techniques. I am currently trying to schedule a console app to run every ...
31
votes
8answers
7k views

Is select * still a big no-no on SQL Server 2012?

Back in the days of yesteryear, it was considered a big no-no to do select * from table or select count(*) from table because of the performance hit. Is this still the case in later versions of SQL ...
7
votes
2answers
210 views

MS SQL Server Cumulative Updates - Best Practices

I'm trying to get an idea of what recommended best practices are for the SQL Server Cumulative Updates. Currently, we run on the idea of "do nothing unless an issue fixed by the CU is one we ...
0
votes
1answer
40 views

Join reorders results [duplicate]

Is there any particular reason why adding an additional join to an ordered table would reorder the result set? Using a left join on the existing result set table-valued function is similar to below ...
1
vote
0answers
62 views

Database Archival Process [closed]

I am designing a database archiving process - which is a automated process. Do you have any advice for how to accomplish these goals? Below are my thoughts : create another clone database ...
2
votes
2answers
74 views

Retrieving data from SQLServer mutitenant database

I have a multitenant database with something like the following naming structure: Sch1.Logins => 2 records Sch2.Logins => 4 Records Now I want to be able to "Execute as" different users , say ...
-1
votes
0answers
22 views

How to connect to MS Access x86 from LocalDB x64 as Linked Server via Management Studio?

I have x64 CPU so i cant install x32 Local DB (throws me an error). So i installed x64. I have installed x86 Office 2007 with Access DB. I installed x86 Microsoft.ACE.OLEDB.12.0 Driver (Microsoft ...
0
votes
1answer
52 views

How to deal with async calls to a stored procedure that updates data

I have asynchronous calls from Entity Framework to a stored procedure. The stored procedure selects data to a temp table and later on, it updates the real table. This works fine for sync calls. The ...
3
votes
2answers
81 views

How to update ID=null values in table to incremental counter values?

On SQL Server 2012, i've got an intermediate/staging table for merging existing with new data, where I want to insert numeric IDs for newly created rows: ID NaturalID Comment 1 ...
1
vote
3answers
235 views

What's the most efficient UUID column type

For storing a 128 bits UUID there are multiple storage options: a byte[16] column two bigint/long(64 bits) columns a CHAR(36) column - 32 hex digits + 4 dashes. a UUID database specific column, if ...
1
vote
1answer
97 views

How to repair backup of .mdf file database?

One of our clients gets the following error when trying to backup a database: System.Data.SqlClient.SqlException: SQL Server detected a logical consistency-based I/O error: incorrect checksum ...
0
votes
1answer
42 views

Best Practice For Data Views with Linked Server in SQL Server

In SQL Server, I have to design a View that I can map on a DBML file in order to dynamically retrieve information from the database with multiple conditions to filter. The problem is that I have to ...
1
vote
0answers
29 views

SQL Server Logs > Windows NT > Security

I don't know how to trace down what is happening on one of our SQL Servers. If I look in the Windows NT > Security section of the SQL Server Logs I see the same three entries repeated every minute. ...
2
votes
1answer
77 views

How to get server cpu, memory, network usage from SQL Server

For reporting purposes, I want to get SQL Server box CPU, memory, network (not SQL Server process alone) and show it in report. Do you have any idea how to pull this? My initial thoughts are run wmi ...
0
votes
1answer
28 views

How to Sum Each Enum Value in a Different Column and Don't Repeat Person's Name?

Let's say I have a table with SellerId, DateTime, ProductType to register each time a a Seller sells a product. The ProductType is from ENUM type with { 0=Phone, 1=Recharge, 2=SimCard }. Then I have a ...
1
vote
1answer
42 views

Table Variable and Database Scope

I am a junior DBA, and I am still confused by database scope. Now I am learning about local/global temp table and table variables. I saw an example as following: declare @T1 as table ( col1 ...
2
votes
1answer
56 views

Listener pointing to incorrect AlwaysOn Availability Group

All, Thanks in advance I have two instances of SQL Server 2012 SP1 on a three node WSFC with a HAdr group on each instance with a corresponding listener. Instance 1's listener points to Instance 1, ...
0
votes
0answers
86 views

Error attaching mdf file to SQL Server 2008 R2 [closed]

When I want to attach a .mdf file to SQL Server 2008 R2, but I get the following error: Attach database failed for Server 'BABAK-PC'. Unable to open the physical file ...
1
vote
1answer
32 views

SQL Server: affect other transactions?

I'd be surprised if this existed, but will ask just in case. Is there some mechanism which would allow one transaction to affect another (outside) transaction? For example: BEGIN TRY BEGIN TRAN ...
12
votes
1answer
133 views

“Cannot create a row of size 8074 which is greater than the allowable maximum row size of 8060” while altering the table

I am trying to alter a column in a table. The existing table is like this: CREATE TABLE [dbo].[table]( [id1] [int] NOT NULL, [id2] [int] NOT NULL, [id3] [int] NOT NULL, [name] ...
2
votes
1answer
66 views

SQL Server Replication questions

This is kind of the part 2 of Replicating a SQL SERVER database & Optimization that I started earlier this week, but I believe it owes to be a different questions now that I have a clear idea of ...
2
votes
1answer
41 views

What does role db_owner allow

I have been trying to troubleshoot a login that is not able to view certain tables in a SQL Server 2012 database. In doing so I find I don't quite understand what membership in the db_owner role ...
2
votes
1answer
71 views

Using scope_identity() to get ID “during” insertion of row?

I have a column that has an ident_current constraint on it to populate another column, like so: alter table dbo.Employee add constraint dbo_Employee_D1 default ident_current('dbo.Employee') for ...
4
votes
3answers
117 views

Virtual Log Files (VLFs) Fragmentation

I have a database with 160 VLFs. How do I determine whether the VLFs are fragmented? Further, how do I find the percentage of fragmentation? Another thing that I want to confirm: Are the following ...
7
votes
5answers
508 views

Performance tuning a Great Circle distance calculation

I have a query that I am using to find locations that are within 1km of a known point. To do this, I am using the Spherical Law of Cosines formula with my latitude and longitudes. Currently, the ...
0
votes
1answer
23 views

What is the best solution to implement to replicate a database, with a purging process is in place

I am planning to implement a solution solution to create a separate database for reporting purposes (read only). I thought of implementing transactional replication to solve this problem, however I ...
1
vote
1answer
47 views

Replicating a SQL Server database & Optimization

We got a database of approximately 100-120 GB on a server with 128GB ram, while the db is sitting on an 256 GB SSD drive. The bulk of the database space is spent on the tables below: Page_contents ...
1
vote
1answer
57 views

Complete Failover Cluster Failure SQL Server 2012

We have experienced a full cluster failure on our 3 node cluster running SQL Server 2008 R2 with 7 SQL Server instances. It started when we rebooted one of the nodes and it returned an error: Node ...
1
vote
2answers
297 views

Adding Data to Multiple Tables Using Single Query [closed]

I want to add data to multiple tables using a single INSERT INTO query, can I do this? Please guide me and provide me syntax if this is possible.
1
vote
0answers
69 views

Error while Installing SQL Server 2012

I am facing the problem while installing SQL Server 2012 on my Lenovo ThinkPad. The same was working till now. However it seems, registry has been deleted. So I try to re-install same. But have no ...