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
4answers
112 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
156 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
63 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
80 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
211 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
63 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
75 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
25 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
54 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
84 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
243 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
98 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
83 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
62 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
91 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
135 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
68 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
120 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
510 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
24 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
52 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
64 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
338 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
74 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 ...
0
votes
0answers
22 views

Does SQL Server always parsing case switch in same order [duplicate]

Does sql CASE switch statement always processing (parsing) expressions in same order as it was written. If I write select case when 'a'<>'b' then 'a is ...
0
votes
0answers
37 views

msdb 'backupset' log history

One of our production server‘s backup job is getting failed for one DB because of Low disk space when I looked into ‘physical_device_name’ column in ‘msdb.dbo.backupset’ to get the path of backups I ...
1
vote
1answer
44 views

High Service Broker queue

My production database suffers from a large Service Broker message queue. It is around 2 million. I would like to decrease it as small as possible. I have tried dbcc ...
1
vote
1answer
38 views

Get data per Customer and per Date

How will I get the all the date even though there is no order between two dates? Sample Table OrderID | Date | CusID 33942 | 6-21-2014 | 6005 34059 | 6-20-2014 | 4003 53333 | ...
0
votes
1answer
26 views

Using existing SQL Server credentials for log shipping reporting purposes

I have set up log shipping, but I don't see how I can reset orphaned SQL Server credentials on the destination server as databases are in standby/read-only mode. I am getting push-back on ...
1
vote
1answer
44 views

Migrate Management Data Warehouse to a New Instance

Is there a defined procedure to follow for moving a SQL Server 2012 management data warehouse to a new server\instance? We intend to setup an MDW on a test sql server instance first, but will then ...
1
vote
2answers
46 views

ownership of users

Two related questions: Using SQL Server 2012, how does one find out who/what owns a user, and how can you set the ownership for users, if at all? To add a couple of questions: 'how to' for both of ...
0
votes
0answers
12 views

Unable to take ownership with 'take ownership' permission

I have given a user permission to 'take ownership' of an object, but the user still cannot take owner ship of it by using the ALTER AUTHORIZATION ON object command. Is there another way for the user ...
1
vote
1answer
52 views

Map a Login to a User that was Created Without Mapping to a Login

This question has been asked before, but I didn't see any answer (http://stackoverflow.com/questions/6468813/assign-a-login-to-a-user-created-without-login-sql-server) How does one map a login to a ...
1
vote
1answer
84 views

SQL Server Authentication vs Windows Authentication [closed]

Good Afternoon, I've been working on a problem where connecting to a remote default SQL instance (using the server's IP address) via Windows Authentication has been taking a lot longer than SQL ...
2
votes
1answer
227 views

Can I upgrade SQL Server 2008 R2 Standard to SQL Server 2014 Developer?

Is there a migration path to upgrade SQL Server 2008 R2 Standard to SQL Server 2014 Developer? If so, are there any pain points? If not, how would you recommend I proceed? The context of this ...
1
vote
0answers
46 views

Quickly edit MS_Description in SSMS

We document our database by storing descriptions for tables, columns, stored procedures etc. in the MS_Description extended property. It's easy enough to handle by scripting, but what I miss is some ...
-2
votes
1answer
43 views

how to select column3 from rec1 value which is matched to column1 val in rec2

i am having following scenario : col1 col2 col3 10 2 13 13 4 14 14 5 15 15 6 16 form the above given table col3 value(13) in row1 is seen in col1 value(13) in ...
0
votes
1answer
30 views

Should I add it as an additional column or a seperate table?

I have a table in my SQL Server thats called "Regions", it has information about 9 regions and the 10th row holds the info about our Division. Now that we will be merging another 2 divisions with its ...