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

Exporting SQL Server DB from my laptop to AWS RDS

I am following this tutorial from AWS to export a SQL Server database that currently sits on my laptop to Amazon Web Services RDS. In particular I am trying the Generate and Publish script wizard ...
0
votes
2answers
10 views

Why can't I get the available free space after shrinking?

My disk drive was full. So I deleted some records. Then I tried to shrink and it indicated available free space of around 5GB as indicated in the below image. Once I ran the shrink for data file, ...
-2
votes
1answer
14 views

Implication of owned schemas for a user having db_owner privilege

Importance of "Schema owned by the user"? The user is db_owner for the db. Is it required to select owned schemas?, or else it will own all the schemas as it is a db_owner? Please provide me a detail ...
1
vote
1answer
23 views

Cannot create a row of size XXXX which is greater than the allowable maximum row size of 8060

I have a scenario where some inserts/updates are failing due to maximum row size of 8060 limitation. I have a table with lots of varchar 250 to 500 columns, numerics, datetime columns. I was trying to ...
6
votes
1answer
41 views

SARG cardinality estimate, why not full-scan?

Why there is no full-scan (On SQL 2008 R2 and 2012)? Test data: DROP TABLE dbo.TestTable GO CREATE TABLE dbo.TestTable ( TestTableID INT IDENTITY PRIMARY KEY, VeryRandomText VarChar(50), ...
0
votes
0answers
10 views

How Columns_update() Function Works in Trigger To Find Updated Columns Name

I am in confuse about trigger function Columns_Update(). i Have Basic Idea about this function that it returns a varbinary and it is use to get updated Columns in Trigger even i have Find The code ...
0
votes
1answer
16 views

SQL DB Permissions so anyone can modify the DB

I'm teaching a class on SQL Server 2014, and want students to be able to restore a Db I give them and then be able to take ownership and modify tables, and also to view the database diagram. ...
3
votes
1answer
29 views

SQL Server: UPDATE permission for table variable

SQL Server 2012 I have a maintenance script that I wrote for some of my operators. They are members of the fixed db_datareader and db_datawriter roles. Part of the script creates a table variable, ...
8
votes
2answers
211 views

Is there a cool way of performing CU updates for SQL Server on hundreds of machines?

My company has grown from 50 SQL Servers to over 200 overnight in a merger acquisition. HELP! My questions are: How can I perform CU updates on this many servers and still have a life and keep my ...
2
votes
0answers
33 views

Trigger/Event that fires when a Transaction finishes

I have a query that pulls from about 15 different tables. I am looking to materialize this into a table that stores it in xml/json. (To improve performance.) The problem I have is that these tables ...
5
votes
1answer
33 views

I want to add a user/login to role in another database without switching databases

I have a role / login in a 'new' database mynewdb with a role "emailsender". I have scripted a profile for sp_send_dbmail and am now trying to script adding the the login to the DatabaseMailUserRole ...
0
votes
1answer
47 views

How to do a 'SUM' of a COUNT(*) in your select to be grouped by a particular column in SQL SERVER

What I am looking for is to be able to SUM the open_lines and group them by that so instead of 'cntnr_id' having open_lines showing as '1' it should show '2' since it is the same cntnr_id and ...
0
votes
0answers
27 views

Why are my jobs not running and next run is not scheduled? [on hold]

My SQL server agent had stopped. So I started it. After I started it, the activity monitor showed that "Agent XPs are disabled". Then I ran EXEC SP_CONFIGURE 'Agent XPs',1 GO RECONFIGURE After ...
2
votes
3answers
55 views

Insert data between 30 minute time intervals

I want to divided my to my time interval depending to the start time and end time. To explain it further, let me have this example. I have this table: User Elapsed Time Start Time ...
2
votes
1answer
18 views

Unable to change database owner to a user that is already mapped as user

I ran into this problem. Trying to change a database owner to ; however, I get the following error message when doing so: The proposed new database owner is already a user in the database Now I ...
-1
votes
0answers
32 views

How to execute stored procedure from other database?

I have 2 databases. Example: db1 and db2. And db1 has a stored procedure sp1 with an input parameter. db2 has a stored procedure sp2. I am trying to execute sp1 in sp2. I tried below: I know it ...
5
votes
2answers
670 views

List of all missing order numbers that are not in the table

Our workplace has started to scan all documents rather than manually keep them in archives etc. On average we are scanning 1,000 documents per time (this happens about 30 times per day). Each time ...
2
votes
2answers
49 views

Sum of points and rank according to points

I am creating a game where I am calculating the user points on the basis of user activities. Everything is working fine - I got the sum of points and on the basis of points I calculated the rank. I ...
0
votes
1answer
44 views

Sql Database server Remote access not working

I have configured Remote settings from TCP/IP with 1433 port and Firewall is also disabled I have checked settings over intenet and applied still not able to connect remotly I am using windows ...
0
votes
1answer
34 views

sql org chart hierarchical table to xml json

I have a table of employees and managers: create table emp_mgr (emp varchar(99), mgr varchar(99)) insert into emp_mgr select 'Adam',NULL; insert into emp_mgr select 'Bob','Adam'; insert into emp_mgr ...
-2
votes
1answer
29 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
17 views

SQL Server - Failover Cluster add node later [on hold]

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 ...
2
votes
0answers
20 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
36 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
174 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
14 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
43 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
25 views

SELECT all rows when a variable is null [on hold]

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 ...
6
votes
1answer
81 views

SQL Server DB becomes 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
17 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
20 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
38 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
16 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
31 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 ...
10
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
45 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
100 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
126 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
38 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
41 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
23 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
22 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
22 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
1answer
98 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 ...
8
votes
2answers
189 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
157 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
63 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 ...