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
0answers
11 views

SSMS returns results immediately; ADO takes longer

I am running a query that returns ~250k results. It is basically SELECT * FROM my_schema.my_view (and the view is somewhat complex, and all table references in it are two-part) I am not passing any ...
0
votes
1answer
10 views

Join to a Culture Table vs Select Culture ID

I have a query that is executed several hundred thousand times a day. Due to legacy support, the incoming variables on this SP cannot change. Currently it looks like this: Select id, name, ...
2
votes
1answer
28 views

Why adding SQL Server user to “Perform volume maintenance tasks” improves the speed of database resizing so much?

If I want to create 5GB database with CREATE DATABASE [test] CONTAINMENT = NONE ON PRIMARY ( NAME = N'test', FILENAME = N'E:\2012\test.mdf' , SIZE = 5529600KB , FILEGROWTH = 1024KB ) LOG ON ( ...
-2
votes
1answer
43 views

Optimizing queries for 25+ million rows

I am using MS SQL, and I have to run several queries on the same table on different criteria. At first I ran each query on the original table although they all share some filtering (i.e Date, status). ...
0
votes
1answer
23 views

Adding a constraint to check another table whether if the data exists

currently I'm learning SQL but i got stucked at one point, I've searched a number of threads but it seems that i can't find the exact one that I'm trying to achieve. Currently after creating table, ...
0
votes
1answer
20 views

SSIS Merge Join Error

I have a simple data flow. I'm trying to join two sets of data from two different databases. The TXT database is collation SQL_Latin1_General_CP1_CI_AS. The other dataset (Cost) is coming from ...
4
votes
1answer
193 views

Should I use Database Mirroring?

So I have the following scenario on my hands: I have a product database that runs for a specific app, all inserts into the database come in through three separate connections. Recently I have ...
2
votes
1answer
29 views

Agent service account shows as not clustered

One of the SQL Server 2008 R2 instances I administer is running on a two node Windows Cluster (Windows Server 2008 R2 Enterprise) When I run the DMV sys.dm_server_services, SQL Server Service Account ...
-2
votes
3answers
32 views

Cannot identify syntax errors [on hold]

Newbie here. I'm trying to execute this line in sql server: CREATE TABLE dummy_driver but I'm receiving the error message Incorrect syntax near 'dummy_driver'. I can't seem to locate the error. ...
0
votes
0answers
18 views

Peer-to-Peer Transactional Replication Load Balancing in MS SQL Server

I'm looking at Peer-to-Peer Transactional Replication and it looks like a perfect fit for my requirements, but there's one unclear part - load balancing (see picture below). How it is implemented in ...
1
vote
1answer
35 views

Return list of columns in user-provided subquery

I am trying to fill a ComboBox of all columns from results of a query. That query is submitted by the user on the form, so the program needs to run the query then have a procedure run that extracts ...
1
vote
0answers
23 views

How to architect Service Broker with three or more systems?

I'm trying to implement a Service Broker architecture for a business process involving three systems and I want to do it in the spirit of using SB as designed. System 'A' is an accounting system. ...
0
votes
1answer
46 views

Restoring SQL Server database on another box

I have a SQL Server database that is running these scripts to create backups. It's running full backups once a week, daily differentials, and hourly logs. These are being FTPd to another box where I ...
2
votes
3answers
56 views

Why is sql server waiting for acknowledgment?

I have an application that often request a big set of rows [about 20K] from a sql view, in the mean time other applications can't update the table from where the data comes from, the update query's ...
0
votes
0answers
32 views

ComputerNamePhysicalNetBIOS and “Current Host Server” shows different machines

I have a SQL Server 2008 R2 instance on a two node (say names X and Y) windows server cluster (Windows Server 2008 R2 Enterprise). Server Manager on both nodes shows 'X' as the 'Current Host ...
1
vote
0answers
36 views

Simple avg query on large table much slower in PostgreSQL than SQL Server

I have a database with three tables items, parameters and measurements in both servers and want to query the measuerment table. But the query is much slower in PostgeSQL (9.4) vs SQL Server (2012). ...
1
vote
1answer
28 views

Finding AD group permissions source

We have an AD group as a Login in several servers, usually as sysadmin, but I've found one server that this login has no access to any DB and has a server public role only. I've talked to a member of ...
-1
votes
1answer
35 views

SQL Server credentials - Maximum Password size

What's the maximum password size I can get on SQL Server 2012/2014? I was unable to find this information online. I mean SQL Server credentials itself, not passwords inside tables. Thanks a lot
0
votes
0answers
30 views

Testing Restores with LiteSpeed, TSM and SQL Server [on hold]

How can a backup file (*.bak) that has been pushed to TSM using LiteSpeed be restored to a local file system so that it can be copied to another location for restore testing? Thanks in advance.
0
votes
0answers
17 views

Receiving Error: 18456, Severity: 14, State: 16 when trying to deploy SSRS Report

Our SSRS reports have stopped working. I tried re-deploying it but got a message stating that Error: 18456, Severity: 14, State: 16 an internal error occurred on the report server If checked ...
0
votes
0answers
25 views

MSSQL - Creating backup of 1 day worth of data and then merge them to make a full database [on hold]

I am new to this forum let me know if there is any update to be made. Use-case: I would like to create a snapshot daily which would have 1 day worth of data for 7 days and then combine it with ...
-4
votes
1answer
42 views

Create database unique Surrogate Keys without using GUID’s

What is the best way to get database unique surrogate keys in Microsoft SQL Server when using something like “auto increment” as opposed to GUID's. The purpose is to increase performance over using ...
0
votes
0answers
12 views

Error while executing SSIS package which contains Script component through SQL Server Agent Job

I have written one SSIS 2012 package which is fetching records from CSV and put it into staging DB and from staging DB , using SSIS script component task, I am inserting data into Dynamics CRM. So far ...
1
vote
1answer
20 views

Inserting values into a column when Table1 column A value matches Table 2 Column B Value

I have two tables ImportData and PurchaseInfo. I am trying to import [Supplier Contact Name] from ImportData to PurchaseInfo, when *[SupplierName] in ImportData = *[SupplierName] in PurchaseInfo This ...
1
vote
1answer
100 views

Check if query will cause duplicate row

I have a database with a primary key on the first column (words) I want to trim the trailing and leading ends of my data, but I get an error that this causes duplicate data EX: ' David ' will become ...
1
vote
0answers
20 views

I want to move my SQL server from one domain to another

I currently have two domains in my datacenter. Some time ago, it started to cause some inconveniences that I've decided to move my SQL server from one domain to another (where i have most of my ...
0
votes
1answer
37 views

Conditional Select

My table has 4 columns (name, A, B, C). I need to build a query that has the following logic: Select name, a as value1, b or c as value2 from table Logic: A <> '' If B <> '' ...
2
votes
0answers
40 views

How to raise Procedure Cache Hit Ratio?

I have a SQL Server 2012 instance with 96 GB of RAM that has the Buffer Cache Hit Ratio consistently at 100% and the PLE consistently over 500,000, so memory is obviously not a problem. However, my ...
3
votes
1answer
75 views

How to give access to a user to a view, but not to the table the view is using?

I have a user (called myUser) which has db_datareader role on myCustomDatabase. myCustomDatabase and MSDB are owned by sa user. I've enable chaining (it's already enabled on MSDB): ALTER DATABASE ...
0
votes
1answer
45 views

T-SQL bulk insert fails on specific word “DENY” in string-data [on hold]

I have CSV files structured as string ; string ; string First string is quoted with "". The other 2 strings are not. I'm bulk inserting them into a table using nchar(x) for each of the 3 columns with ...
1
vote
1answer
28 views

Can I import a specific vssettings file when launching SSMS?

In the interest of disambiguating between when I am connecting to non-production and production, I utilize vssettings for a specific theme in Management Studio (fire-and-brimstone style when in prod, ...
0
votes
0answers
22 views

Using loops inside Openrowset

I'm trying to execute a query across around 200 servers using openrowset function. This function needs to execute in a loop - the query is sucessfull in SQL Server 2012 environments, but failing in ...
0
votes
3answers
44 views

SSMS 2014 working with SQL Server 2005 instances

Is there any major complication that one could run into while using the latest (developer) version of SSMS with older SQL Server 2005 instances? Any way one could affect the data by using this ...
1
vote
3answers
110 views

Distinct Random select

Hi can anyone help with this little MS SQL Puzzle. I basically need to get a 1 random answer from each of the submitters. id, submitter, answer 1, James, Blue 2, James, Red ...
0
votes
0answers
41 views

Null in Varchar datatype

I am using a SQL Server database. If NULL value is inserted to a VARCHAR datatype column, what will be the memory size used for the column?
2
votes
1answer
55 views

How can we select data from another table during an insert?

I'm trying to insert data into a table using a few columns that are hard-coded or are static values and then the rest of the datat selected from another table. I've tried the following query: insert ...
-1
votes
1answer
19 views

How to get many rows into one

I have a table like this --------------------------------------- S.no No of hours Dayorder --------------------------------------- 1 5 1 2 6 ...
-1
votes
0answers
22 views

SQL Query for Same last 7 days last year

I am currently running a SQL data query for the last 7 days, however I want to run a comparative SQL data query for the same 7 days last year (plus one day to mirror this week, Friday - Thursday). I ...
1
vote
0answers
19 views

Plans created several times under Force Parameterization

People use forced parameterization to save plan compilation cost. However, I found things different here. The query I will run is as following, and under AdventureWorks2012 database: DECLARE @Var ...
2
votes
2answers
38 views

Is it a better idea (performance is key) to store in a normalized table and retrieve by JOIN or in a single nvarchar column and retrieve using LIKE?

NOTE: The application is not really about websites or keywords, I am using that here only to provide reference points for discussion. I have a data set that is really just a string of words. Think of ...
1
vote
1answer
38 views

SQL Cluster, AlwaysOn AG, or Something Else? [on hold]

I really needs some help with Setting up SQL servers. We are re-configuring our network and have no clue how to resolve our SQL issue. My Network Admin. wants an "Active/Active" with shared storage ...
-4
votes
1answer
133 views

Trying to attach a .mdf with missing .ldf [on hold]

I am trying to attach a .mdf database file to a SQL Servre 2005 however we do NOT have the .ldf and have been unsuccessful in all our attempts to date. I should also mention there is no back-up to ...
2
votes
1answer
48 views

SSRS: Line Chart, Grouping by Day

I have a fairly specific set of data I am trying to display. I have a dataset of helpdesk ticket data. I would like to display a line chart that shows tickets opened and tickets closed by day, over ...
0
votes
1answer
14 views

corrupt Access database file linked with SQL

I have a corrupt Access table and i don’t know how to handle the problem. When I am making any changes of the record in this file, the rows in the table shows me only ‘#Deleted’ message instead of my ...
1
vote
1answer
28 views

Store extended properties and apply to another copy of the database

I'm using SQL Doc to document a development copy of a database. SQL Doc uses extended properties to store user entered values. At some point, I would like to copy those extended properties to the ...
0
votes
1answer
38 views

sql display error

When I run store procedure in SQL Server with parameter 4 param 1 = 'all' param 2 =' all' param 3 = 'all' Result :displays 21 rows When I run store procedure in SQL Server with parameter 4 param ...
1
vote
0answers
51 views

Merge-Replication: New column doesn't get replicated down by update command

I do this frequently but all clients have this fault: I added a new column to a table using a SQL statement, which causes the column to be created and added to every publication that uses this table. ...
4
votes
2answers
271 views

Truncating table without using Alter Table permission

So my DBA don't want developers to give Alter table permission. Now one of the procedure that we created requires to Truncate tables (since apparently delete only removes records, but truncate frees ...
0
votes
1answer
33 views

Two rows having null values merge into one row without null values

I have fetched the record from table like this: Name Opp Bid Pro ---------------------------------------------------------------------- Admin ...
1
vote
1answer
31 views

Reverse engineer SQL Server diagram?

I've been trying to find an option similar to MySQL Workbench 'Reverse engineer' for MSSQL Server 2012. I want to generate the SQL script from a diagram I've created. Is such option available for SQL ...