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

Can't connect to SQL Server

I'm trying to set up Peer-to-Peer Transactional Replication and I'm stuck at "Add a New Peer Node" step - I can't connect to another server. In server name field I specify serverIP\DBNODE2 and SQL ...
4
votes
1answer
24 views

Long running DBCC CHECKDB

I am on SQL 2014 Standard doing offline DBCC CHECKDBs (so on a box other than production). For the most part, my process is going pretty quick but for some reason I have this small DB (6gbs) and its ...
4
votes
1answer
230 views

Subselect of MAX(Version) takes many minutes, though there are only ~20K records

I have a pretty complicated data model. I can't understand most SQL examples without an explanation of what's being modeled, so I'll try to explain. Mainlines -> Releases -> Overlays -> Calibrations ...
0
votes
0answers
10 views

Oracle Linked Server only works with Sql Login

I'm having this weird error for some time. When I login to sql server and use the linked server SELECT * FROM OPENQUERY(MEGA, 'SELECT 1 FROM DUAL') I receive this error OLE DB provider ...
0
votes
1answer
17 views

Error with FUNCTION ( SQL Server 2008 ) - ''Cannot find either column…'

Friends, I have this Function: create function [dbo].[fn_xxx] ( @Nome varchar(100), @Descricao varchar(500) ) RETURNS @tbDados table ( Qtd int ) as Begin ...
1
vote
0answers
18 views

When does SQL Server follow the Minimum Password Age policy?

According to this SQL Server 2008 whitepaper, SQL Server should only pay attention to the Minimum Password Age policy when the Check_Expiration (Enforce Password Expiration) option is turned on. Page ...
0
votes
0answers
16 views

When does a port get assigned if SQL Server is set to TCP Dynamic Ports

I'm trying to determine when a dynamic port is assigned to SQL Server. If the TCP/IP Properties have the TCP Dynamic Ports enabled, does that port get assigned at the time the Server is installed or ...
1
vote
1answer
29 views

Best place to keep backup scripts

Where is the best place to leave the Database Backup scripts, currently I let them on the Backup Job itself, however I wonder if it's best to leave on a Database
1
vote
0answers
23 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
0answers
22 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, ...
6
votes
1answer
380 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 ( ...
0
votes
2answers
91 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
0answers
29 views

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

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
24 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
243 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
30 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
35 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
24 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
36 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
26 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
49 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
57 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
33 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
39 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
43 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
103 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
38 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
41 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
77 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
50 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
31 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
45 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
111 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
39 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
135 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 ...