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
3 views

When should I NOT set the Maximum Server Memory option in SQL Server?

In SQL Server, I normally set the Maximum Server Memory setting to one of the popular best practices, such as leaving 10% or 4GB, whichever is higher. ...
0
votes
1answer
13 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
0answers
11 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
21 views

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

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

SQL Express 2012 SP1 install still not 11.1

I run the SQL Express 2012 SP1 install and it succseeds. 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
8 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
0
votes
1answer
28 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 ...
-2
votes
1answer
43 views

Add text prefix to SQL server query results

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
31 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 ...
0
votes
0answers
32 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
33 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
31 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, ...
0
votes
0answers
25 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 ...
0
votes
0answers
20 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 ...
-2
votes
1answer
31 views

SQL Query customername [on hold]

I'm very new to SQL Server and hope someone can help me out a bit. I hope this is as simple as I think it is ... :-) I have a Microsft SQL Server 2008 R2 database, free edition. The database is a ...
1
vote
4answers
99 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
2answers
135 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
26 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
64 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
31 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
5answers
52 views

Should I use two tables for users and authentication? [on hold]

I'd like to know if it's a good idea to create one table to store user login and password and another table to store all other user data instead of creating just one table where all info about user ...
0
votes
0answers
11 views

Is there easy way to connect postgres mysql and neo4j in one hosting database [on hold]

I was Creating a Website where user can host pages blogs and such while perfoming ,this task i found some difficuties when i was trying to create user id in different task with a single click ...
0
votes
3answers
61 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
votes
0answers
32 views

How to Repair Corrupted SQL Server Backup File? [on hold]

My sql server backup database file has got damaged, please recommend any solution.
1
vote
0answers
35 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 ...
25
votes
8answers
5k 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
188 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
34 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
52 views

Database Archival Process

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
68 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 ...
0
votes
0answers
9 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
0answers
15 views

How to Uninstall Management Studio 2012 ? Error: minimum requirements does not meet [on hold]

I installed management studio 2012. First in x64 version, but i cannot connect to x86 Access file so i uninstalled it. Then i Installed x86 version but some other architecture error occure, i dont ...
0
votes
1answer
40 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 ...
2
votes
1answer
47 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 ...
-4
votes
0answers
43 views

This query generates separate results.I want these results to be generate in a group using UNION ALL [on hold]

DECLARE @today DATE SET @today=GETDATE(); DECLARE @t1 DATE; DECLARE @D1 DATE; DECLARE @D2 DATE; SET @t1 = (SELECT DATEADD(dd, -DAY(@today) + 1, @today)) SET @D1 = @t1; SET @D2 = GETDATE(); DECLARE ...
1
vote
3answers
183 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
71 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
0answers
35 views

How to insert data into SQL Server database using Powershell [on hold]

I am trying to get disk space, memory, cpu usage of server from Powershell and insert it into a SQL Server database. Being totally new to Powershell, I'm not able to proceed further. My requirement ...
0
votes
1answer
27 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
23 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
52 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
24 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
26 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
0answers
32 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
1answer
48 views

Error attaching mdf file to SQL Server 2008 R2

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
31 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 ...
0
votes
2answers
162 views

sql server query too long [on hold]

ALTER TABLE [dbo].[INVENTDIM] ADD CONSTRAINT [I_698DIMIDIDX] PRIMARY KEY CLUSTERED ( [DATAAREAID] ASC, [INVENTDIMID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB ...
11
votes
1answer
120 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
55 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
35 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 ...