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

SSRS (2008 R2 to 2014) Migration Issues Running Reports

This is my first ever StackExchange question, so sorry if I something is off...I searched and found a rather helpful article that got me this far, but nothing I found addressed what I am currently ...
0
votes
0answers
2 views

Error after moving FTData folder

I needed to move my system data files from one logical drive to another one, and I successfully did this on SQL 2008 R2 for everything but my Full Text data files. When I start up the SQL service, I ...
0
votes
1answer
3 views

How to maintain database ownership restoring across domains?

I am working with a vendor who is developing a SQL Server database outside of our domain. Occasionally, they need to deploy a new copy of that database into our domain by backing up their database, ...
2
votes
0answers
11 views

Scripting Local Policy Perform Volume Maintenance Tasks

I am working on an automated SQL 2012 install process on Windows 2012 R2 and have everything complete except for one task. My process launches secpol.msc but I am still required to drill in and ...
0
votes
0answers
14 views

Performance decline function vs command window

I have a function that I first wrote as a serious of commands. In the SQL command window when executed, those steps take about 8 seconds to return the data set. When those same commands are turned ...
0
votes
1answer
19 views

Massive joins Vs Updating temp table

I'm working on a query that essentially aggregates a slew of tables together. The first method I tried was to inner join all of the tables into one nice big query that pretty much looked like this: ...
1
vote
1answer
23 views

Domain-Admins can't connect to MSSQL Server

I have a MS Server 2012 R2 domain controller and a database server (W2K12R2/SQLServer2012). As allowed usergroup I have set the group "domain-admins" with sysadmin right. But somehow any ...
1
vote
1answer
28 views

how to define trigger scope variable

My trigger is meant to calcalute the grade of a student base on the column value for every insert.But if a column value for the column is modified it the corresponding Grade should change. Currently i ...
0
votes
1answer
52 views

How to save and then restore permissions after refreshing a database

A database in a STAGING environment is overwritten every N weeks with a PRODUCTION copy that is more recent. What is the proper way to save and then restore users, roles and explicitly granted ...
3
votes
1answer
162 views

Verify if user has read access to a table

I'm developing an ETL, whose extract step must read data from a table. There are times that my user's access to that table is revoked. So, to avoid the ETL failing, before reading the table I must ...
0
votes
0answers
8 views

SSIS - This error is thrown by Connections collection when the specific connection element is not found

I am writing a package to upload result of query to FTP as CSV file. Package is working fine on local machine, but after transferring .dtsConfig and .dtsx on another environment it throws following ...
0
votes
1answer
38 views

Job showing the running sign but not currently running

I have a script to get the currently running jobs: -- get the running jobs --marcelo miorelli -- 10-dec-2013 SELECT sj.name ,DATEDIFF(SECOND,aj.start_execution_date,GetDate()) AS Seconds FROM ...
-3
votes
0answers
15 views

Clearing log files

How to clear/Shrink the Log file of a database when the database is in stand by mode. How to make a database from recovery mode(normal mode/with recovery) to standby mode.
1
vote
2answers
35 views

Delete duplicates with specific columns as identifier

I'm required to delete all duplicate entries of a table. The duplicates are identified by two non-key values num (int) and com (varbinary(512)).. My amateur-ish SQLfoo lead me to this non-functioning ...
2
votes
1answer
110 views

Checkpoints and Logging

I'm working on getting full grasp of logging architecture. Please correct me if I'm wrong here: I understand that a checkpoint occurs (also lazywriter) to write the dirty pages in the memory to the ...
-3
votes
0answers
25 views

help with views [on hold]

I have to create a view in SqlServer 2012 I have 4 tables connected to each other via ID and parent Id I need to fire a query like if the record of a table is not present in another table it shows a ...
0
votes
0answers
33 views

Backup table is larger than original table

I am cleaning up my database by deleting unwanted tables such as temp tables, backup tables. While doing clean up I see that I have a backup table and the original table. The size of the backup table ...
1
vote
1answer
9 views

Sqlserver: Get Meta-Info about TRN file

Is there any way to get the timespan of the data contained in a TRN-File? What I have: A backup of a transaction-log What I need: The timestamp of the first and the last entry inside the log ...
0
votes
1answer
42 views

What is my database name?

I'm trying to connect to a microsoft SQL database but I dont know its name. I suspect it will be something of the form servername\databasename It would be good if I could just use SELECT ...
0
votes
1answer
46 views

TSQL vs SSIS Lookup

I was trying to find some well performing Tsql equivalents for the SSIS Lookup component. Especially for Fact table loading. After few different query patterns the most obv performed the best: ...
0
votes
1answer
19 views

Import CSV file - dynamic path

I am trying to import a csv file dynamically. This works: BULK INSERT #CSV FROM 'C:\Users\MyName\Desktop\Players.csv' WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR = '\n' ) I would like to ...
0
votes
0answers
52 views

How to recursively find gaps where 90 days passed, between rows

This is a kind of trivial task in my C# homeworld, but I don't yet make it in SQL and would prefer to solve it set-based (without cursors). A resultset should come from a query like this. SELECT ...
0
votes
1answer
16 views

MySQL rapid Data Replication from multiple Databases

I am a Freelance Web Developer but not a Database Administrator at all except basic Database Operations like DML etc. Today I got a client asking me to develop a Web based application but there is a ...
1
vote
2answers
28 views

Granting permission on a particular job to execute on SQL Server 2005

An user is requesting permission on a particular job. How can I give him access on job activity monitor which shows only that requested job?
0
votes
0answers
10 views

reports on history table

Assume Trucks which travel between Cityies. I store the Cityies that a Truck has traveled to in TruckLocationHistory table, if the Truck is passing the City, State = Passed and if it gonna stays for ...
1
vote
1answer
47 views

Can I trigger events based on timestamp data or should I use polling?

I'm asking this question for SQL Server 2008+ but this could really be for any DBMS. Imagine you have scheduled data, something like: ID Data Timestamp 0 NULL 2014-11-22 1 ... ...
0
votes
0answers
20 views

self referencing tables with SQL and entity framework

I have many tables in a database and the tables are nearly identical. There are limitations currently on what objects reference other objects. For example I have company,contact and project. Contact ...
0
votes
0answers
47 views

Query execute slowly when changed compatibility Level of my database

I use SQL Server 2014 and have a database with compatibility level 110 (SQL Server 2012). also I have a stored procedure on it that execute about 10 second. When I change compatibility level of my ...
0
votes
0answers
22 views

problem in connecting SQL Server for internet access

I'm having a problem connecting SQL Server for internet access. I have built a test server so that I can play at home and not kill the works server. I've been trying for days and so far I have: My ...
-2
votes
0answers
45 views

Joining Multiple Tables in Sql Query [on hold]

I have four tables with their attributes; namely Check_Gauge, Storage_Facility, Product, Product_Brought. The first three tables are related through their primary keys. Product_Brought is not ...
7
votes
2answers
280 views

How can I check for stored procedure consistency across multiples servers

I've got a stored procedure on 10 distinct servers, how can I check across all servers for stored procedure consistency? I'm currently pulling the definition for each server manually, and comparing ...
1
vote
0answers
16 views

Migration error: “Invalid date literal detected” when reading decimal

I'm attempting a migration from MSSQL to MySQL and keep coming across a "Invalid date literal detected" error when reading certain decimal columns. I'm running the following (all up-to-date as of ...
3
votes
1answer
154 views

Why do nonclustered Indexes use clustered indexes instead of the table data pages directly?

From a Microsoft Course (presented by a third party) I learned that when a table has a clustered index even non-clustered indexes hit the clustered index. When there is not a clustered index (Heap) ...
2
votes
0answers
22 views

How to UPDATE/DELETE/INSERT with Microsoft.ACE.OLEDB.12.0 as Linked Server in SQL Server 2012?

I need to update an Access 2003 database from SQL Server 2012 with the Microsoft.ACE.OLEDB.12.0 provider. As an administrator, everything works great. I can do Select, Insert, Update and Delete ...
1
vote
2answers
83 views

Using sp_BlitzIndex - Diagnosed as “Index Hoarder: Addicted to nulls” [duplicate]

Context: MS SQL Server 2012 In using Kendra Little's awesome tool, sp_BlitzIndex, a number of tables were diagnosed as "Index Hoarder: Addicted to nulls". I'm not looking for a debate over NULLs and ...
2
votes
1answer
27 views

How can one select a static value as a column based when using UNPIVOT?

I'm trying to unpivot a few columns in a table. This is for a reporting tool. The source data is already normalized. I am able to get my desired results with a series of UNION ALL statements. I can ...
0
votes
0answers
36 views

Availability Groups, Log File Backups and Recovering the Secondary

I am currently working on ironing out some kinks in a testing setup for our large (1.5TB+) database in an Availability group and have a few things I need some help with. Setup I have a two node ...
1
vote
2answers
54 views

Create SQL Script Repository [on hold]

I need to get all my SQL scripts in some kind of script repository. I have searched the web but no luck so far. I thought of creating a repository in a SQL database, my problem so far is to properly ...
-4
votes
0answers
33 views

Defining Role of Super Admin, Admin and User from DB table [on hold]

I have a column in my sql table where I want to define the role of the user. If User is SuperAdmin its value will be -> 0. For Admins it will be -> 1 For Users it will be -> 2. Also. I have column ...
-1
votes
1answer
33 views

I want to update last date in to multiple same id [on hold]

The present record is like this I want output to be like this I need a SQL query for this concept Thanks
4
votes
0answers
101 views

There is insufficient system memory in resource pool 'internal' to run this query

One of our production servers reporting error in log Error: 701, Severity: 17, State: 123. There is insufficient system memory in resource pool 'internal' to run this query. I searched for ...
0
votes
1answer
38 views

Merge two rows into one row

So I have a table that looks like this: And here's my query for that table: select b.Barcode,a.ItemCode,b.Color,b.Size,b.Class,d.Locationcode,c.price, SUM(case when e.description = 'Selling ...
0
votes
1answer
15 views

Reviewing Stored Procedure template for handling transaction?

I've prepare a template for SQL Server stored procedures which will have Insert, delete, Update transaction. I have a stored procedure to log error in catch block in a table. How can I improve my ...
0
votes
1answer
22 views

Notification when the status on sql server replication is “Not Running”

We have a lot of replications set up. Sometimes for some reason, the status of the replication changes to "Not Running/Expired Soon or Expired". Could you please let me know if there is a way we can ...
0
votes
1answer
26 views

linked server be made using the login's current security context

Can I clarify this settings linked server be made using the login's current security context. If I connect to serverA using windows account JOESmith and create the linked server using the above option ...
1
vote
1answer
52 views

How do I remove duplicate records in a table?

I have a table table1 with 1 millions rows of data. I want to remove all the duplicate records in the table1 I was looking at this link: How do I remove duplicate records in a join table in ...
1
vote
0answers
68 views

Duplicate Key Entry

I've got a problem on SQL Server 2008 where I'm getting a duplicate key entry error on a process that's worked fine in the past. What is really weird is that if I drop the clustered index, insert the ...
-1
votes
1answer
31 views

SQLCMD Returning Named Pipe Error [on hold]

I am trying to run any command from SQL Server Express from the command line using sqlcmd. Here is an example. sqlcmd -U myname-P mypwd -S mysys/SQLEXPRESS -d MASTER -Q "Select count(*) from ...
3
votes
1answer
65 views

Normalized Data Store - Confused with prefixes to use

I'm designing a Staging+NDS+DDS Data Warehouse system, where an ETL is going to normalize data from [Staging] and load it into [NDS], which will hold all history. I've pretty much finished the T-SQL ...
0
votes
1answer
52 views

How to restore a database to the latest file in a backup set [on hold]

USE ICT; GO BACKUP DATABASE ICT TO DISK = 'E:\Backup\ICT.bak' -- Verwijder dit bestand a.u.b. GO RESTORE DATABASE ICT_TEST FROM disk = 'E:\Backup\ICT.bak' WITH REPLACE, MOVE 'ICT' TO ...