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
1answer
19 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 ...
0
votes
0answers
37 views

RaiseError in Try block [closed]

Is there anyway that I can raise error from try block and avoid the catch block? For example: In this case, the catch blows the exception - I don't want it to happen and I need the RAISEERROR to be ...
1
vote
1answer
19 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
54 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
14 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
216 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
21 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
38 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
35 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
156 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
30 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
16 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
221 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 ...
4
votes
1answer
48 views

What data gets passed between mirroring principal and secondary?

We are trying to figure out which of the below statements is correct when talking about SQL Server mirroring: The master database server executes the query, and takes the resulting transactions and ...
1
vote
2answers
58 views

Find dates when exactly records changed for user

I need to find the dates when exactly the status really changed. Order should be analysed from Start to end period: Start Period : 11-10-2014 End Period : 21-10-2014 Data: ID, Name, ...
0
votes
1answer
50 views

Cannot log in to SQL Server 2008 R2

I have problem with my SQL Server 2008 R2 instance. I want to log in using windows authentication and server name "local", but error 2 is returned. I've tried to login with a server name of "IP ...
2
votes
2answers
59 views

Backup status report from multiple server in sql server 2005

Per daily routine activities of DBA, as we know backups are important to be monitored and to make sure they are corrupt free, i am trying to fetch a report to get such status. Moreover, we have SQL ...
1
vote
2answers
77 views

SQL Server 2012 Table Partitioning - Have I done it correctly?

I have a table that stores accounting transactions for what we call "jobs". The table looks like this: ( REGION char(3) JobNumber char(17) SeqNum decimal(5,0) ..... ..... ..... AcctYear decimal(4,0) ...
4
votes
2answers
203 views

Skip sections that have GO

I'm working on a script I can run on new servers to do some initial configuration. I would like to be able to skip some sections but the problem I'm running into is the "GO" that's required. Because ...
0
votes
0answers
28 views

remote access between 2 projects

I want to make a database program/project with visual basic. I will make 2 programs. In the first program, a basic user-admin will add, make, delete, edit records on database/s. In the second ...
1
vote
2answers
67 views

Security or performance risks using SQL CLR [closed]

Are there any particular security or performance risks in using the CLR in SQL Server ?
2
votes
0answers
36 views

reporting space consumption to files in filegroup - how to reverse-engineer the algorythm spreading data across files

First question, so be gentle ;) I would like to know how to be able to calculate the distribution of data consumed per file in a filegroup, back to the index (HEAP, CLUSTERED, NONCLUSTERED) storing ...
1
vote
0answers
94 views

Most Efficent way WHERE [Date] = Today [duplicate]

Was wondering what would be the most efficient way to get data from today, does converting the date something like WHERE CONVERT(CHAR(8),[DateTimeColumn],112) = CONVERT(CHAR(8),GETDATE(),112) Not ...
3
votes
0answers
34 views

Can SQL Server use a spatial index and another index at the same time and be efficient?

Let's say we have a table that contains two terrain datasets defined by TerrainModelID like below: CREATE TABLE [dbo].[DigitalTerrain]( [DigitalTerrainID] [uniqueidentifier] NOT NULL, ...
0
votes
1answer
32 views

Extracting Data from multiple archive tables(SQL Server)

I am developing a report in report builder 3.0 where i am extracting data from a table dbo.odcalls. now the problem is this table is archived on monthly basis on a seperate database(HN_Backup) and i ...
0
votes
2answers
49 views

Is it advisable to restart a SQL server box running Windows when disk space is low?

We've had a sudden drop in hard drive space on the OS partition of our SQL server (as databases are being stored there). It's causing various issues, and we're unable to move one of the databases, as ...
1
vote
1answer
18 views

SQL Server configuring both UCP and MDW on a single server

I'm trying to configure both UCP and MDW on a sql server. I have already setup UCP and it created [sysutility_mdw] database. Now when i try to setup MDW it is trying to use sysutility_mdw database ...
0
votes
2answers
141 views

Update statement is giving an invalid column name error, even though the column exists

I have a temporary table created at the beginning of this stored procedure. It is created successfully and can be selected from and inserted to. Here is the create statement CREATE TABLE ...
1
vote
1answer
33 views

Wait for an AlwaysOn replica to be synchronized in Powershell

I am working on a disaster recovery script. One part of it is not being consistent. This is the code: ... ## Switch replica to Synchronous Set-SqlAvailabilityReplica -AvailabilityMode ...
1
vote
1answer
63 views

Query to convert the count to million or thousands

I am running a query on a database to return count(*) for number of rows. If the count is greater than million say 2,250,304, I want the query to return 2.25M. If the count is greater than 1000 but ...
2
votes
2answers
65 views

Deleting rows from a table with a very small amount of expansion space

I have multiple tables that I have backed up the data in, and now am deleting the old data for the time, archiving is not an option due to space constraints at this time. I have tried running the ...
1
vote
2answers
54 views

Creating a Linked Server that Points to Itself

I am attempting to create a linked server on SQL Server 2014 instance servername\instancename using the following call: EXEC master.dbo.sp_addlinkedserver @server = N'servername\instancename', ...
0
votes
1answer
34 views

Can we create a stored procedure to copy detached .mdf and .ldf files from original location to new location?

I am trying to create a script to attach database, move .mdf and .ldf files to new location and then attach the database. I created a stored procedure to detach and attach the database. Can I get a ...
2
votes
1answer
176 views

How to allow to execute stored procedures but not writes?

I would like to set up a "reading" user on my SQL Server 2012 instance. I would like to allow him the right to execute any stored procedure, or function, or direct SQL statement, which retrieves data ...
1
vote
1answer
45 views

Stored procedure - problem with merge - Insert

I am calling a stored procedure from my c# code . The procedure works fine for update, but fails for Insert. Is the following merge-insert procedure code correct? Any help is appreciated. Here is ...
1
vote
2answers
62 views

How do I return data from a table where the data is the max date of the previous month's data submissions (-1 of current date)?

I have a stored procedure where I select the latest/max submit_date data for a tracker_date and client from a source table called Tracker_Live, and insert it into a new table called ...
2
votes
3answers
206 views

Finding Database Default Locations

I am working on creating a script to restore database from a backup file to default location of an instance, which is set away from system databases installation folder. Currently, I'm using to find ...
1
vote
2answers
142 views

ONLINE vs OFFLINE index rebuilds

I am looking for an opinion, which I know is usually frowned upon, so my apologies in advance. I'm currently in an environment where every instance is SQL Server enterprise edition. The maintenance ...
1
vote
1answer
85 views

Offsite Log Shipping

We currently use CDC to replicated our Production DB offsite (Microsoft SQL Server 2008 R2), but using CDC and the way we process the files is very unstable. Also note that the two servers cannot ...
5
votes
1answer
232 views

View designer strange join syntax

I have a data warehouse with a lot of views built in with the SSMS view designer. Viewing the syntax, the FROM clauses are unintelligible to me because the ON statements do not follow straight after ...
3
votes
3answers
109 views

A way to clear/restart virtual memory creep automatically?

I know it's not good practice to do this, but my company cannot afford me trying to find a proper solution to our problem. I've read this and I could do the same with SQL Server 2005, but I was hoping ...
-2
votes
2answers
71 views

Install SQL Server 2008 R2 with one click [closed]

How can I install SQL Server 2008 R2 without wizard, just install and voila, install on PC?