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
1answer
41 views

How to join a table with a table valued function?

I have a user defined function: create function ut_FooFunc(@fooID bigint, @anotherParam tinyint) returns @tbl Table (Field1 int, Field2 varchar(100)) as begin -- blah blah end Now I want to join ...
1
vote
1answer
33 views

Dual site active-active highly available database

I have an application that is being run on two separate sites. Ideally they would share a database, because each application needs to see what the other is writing to the database. However, the sites ...
1
vote
1answer
40 views

Create copy of Azure SQL Database using SQL Server Management Studio

When running the following query on an Azure SQL Database "Master" in SQL Server Management Studio: CREATE DATABASE myDbBackup AS COPY OF myDb; The following error is produced: Msg 40818, Level ...
2
votes
1answer
93 views

Database with multiple .mdf files

I have search online but not found what I am looking for. The problem/query is to my knowledge a database in SQL Server should have One .mdf file and maybe some .ndf files and One .log file. I ...
2
votes
1answer
70 views

Ola Hallengren index maintenance - long periods of time between commands?

I run the Ola Hallengren scripts on all of my servers for index and statistics maintenance. When I look through the command log table, I notice long periods of time between a command ending, and the ...
0
votes
2answers
23 views

ASPStateTempApplications and ASPStateTempSessions tables creation in tempdb after sql server restart

I have a implemented SQL server session state management. So created ASPState database and ASPStateTempApplications and ASPStateTempSessions tables in TEMPDB database. When I restart SQL Service, ...
4
votes
2answers
67 views

How to get COUNT of a range between 2 columns

Table: Staff | StartingTime | EndingTime | starthour | endhour ------------------------------------------------------------- 10 | 0813 | 1610 | 08 | 16 20 | ...
2
votes
4answers
141 views

Identical tables, identical columns, identical records, but why different record sizes?

Identical tables, identical columns, identical records, but why different record sizes? USE [test] GO CREATE TABLE [dbo].[mybit]( [col1] [bit] NOT NULL, [col2] [bit] NOT NULL, [col3] ...
1
vote
1answer
37 views

XACT_ABORT OFF vs COMMIT in trigger

I have a trigger on a table that kicks off several other processes. However, I would like to ensure that even if the other processes fail, the insert is successfully committed to the original table. ...
1
vote
0answers
33 views

Why does retrieving fewer rows take longer? [duplicate]

I have a view that (left outer) joins multiple recursive CTEs. There are about 10k rows. The results of running SELECT * FROM MyView ORDER BY MyPrimaryKey, with statistics time and io on: SQL Server ...
1
vote
1answer
43 views

Next value for Sequence Function

Why does this give me the same value, four 1? USE [TSQL2012] GO IF OBJECT_ID('dbo.sqlsequence', 'SO') IS NOT NULL DROP SEQUENCE dbo.sqlsequence; GO CREATE SEQUENCE [dbo].[SQLSequence] AS INT ...
1
vote
1answer
23 views

SQL Server - Log Shipping Into an AlwaysOn Availability Group

I have a requirement to build an AlwaysOn Availability Group, which I have done. Now the user wants me to set up log shipping from another server into the AlwaysOn Availability Group. I’m not sure ...
2
votes
2answers
63 views

Copying a database that is in Retore status

I have a database that needs to stay in restore mode (NonRecovery), I receive a new group of log files that I receive daily that I have to post to it. How can I copy the database while it is in non ...
0
votes
1answer
23 views

The message “Running the Merge Agent process would exceed the maximum number of processes allowed” appears, but it doesn't seem likely

The full text of the message is "Running the Merge Agent process at this time would exceed the maximum number of processes allowed by this publication. The process will run when resources become ...
1
vote
1answer
41 views

Migrate SQL Server binary datadump to postgresql

I just got a very big dataset (+/-55GB) in a binary SQL Server format. Is there an easy way to import this file into a Postgresql Server? I found some converter-programs, but they 'only' convert ...
1
vote
1answer
56 views

Is someone trying to hack into my SQL Server Database?

I was asked by a friend, who isn't technical at all, to help her with her application. I thought I would just being doing a little C# development and some SQL queries. Turns out it has been a lot ...
0
votes
0answers
49 views

How can you tell if a SQL Server instance max'ed out bottleneck is CPU or Memory?

How can you tell if a Microsoft SQL Server instance max'ed out bottleneck is CPU or Memory? This SELECT-INTO statement on a 8GB box with two 2.6Hz processors. CPU seems busy, goes up and down but ...
0
votes
2answers
27 views

good strategy for big tables and archiving in sql server 2012

I have a table with roughly ~500,000 rows a day getting added into it. The database supports an OLTP system. The make up of it is a bit like this: create table Stuff (StuffID int identity not null ...
-1
votes
2answers
32 views

Trimming the first and last characters from a field [closed]

I have a column like this DATE "112113" "011414" and so on.. I want to remove the first and last characters from the entire DATE column, i.e. I want to get rid of these "". Please help.
4
votes
1answer
116 views

sp_prepexec (sp_execute) vs. sp_executeSQL

The meat of the question: Are actual SPROCS the only mechanism that implements temp table caching or do system sprocs such as sp_executeSQL / sp_execute also take advantage of them? I am not a DBA, ...
0
votes
0answers
19 views

Unable to patch,uninstall or repair Reporting Sevices

I appear to have a corrupt installation of Reporting Sevices (2008) that I cannot repair or uninstall. Trying to repair this feature I get an error Message that says "The SQL Server feature ...
-3
votes
0answers
27 views

I want to reduce SQL Server Transaction log file size [duplicate]

I have 7 TB of db and this db having 3 data files and 5 log files. In this 5th log file having 1.2 TB space. And this db is in bulk-logged recovery model. Now what are the steps needs to do for reduce ...
1
vote
1answer
35 views

Granting permissions to SSIS for developer

I installed SSIS a couple of months after installing SQL Server 2014. I granted permissions to users per MSDN and rebooted SSMS and SSIS. I can login remotely from my client without issue, but have ...
2
votes
2answers
43 views

SELECT permission denied trying to import data into Excel

We recently migrated to a newer version of a program and migrated its database from SQL Server 2000 to SQL Server 2008 R2. We had some Excel files which ran a few custom queries to pull data. I ...
1
vote
1answer
44 views

Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON' [duplicate]

Hi I get this error when connecting to SQL Server remotely from a website. I checked the SQL Server logs and get the error: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. Reason: Token-based ...
1
vote
0answers
30 views

Database backup hangs both in SSMS and XMLA

I am using SQL Server Analysis Services 2008 R2 Service Pack 3. My database was recently upgraded from Analysis Services 2005 and since that time I have been unable to do a backup either from SSMS or ...
0
votes
0answers
20 views

SQL Server 2014 upgrade

I currently have websites running on SQL Server 2008 R2 - this is the version I also have installed on my own machine. I'm looking at moving my websites to a different provider, however they only run ...
0
votes
1answer
44 views

Select Query takes more than a minute to retrieve data

I have a table that has 99 columns, all of them are not needed but they were there when we started. There is a Primary Key (Objectuid) which is a GUI and has the Clustered Index on the PK. The Table ...
3
votes
1answer
116 views

Installing SQL Server on not the default path

I am trying to install SQL Server 2012 on a machine which has 764 Mb Free Space on C: 832520 Mb Free Space on D: So during the installation process I changed the default location from C:\Program ...
1
vote
0answers
42 views

File group space problem

I'm having some problems with my database usage space. I have a database with autogrowth off and limited size to 150GB. When users try to import files, large databases or other massive transaction ...
0
votes
1answer
21 views

Stop agent job after executing for a certain number of hours

I have a scheduled job which runs nightly. I want it to stop itself at 07:00AM in the morning whether or not it is completed. I have seen some duplicates in the site but they don't exactly address the ...
1
vote
1answer
29 views

MS SQL Server 2012 reusing numbers

I have a very high transaction database I have multiple sequences to unique generate numbers for different outlets. One of the outlets started receiving errors because i have a unique constraint on a ...
0
votes
1answer
32 views

Alternative for taking the backup of SQL DB's on backup drive

We just got new servers to take care of, regarding their backups, handed over by the company B who used to manage the backups, but they never did via any mant'ce plans or SQL jobs.They did that task ...
1
vote
1answer
22 views

List all the MS SQL Server Objects ->LinkedServers->Providers using SQL

How to List all MS SQL Server Providers List available using SQL. like Microsoft.ACE.OLEDB.12.0 Microsoft.Jet.OLEDB.4.0 SQLXMLOLEDB.4.0 SQLXMLOLEDB SQLOLEDB
1
vote
1answer
55 views

Possible to use a Trigger as failsafe for insert in two databases?

(This is for a project on MSSQL 2008R2 Server) I have been tasked with splitting a table into an internal (same db as before) and an external one (different server). Currently the idea is to read ...
0
votes
0answers
15 views

Storage solution for large number or denormalized records

We currently have a MSSQL server with the data stored in a denormalized format in a single table (per record type) where there can be millions of rows containing many columns in some cases. The ...
0
votes
2answers
28 views

hide system databases sql server management studio

I have installed sql server express 2008 and also sql server management studio. I've successfully configured remote connectivity and created a database user and password. my problem is that in the ...
1
vote
1answer
28 views

SQL Server AlwaysOn to run updates and schema changes in 24/7 environment

First of all i have to say that this question comes from a software engineer-perspective. Unfortunately we have no DBA so we need to administer our own databases. We have SQL Server 2012 Enterprise ...
0
votes
1answer
20 views

Replicate MySQL INSERT to MSSQL table

I'm running into a challenge here trying to "sync" a MySQL table with a MSSQL table. My scenario involves my linux-based website submitting form data submissions to a MySQL database on that web ...
1
vote
3answers
218 views

Incorrect query results for execution plan, unsure of exact cause of problem

We had a query yesterday that was intended to page through results but on the first page of results the query only returned 4 records instead of the expect 25. Changing the query in any way resulted ...
1
vote
2answers
22 views

Upgrade BI server to 2014 and stay on 2008r2 with the database engine server

We would be happy to upgrade our SQL Server environments to 2014, but we have a tight budget for next year. Our BI server (SQL Server 2008 Standard Edition, that is used only for BI purposes) is ...
1
vote
1answer
39 views

What MySQL data types REQUIRE a max length (size) declaration in a create table statement?

I am converting a SQL Server table structure to a MySQL table structure, and I need to know how to properly declare the column data types within the CREATE TABLE statement. I have a CSV file where ...
0
votes
1answer
36 views

Select into existing table where ID is in another table [closed]

I have one table containing ~35k IDs (TableC), one table that features multiple columns (TableA), amongst others the ID from the before mentioned table and a third empty table, featuring the same ...
1
vote
0answers
22 views

Datamining using holidays

My setup: I am currently running a SQLServer 2012 database paired with a SSAS. My database features sales per store at specific times. My goal: I am interested in predicting future sales (amounts) ...
3
votes
2answers
157 views

SET DATEFORMAT problems

I have some doubts about SET DATEFORMAT command. 1)Does this command is only used for inserting and updating date format and it does not effect the date format of that column? OR does this effect my ...
0
votes
1answer
18 views

Copy every entry from TableA to TableB where the ID is in a textfile containing a list of IDs

I have a text file (or an xls) with a 35k lines, each containing a single ID. I'm required to copy every entry of TableA to TableB where the ID is in said list. Would it be best if I'd create a new ...
-3
votes
0answers
33 views

Open tran for Select query [duplicate]

I have seen BEGIN TRAN on queries in my production db, but it is just a SELECT query with NOLOCK option in the transaction. Why would a simple SELECT query be placed inside of a transaction?
0
votes
2answers
31 views

Log Sequence Numbers in Full BackUp and Log Backup

My full back-up starts daily at 02:00 AM. It takes about 3 hours. I also take T-Log back-ups every 15 minutes (at 15,30,45 and 00 hours). I can verify the LSN sequences of T-log backups when I ...
0
votes
1answer
18 views

Sync MySQL with SQL Server 2008

My current project requires a form on my website to populate a table in a MySQL database with data a user submits via the form. This will work great but my complete goal involves getting that data ...
7
votes
1answer
222 views

Statistics. Are multicolumn histograms possible?

I am thinking of a situation where I have two columns with high density but these columns are not independent. Definition Here it is the definition of the table that I have created for testing ...