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

SQL server - copying tables, constraints and indexes from one database server to another server [duplicate]

An accidental DBA, We have sql server 2012 on both of our payroll production server and development server. We have to copy few tables and indexes and constraints from the production database to the ...
0
votes
2answers
27 views

How to set host_name() value in a Sql Server Stored Procedure?

We have existing triggers which read the workstation id property of the connection string using host_name(). There are existing PowerBuilder client applications connecting to the database directly ...
1
vote
0answers
22 views

READ_COMMITTED_SNAPSHOT locking on Non-Clustered Index

I'm in big trouble with one database instance of SQL Server 2008 R2. I have this structure that I've created it to simulate my real problem: USE [sor] GO ALTER DATABASE [sor] SET ...
0
votes
0answers
15 views

How To Log Select Statements from 1 User On 1 Table Into a Permanent Log Table

We have a centralized authentication library that 100+ applications use to authenticate users. That library has its own DB credentials. It would be extremely useful to log every time that library/user ...
0
votes
1answer
38 views

How Can I restore a database to a point of time without Old backup? [duplicate]

I have a database in full recovery mode with five tables. I accidentally deleted one table. I don't have any old backups. Can I restore the database with five tables?
0
votes
0answers
24 views

Remote linked servers

I have a SQL Server 2008R2, and I want to connect remotely to a SQL Server 2012SP1, for which I am given: IP: 12.34.56.78 Login: john Password: pw1 Database: TESTDB Table: test_table The remote ...
1
vote
0answers
33 views

Non clustered index on multiple columns

I have a table which has around 50 columns. But there are only 6 columns on which we perform regular search. When I am trying to create a non clustered index on it I am getting the warning of 900 ...
0
votes
1answer
28 views

How can I log the way in which a job was started?

Using SQL Server Agent, I've created a Job that runs some SQL. This SQL does some work on one database, then adds a row to a logging table on a separate database. The Job is run on a couple of ...
2
votes
1answer
120 views

SQL Server Error log - strange date

The dates in the SQL Server error log look very strange. A subset for messages between Sep/29/2014 8:00 am and Sep/29/5:40pm show a date of Feb/16/2014. Have you seen this before? Any idea why the ...
2
votes
2answers
45 views

Can SQL Server 2014 Standard Edition Trial be upgraded to a full Core license?

If I install a copy of SQL Server 2014 Standard Trial edition can that version be upgraded (in place without a full re-install) to the full version (core license) afterwards? I'd love to get this ...
11
votes
3answers
492 views

Will increased network latency cause table locks in MS SQL Server?

If I'm making a single call to a SQL Server database over a high-latency network, will table locks occur due to that latency? Say I query table A for some records, and SQL Server has to return that ...
1
vote
1answer
56 views

Database design for an online babyShop ,Toy shop

Hi i'm designing a database for a toy shop this shop offer many products with different categories. boystoys,girlstoys,puzzles,beds,stroller, etc i designed my database as it is consists of 5 tables ...
0
votes
0answers
17 views

“ORA-00936: missing expression” setting up Oracle Publisher in SQL Server

I'm trying to set up an Oracle publisher in SQL Server so I can perform replication. I've gotten connected to Oracle, the drivers work great (I have other linked servers), I can select an article I ...
0
votes
0answers
12 views

Service Broker received an error message on this conversation

I will first have to say, I am still trying to wrap my brain around all the components of the Service Broker and how they work together, so it's very likely I'm missing something obvious... it's just ...
1
vote
2answers
37 views

VLF, Shrink and Simple Recovery

We currently have a transaction log thats been growing incrementally and has too many VLF files. I am going to follow a process of shrinking and then re-growing the log file to a suitable size to ...
0
votes
0answers
12 views

How to load data in InfiniDB from SQL Server [on hold]

i am trying to create the my datawarehouse in InfiniDB. but my OLTP is in Sql Server 2014. are there any tools available to Extract data from Sql Server, transform them and load into InfiniDB or ...
0
votes
0answers
26 views

how to disable and enable foreign key constraints for a table in sql server [duplicate]

can i disable the foreign key constraints for temporary time in SQL SERVER 2014? and how to enable the same constraints back? also i don't want to enable or disable constraints for all tables. i want ...
0
votes
0answers
50 views

Optimize query with sql server

I have the following query .its execution took 15 min .It is too much slowly . Is there a way to optimize it ? Query SELECT Id,Fees,WeekOfMonth,CONVERT(NVARCHAR(MAX), StartDate, 103) AS ...
0
votes
1answer
59 views

How to create a view joining 2 tables? [on hold]

I've got two tables that I'm trying to create a view from. The problem that I', having is that the column that I would join on doesn't have all of the same values in both tables. Here are my table ...
0
votes
1answer
19 views

Table data synchronisation across two databases

I have two databases that need a couple of tables to be kept in synchronisation. I'm not sure the best way to achieve this as I don't want to write triggers as they often get forgotten about and data ...
1
vote
2answers
54 views

Specifying per-table recovery mode

I have a table that is used for log data; the data is only INSERTed, never UPDATEd. The table has no business data whatsoever, and thus it is not a problem if I cannot recover it in case of a ...
0
votes
0answers
28 views

why I can't delete old transaction log backup files with an existing scheduled job?

I have a job scheduled in my SQL Server Agent 2008 R2 that runs every 30 minutes, Its part of a maintenance plan that runs: A daily full database backups, differential every hour, and transaction log ...
0
votes
0answers
19 views

Best index to apply for modifier query in i2b2

Below is a query being run by a tool called i2b2. I'm unable to change how the query is run. What can I do to the indices in "observation_fact" and/or "modifier_dimension" tables so that this query ...
1
vote
0answers
30 views

SQLCMD cannot find the SQL Server remotely

I am trying to use SQLCMD to remotely detach a database but for some reason it can't find the server. From the workstation, I can connect to the database instance (which is the default instance) using ...
5
votes
1answer
124 views

How do I track logins, connections, user accounts, queries, …?

I am a BI person who has been asked to step in and pretend I am a DBA. I am not a novice with databases but AM a novice at the admin type stuff. We have a SQL Server database that is going to be ...
6
votes
3answers
428 views

rebuild on clustered index, why does datasize shrink?

When we did a rebuild on a clustered index on a table that have about 15gb data in it and the datasize shrunk to 5gb, how can this be? What kind of "data" is removed? Data size i mean the "data" ...
-3
votes
1answer
52 views

Which is faster Select Column names or Select *?

I am writing a Stored Procedure which is joining 3 tables, each table have two Columns. Query 1 : SELECT * FROM [dbo].[PersonInfo] P join [dbo].[Receipt] R ON P.Id = ...
0
votes
0answers
34 views

SQL-SRS create a report that is evaluated every day

Is there any functionality in the SQL Server Reporting Services to run a query every day and graph the result or do i need to use a seperate table and cronjob to run the query and save the result plus ...
1
vote
0answers
29 views

Understanding “Date Last Modified” for “System Stored Procedures”

Whilst reviewing code on a SQL 2008R2 Instance I inspected the Date Last Modified of the System Stored Procedures of the databases. The ones in the DBO schema had a datetime that predates the ...
1
vote
0answers
36 views

SQL Server 2014 In Memory Table Creation Error

When I create an in-memory table, I get this error: The data types char(n) and varchar(n) using a collation that has a code page other than 1252 are not supported with memory optimized tables
2
votes
1answer
35 views

Create failed for Availability Group 'AGN'

I tried creating availability group (AOH) many times but no luck , It got failed every time. Please help me on this case. I configured Windows cluster (Name as 'WINCLUSTER') with two nodes. They are ...
1
vote
3answers
117 views

Restrict user to only take COPY_ONLY backups

Is there a way to force users to only take a full backup with COPY_ONLY so they don't interfere with diff backups? Dev need to take backups every now and then but they don't always remember to use the ...
0
votes
0answers
49 views

Prevent gaps while using Identity/sequence object in sql server

I have a table and I am trying to insert values in it. I want to prevent gaps in the primary key column. For primary column I have tried using Identity / sequence objects. I know that this is ...
0
votes
1answer
69 views

How to get more information from dm_exec_query_stats

I am running SQL server 2012 on windows azure VM (windows server 2012) I suspected that some of my web appliactions are attacked via SQL injection, So far i could not trace the relevant text with my ...
2
votes
2answers
168 views

Large queries are slower in SSMS

I have a large table, about 750M rows. I have an application using Entity Framework to load and parse data, a query that returns 2 million rows takes 4 seconds. The same exact query takes 8 seconds ...
3
votes
2answers
77 views

How does the PowerShell SQLPS SQLSERVER provider detect central management servers in SQLRegistration\Central Management Server Group

I'm experiencing odd behavior with the PowerShell SQLSERVER provider and the SQLRegistration\Central Management Server Group directory. Below are the behaviors. I would like to know how the SQLSERVER ...
-2
votes
1answer
55 views

How do I get to this query? SQL Server

I have a database schema : member(memb_no, name, age) book(isbn, title, authors, publisher) borrowed(memb_no, isbn, date) This is the question: For each publisher, print the names of ...
1
vote
1answer
52 views

Backup the whole SQL Server databases in one .bak file - SQL Server 2005

First I asked my question here: Migrate all databases from one SQL Server 2005 to another Many friends replied to it and I gathered lots of useful information. I have another scenario in which we ...
0
votes
1answer
34 views

Finding dependencies on a SPECIFIC COLUMN (modern way, without using sysdepends)

I need to find all views & stored procedures that consume not just a certain table, but a specific column in a table. The following "seems" to work, but there are numerous warnings to be careful ...
7
votes
1answer
96 views

SQL Server trace based on client TCP port

I have a Windows terminal server with many different users logging in via RDP to run an application. The application makes one or more connections per user to a SQL Server 2008 R2 instance. All users ...
0
votes
1answer
56 views

Slow running aggregate of aggregate query

I am looking for the total balance for all accounts that had a negative balance as of a specific point in time. I've already got the code below, and it works, but works horribly. The transactions ...
0
votes
0answers
42 views

SA Admin SQL-Server 2012 x64 keeps changing constantly

I know this is a newbie question, but really I can't find some precise info on this issue. I'm trying to figure out how to create a new user with admin server role on SQL Server 2012 x64. I mean, I ...
0
votes
2answers
55 views

How I convert it to SQL Server please [on hold]

How can I create a SQL Server equivalent of this query? SELECT m.ItemId ,item.NAME ,m.Expiratory ,m.t AS TotalNumber FROM item ,( SELECT ItemId ,Expiratory ...
3
votes
0answers
31 views

PowerShell Move-Item command made SQL and Windows entirely unresponsive

A LUN expansion completed overnight on our 15k FibreChannel VMAX SAN from 4 to 13 terabytes. This morning I attempted to move a 4.5 terabyte file from a temporary SATA LUN to the newly expanded LUN ...
0
votes
1answer
45 views

Raising an Alert with THROW

It seems to me that SQL THROW is missing a crucial feature that RAISERROR has, and that is the abilty to use WITH LOG so that an Alert can be fired when the error number is logged in the Application ...
1
vote
1answer
68 views

How to compare data between staging and operational tables?

I just want to ask how to compare two database tables, staging vs. operational tables. After we did the transformation and convert it to correct datatype like convert flag column (Y/N) nvarchar to ...
2
votes
2answers
78 views

Reviewing all code on a SQL Server Instance

Shortly our development team will be moving an existing SQL Server 2008R2 instance into our Production environment. Ahead of this I have been asked to review all the code on it for anything malacious ...
0
votes
1answer
27 views

Need some help for choosing the replication type

My target is to create a replication process for the following Please suggest which type of replication is suitable for this architecture, See the image below
2
votes
5answers
120 views

Transferring large amount (84 million rows) of data efficiently

I have about 84 millions rows. Of those all of them needs to be transferred to a separate database on the same server, then I delete to delete about 60 millions rows from the source database. The 84 ...
4
votes
1answer
105 views

Order by bug on SQL Server 2005 vs SQL Server 2012

I have a query generated by entity framework that returns wrong results on a SQL Server 2005 db (Microsoft SQL Server 2005 - 9.00.5000.00 (X64)) but good on SQL Server 2012 (Microsoft SQL Server 2012 ...