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
votes
0answers
3 views

Changing the initial size of log files

I am changing the initial size of log files but it goes back to its previous size. Can somebody please let me know what do I need to do so that it gets the new size? Thanks
-1
votes
0answers
8 views

SQL Server - Failover Cluster add node later

Is it possible to setup SQL Server 2012 Enterprise Edition in a failover cluster with a single node now, and add nodes later? The setup would include Windows already being clustered, but SQL Server ...
0
votes
0answers
4 views

connecting to a database via tsql on mac 10.10.4

I'm trying to connect to a database via tsql. I use the following command: TDSVER=8.0 tsql -S <server IP> -p 1433 -U <my username> -P <my password> Now, I know the server IP is ...
-1
votes
2answers
26 views

Creating Stored Procedure with TableName as parameter

I am attempting to create a stored procedure where a table name is passed as a parameter, as well as updating contents of the table. Here is my code I have so far. ...
3
votes
2answers
92 views

Who is using a SQL Server database user credential?

I have a database user -- let's say "x" -- and I want to know how many Windows (desktop) users are using this database user (who2 or who is only give the current result, I want to know the entire ...
1
vote
0answers
9 views

How do I check the status of an SSAS Cube that is currently processing?

When you process a cube through SSMS by right-clicking and selecting "process" it will display a window with the current status of each of your processing objects. In my current project I am using a ...
4
votes
1answer
24 views

How do I troubleshoot error 26: “Error Locating Server/Instance Specified”

I'm trying to configure TCP access to my SQL Server named instance (named SQL2012). I use management studio to connect to the database engine. I type in the server name: "tcp:localhost\SQL2012" and I ...
2
votes
1answer
17 views

SELECT all rows when a variable is null

How do you select all values when @Troop is NULL. And if there's a better way to do this all together then what would that be? WHERE DateModified BETWEEN @BeginDate AND @EndDate AND ...
4
votes
1answer
47 views

SQL Server DB become unusable overnight

Yesterday, my SQL server database was fine. Today it is almost unusable - it's slowed down by a factor of between five to twenty, depending on when I hit it. Some data was added to the server in an ...
-2
votes
0answers
14 views

Informatica vs datastage? Wich is better for a beginner? [on hold]

first of all sorry for my english. Im a web developer, i want to change my career ,i want to be an etl developer. I have a good understanding of database and i have been using mssql for the past year, ...
0
votes
0answers
15 views

Getting TEXT data from postgres throught linked server to MSSQL

I'm using MSSQL 2008 R2 with linked server to postgres 9.4. My problem is: when I select column with data type text it shows me only XXX first chars and adds (...) on the end. select description from ...
2
votes
4answers
36 views

RAM utilization

We are using SQL Server 2014 on Windows server 2008 Web edition (64 bit). Total RAM of OS is 8 GB .When we check high physical memory usage in the task manager it shows nearly 90 to 95 % full but I ...
-1
votes
2answers
11 views

How to reduce database log file size frequently? [duplicate]

I want to reduce the transaction log file size of my Database frequently. If I use transactional log backup frequently for example every 1 hour will it reduce the database log size or not? Does ...
1
vote
1answer
27 views

How do I create/publish a report in SQL Server 2014? [on hold]

I installed SQL Server 2014 with Reporting Services but I don't how understand how to create and publish a report so that users can run it on the report server on IIS. These are the programs that ...
9
votes
1answer
1k views

What's the difference between “expression <=1.” and “expression <= 1”?

Reviewing code and a case statement has expression <= 1. as opposed to <= 1 I'm not sure what the purpose of the 1. is. Any thoughts?
-1
votes
1answer
32 views

Sending an automated email through a nightly job

I had the following SQL query: select substring(PostOfficeBox,1,4) as 'Postcode' , COUNT(CASE WHEN New_accounttype = 1 THEN New_AccountType ELSE NULL END) as 'New Connections' , COUNT(CASE WHEN ...
3
votes
1answer
43 views

Any reason not to add 'rowversion' column?

The TechNet article, "Optimizing Microsoft Office Access Applications Linked to SQL Server", recommends adding a rowversion column to SQL Server tables linked from MS Access. From the Supporting ...
4
votes
1answer
98 views

Find rows where data resets

So I have a table tbl where I'm trying to pull data that increments at a variable rate. I need to identify when the data resets so I can make a cumulative value. Here's an example table: ID VAL ...
4
votes
2answers
123 views

Reseed identity column in all empty tables [duplicate]

I need to write a query that resets the identity on all tables that have an identity column and are empty.
1
vote
0answers
36 views

Why are SELECT queries in sleeping status holding open transactions

Using sp_WhoIsActive, I see that I have a lot of processes in a "sleeping" status, several for hours. I am not sure of the cause and am still troubleshooting (timeout? bad code with uncommitted ...
2
votes
1answer
39 views

Dump all Views of multiple databases in SQL Server

I need to export the views from multiple databases of an older server. (Essentially, to generate a list of views using a particular piece of SQL Server) The fastest way I've found thus far is to ...
0
votes
2answers
40 views

Cannot Decrypt the encrypted columns from the database backup on local machine

I've a SQL server 2014 running on one of our server. We're in the process of implementing security steps for our databases. I've encrypted a column in one of the table in the database on the server. ...
2
votes
0answers
20 views

Transaction log bloat when writing to table on replicated database with parameterized filter

We are observing abnormally large log writes whenever we update a table that is used for parameterized filter in a merge replication. There are a number of join filters as well. When executing a ...
0
votes
2answers
17 views

Grant execute on xp_logevent to sa using sa user to do it

Running a SQL Server 2012 CLR stored procedure with this code: const string executeLog = "EXEC master..xp_logevent @errorNumber, @message, informational"; using (SqlCommand cmd = new ...
3
votes
1answer
17 views

How to change location of SQL Server 2012 database which is already configured with a merge replication

I have SQL Server 2012 configured with merge replication. currently the location of the replication database and the .mdf and .ldf files reside in C:\ drive. The C:\ drive is now full due to that ...
3
votes
0answers
76 views

Leap second in Database system (Postgresql and SQL Server)

This night will be longer because of leap second: https://en.wikipedia.org/wiki/Leap_second My impact will be minimal in my case, I don't even know if I will recive some weird data like 20150630 ...
1
vote
0answers
21 views

Unable to connect to SQL Server on AWS

We have two Sql database servers (windows 2008 datacenter r2) with same name but with different IP. can it be possible? we are not able to connect second one which we have created after. Both are on ...
7
votes
2answers
179 views

Migrating from text and image to varchar(max) and varbinary(max)

I have a SQL Server database which contains a number of image and text columns, and I'm studying potential problems that might arise from migrating them to their non-deprecated counterparts ...
3
votes
3answers
153 views

Make a column for each count(*) in a day of the week

I have a table of people who are doing piece work. Every entry in the table has a user-ID, name, and a Date for each report they enter. I need to make a weekly report of what these people have done ...
1
vote
1answer
60 views

What is the best option to easily fix fragmented heap indexes?

I have SQL Server 2008 R2 SP2 and also SQL Server 2012 SP2 on these servers. I have a database in which there is a lot of heap indexes which are more than 90% fragmented. What is the best option ...
3
votes
1answer
37 views

Insert a range of numbers from a call to sp_sequence_get_range

Given the following code: CREATE SEQUENCE dbo.NextTestId AS [bigint] START WITH 10 INCREMENT BY 2 NO CACHE GO DECLARE @variableNumberOfIdsNeeded INT = 7, -- This will change for each call ...
6
votes
2answers
384 views

Why is SQL Server 2014 consuming so much RAM with no active data stored?

I'm running SQL Server 2014 on my laptop along with a ton of other installed applications, from Visual Studio to video games. This is obviously not a production server, but for development and ...
0
votes
1answer
33 views

Filtered index throwing error - UPDATE failed because the following SET options have incorrect settings: ANSI_WARNINGS

While executing proc1, I am getting error as below: UPDATE failed because the following SET options have incorrect settings: 'ANSI_WARNINGS'. Verify that SET options are correct for use with ...
4
votes
0answers
18 views

Move content between filestream containers

I have a server running SQL2012 with Multiple Filestream containers on a single table. I need to split one of the existing filestream containers into two parts by creating a new filestream container ...
3
votes
1answer
46 views

Mirror db from production to test and acceptance nightly or weekly

I have read this Easy or Schedulable way to move data from Production to Test and it seems not automated. I would like to have a daily or weekly push of my production server data to one or two ...
0
votes
0answers
31 views

SQL FullText Search and pdf

First of all, thank you for comming here : I wrote a script in SQL able to find words in a file, with a lot of help of some websites ...
0
votes
1answer
18 views

All actions denied on MS SQL Server on Go Daddy Hosting

i have a website hosted on GoDaddy and I need to create a database for it. So headed to the Databases section and created a MS SQL Database then on my local pc I tried to access the database via SQL ...
2
votes
1answer
34 views

Hyper V replication - vs - sql replication solutions

I need to establish an offsite copy of a number of production servers, including SQL server. Hyper V replication has been chosen as a simple solution (all servers are virtual). This is to supplement ...
0
votes
0answers
20 views

Using fetch is it possible to take the first n rows based on a grouping column

I am using pagination concept to fetch the list of records using Fetch. But I have a problem here. Since I am using split on in my API,I will return redundant records from the stored procedure. My ...
2
votes
2answers
60 views

concatenating columns from multiple unrelated 1-row resultsets

Assume I have these two queries in SQL Server 2014, both of which return one row from unrelated tables: SELECT SUM(A) A, SUM(B) B FROM X SELECT SUM(C) C, SUM(D) D FROM Y I'd like to combine these ...
0
votes
2answers
44 views

SQL Server Database recovery from corrupt database [on hold]

Last week I backed up my SQL Server by using Backup Exec 2012. I named the file "SQL Server BAK" which contained copies of my SQL Server databases. A few days ago I lost some part of my data due to ...
1
vote
1answer
51 views

Least Privilege for SQL Agent to run DISKPART

The DISKPART script SELECT DISK 1 ONLINE DISK runs fine as long as SQL Agent has admin rights on the server; otherwise the script fails with this message: Message Microsoft DiskPart version ...
0
votes
1answer
23 views

Redirect Connections to a SQL Instance

I have a LAN in which clients connect to the SQL installed on a Server with the IP address of 192.168.1.10 (SERVER_A) . I have another SQL instance installed on another server with the IP address of ...
1
vote
0answers
35 views

SQL Server vs Oracle [on hold]

I am transitioning from SQL Server DBA to Oracle DBA. I have minimal experience with Oracle, and I have found that the best way for me to traverse if by correlating terminology and database engine ...
2
votes
1answer
27 views

Table structure for validating data using category and subcategory fields

I am creating a simple budget application, and the primary table will be a transaction table that contains things like the amount of the transaction, date, account, the category and subcategory (the ...
1
vote
1answer
39 views

SQL Server: Time Series Table Design

I am creating a time series database that follows the table structure here: Storing intervals of time with no overlaps. The difference with my design is that the FinishedAt column changes every time ...
0
votes
0answers
89 views

Datediff with many dates causes poor performance?

I am a system programmer and entered the forum to understand a little more of the database. Currently I picked a query with a lot of data and I had to check there is a gap between today's date and the ...
4
votes
2answers
53 views

Strange looking where clause in sql server

I've found fa strange looking code in T-SQL. Here is the strange looking part: WHERE @term1 IS NULL OR (@term1 IS NOT NULL AND (businessLogicCondition)) The query works well, but what is the point ...
0
votes
0answers
24 views

msdb.dbo.sp_start_job got stuck in stored procedure

I have a stored procedure USP_A with logic like following: ...... BEGIN TRY exec dbo.usp_Log 'Start to run job job1' Exec @intErrorCode = msdb.dbo.sp_start_job 'job1' IF @intErrorCode <> 0 ...
3
votes
2answers
244 views

Is there a standard for naming foreign keys when two columns reference the same table? [closed]

I've always used the name FK_CurrentTableName_ReferencedTableName. I just ran into a situation where I've got a table with CreatedById and ModifiedById both pointing to the same (users) table, so this ...