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

SQL Server questions (for masters)

How to rename sa to new_sa in SQL Server 2000? How to do and what is the impact SA rename impact in SQL Server 2005, 2008, 2008R2, 2012, 2014, Express Edition How to recreate sa login if deleted How ...
3
votes
1answer
16 views

query to determine forceencryption state

I'm trying to confirm whether or not force encryption is currently set and/or if the current connection is secure or not. Is there a SQL query I can run that will give me that information or do I ...
0
votes
1answer
20 views

Trigger Gives an Error on Multiple Rows SQL SERVER

I have a problem when I create a trigger which is giving me this error: Msg 512, Level 16, State 1 Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, ...
1
vote
1answer
15 views

SET ANSI_NULLS at the database level versus setting it at the table level

I have generated schema-only script for my sql server 2008 R2, here is part of it:- USE [master] GO /****** Object: Database [****] Script Date: 03/25/2015 12:17:09 ******/ CREATE DATABASE [****] ...
0
votes
1answer
20 views

Unexpected SELECT permissions

My user WebApp seems to have SELECT permissions on every table in every schema and I can't figure out why. WebApp is only in the Public role. Public doesn't own any schema. Explicit permissions ...
1
vote
3answers
178 views

optimize an sql query

I have to select 2 values that were less that the given id and greater than the given id. I have tried this query but is there any better way to do it Fiddle Sql Begin declare @rootValue int ...
0
votes
0answers
17 views

What is the best SQL Server field type to cast to when storing a UNC path stored in a sql_variant field?

What is the best choice of field type to cast to when storing a UNC path in a sql_variant in Microsoft SQL Server 2008? It appears that I could store up to 4000 characters according to Microsoft ...
1
vote
1answer
19 views

How to create a custom map report

not sure if this is the right forum. But just wondering is there a way one can make a map report out of an image or a map made on excel. I have the data and I've looked around and found that its ...
0
votes
1answer
15 views

Access a DB through Another DB ONLY

I have a DB [MainData] with the following data in [dbo].[Table1] Customer Value1 Value2 -------- ------ ------ CustA Foo 1 CustA Bar 25 CustB Foo ...
2
votes
2answers
118 views

Creating a stored procedure and adding date manually to filename

I am new to SQL administration and have been tasked with creating some nightly jobs that send an email with certain details contained within a spreadsheet and so far I have the following: EXEC ...
3
votes
1answer
35 views

How does a security group sid differ from a per service Sid?

I am learning SQL and trying to understand the concept of a SID. At the link below it states: Microsoft SQL Server uses a security group to set resource access control lists (ACLs) instead of ...
1
vote
1answer
18 views

SQL Server Failover cluster installation fails `RequireKerberos` to value '1'

Hi I am trying to create a SQL Server Failover cluster. Windows Cluster is configured and working as expected but now when I try to install SQL Server it throws the following error: OS: ...
0
votes
1answer
19 views

SQL Server Configuration Manager shows no services

I have installed Microsoft SQL Server Management Studio 2008 on my system. When I tried to open it for the first time, it asked me for the "Server Name" when I surfed I came to know that I have to ...
2
votes
1answer
12 views

moving a Partition of Partitioned Table to other File Group, SQL Server

I created partitioned table on DateTime column. for last 6 month. I placed 3 oldest month on a file group named 'FG_OlderData', and 3 newest month on a file group named 'FG_NewerData'. Partition ...
2
votes
1answer
12 views

SQL Server 2008 Edition Upgrade Enterprise Evaluation to Standard problem

On my Windows Server 2012 machine SQL Server 2008 evaluation time has expired. After Edition Upgrade nothing happens, SQL Service doesn't start. In service log still is information about expired ...
2
votes
1answer
38 views

Syncing two databases in SQL Server

I have two SQL Server databases. One is client (Windows application) and the second is on the server. I want to sync these two databases every so often (e.g. every 2 minutes!). I have read about ...
3
votes
1answer
24 views

Importing via sqlcmd errors out

PS C:\Users\administrator.INTERNAL\Desktop> sqlcmd -S SQLMAIN\MSSQLSERVER -i rdmdb.sql Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : SQL Server Network Interfaces: Connection string is ...
5
votes
2answers
127 views

BI and DBA dev , where to start [on hold]

I've read a lot about business intelligence development and database development, too. I have tried to work my way around a couple of courses on SQL Server 2008 however I feel kind of lost and I have ...
4
votes
1answer
49 views

What started this SQL Server job?

I'm looking at a SQL Server environment in which jobs start in several different ways. One way is from a job running on a different SQL Server. So, for example, "SQL Server A" runs a job named ...
3
votes
1answer
22 views

Information about a column and the data it holds?

I'm working with a table that has 3 different dates associated with each item in the table. I don't understand what each time is so I want to know if there's a standard place that the person who made ...
2
votes
1answer
32 views
+50

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
1answer
40 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, ...
-3
votes
1answer
16 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
48 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 ...
8
votes
2answers
90 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), ...
1
vote
0answers
14 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 ...
1
vote
1answer
21 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
41 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
221 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
36 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 ...
6
votes
1answer
38 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
54 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
28 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 ...
3
votes
3answers
64 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
20 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
34 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
687 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
0answers
15 views

Sum of points and rank according to points with join three tables [duplicate]

I am creating a game where I am calculating the user points on the basis of user activities. Everything working fine I got the sum of points and on the basis of points I calculated the rank. I have ...
2
votes
3answers
56 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
45 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
41 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
24 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
177 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
15 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
49 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
26 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 ...
8
votes
1answer
86 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 ...