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

Columns count in SELECT query and MS SQL buffer cache

Lets assume that I have a table with 30-50 millions records. It has ~40 columns. Currently when I request data it always requests all columns because of legacy ORM that we use. I know that if we ...
0
votes
0answers
18 views

How to import data to a table with 14 columns via BCP if my data file has less than 13 delimiters? [on hold]

Sorry for the extremely awkward wording in that question. I'll explain. I have a table with 14 columns in which i'm trying to import data to via BCP. My data comes from a text file. This text file is ...
1
vote
1answer
26 views

Help with indexing narrow table with many millions of rows

I have a good amount of experience with SQL Server, but not much with Indexes and I fear I'm a little bit out of my depth in trying to figure out how to correctly structure a table that has 100+ ...
0
votes
0answers
9 views

Getting new and updated data with an archive column

I am trying to optimize an SSIS package that retrieves data from a very large transaction table that gets millions of new records daily. The plan is this: Archive column, smallint - 0=new (default ...
0
votes
1answer
29 views

How to move data from SQL Server to MySQL database

Our MSSQL database has a table that has about 4 million rows of data. My original plan was to copy it over to a MySQL database and place it in a more optimized format. For some reason, the people ...
2
votes
1answer
59 views

Query shows SELECT 0

I'm looking through the queries being executed by a third party application. The application was flagged as being slow by some of our end-users. It seems to INSERT records into a HEAP, then DELETE ...
-1
votes
1answer
68 views

EXCEPT operator vs NOT IN

EXCEPT operator was introduced in SQL SERVER 2005 but what is the difference between NOT IN and EXCEPT ? Does it do the same? I would like a simple explanation with an example.
1
vote
0answers
23 views

SQL Server 2012 Setup error Attempted to perform an unauthorized operation

Below is the detailed error message. I Can't proceed with installation for the last one week? I've given full rights to registry keys that are associated to SQL Server but nothing has worked out. For ...
0
votes
1answer
39 views

EXEC Multiple procedures in parallel?

SQL Server 2008. I have several stored procedures. I would like to execute them all in parallel, not serially. How can I do this?
2
votes
2answers
39 views

Changing SQL Server service account passwords enterprise-wide

In the event of a DBA leaving an organization, what options can the surviving team members pursue to change passwords for service accounts portfolio-wide? While using Configuration Manager appears to ...
3
votes
1answer
63 views

dbcc memorystatus - buffer pool target on VM higher than max memory

I'm doing some digging into potential memory/configuration problems on a sql server 2012 SP2. I stumbled upon something that seems a bit strange in the performance counters as well as the dbcc ...
0
votes
0answers
16 views

preventing FullTextSearch from using wildcards

I am using FTS in a sql2008 sql server and had a user complain about some searches breaking. after root cause analysis we found only searches like U.S.A. fail because FTS tries to run wildcard matches ...
2
votes
1answer
16 views

How to get the spatial index in CREATE TO script?

Is it possible to get the spatial index using the create to script using SQL Server 2012? When I write out a table using SCRIPT TABLE AS > CREATE TO in Microsoft SQL Server Management Studio 2012, I ...
0
votes
1answer
23 views

Forget login from connection drop down menu [duplicate]

Recently I logged myself as a different user (testUser) but now that user seems to be persisted in the drop-down menu of connection dialogue box and I couldn't find a way of getting rid of it. Even ...
3
votes
1answer
55 views

resource wait SQLCLR - wait_type CLR_SEMAPHORE by SPID 0

UPDATE In the comments under Aaron's post is an extensive explanation why I want to find this out, please read it if you want to know. The system is running some ETL, reporting services and a ...
0
votes
1answer
36 views

SQL Server - Error 3202 during Restore

While attempting to restore a 4 TB MDF/data database with a 1.8 TB LDF/log file, I'm receiving the following error: Write on '???' failed: 1117 (The request could not be performed because of an I/O ...
0
votes
1answer
37 views

PAGEIOLATCH_SH and LCK_M_IX wait type

I'm seeking for a resolution into wait types I observe on one of my servers. I've been keeping wait statistics for a long time and can positively say that the top two are PAGEIOLATCH_SH and LCK_M_IX ...
-1
votes
0answers
33 views

Performance issue when we directly insert into #temp table

It might be silly one but I am new to query optimization so I want to know the which query has the better performance select * into #temp from MYTable or Create table #temp ( \\same ...
0
votes
1answer
30 views

Move/Copy unique entries only from TableA to TableB, if it's not in the destination table

I'm required to move every unique entry from TableA to TableB, it the unique entry from TableA is not already in TableB. Both tables look the same, they don't have any keys, but the combination of to ...
0
votes
2answers
25 views

SQL Server De-duplication Trigger

I have a table that contains columns of Country, City, Location, Description. Due to the size of the description field it's not possible to bind the four fields into a composite key to prevent ...
0
votes
1answer
26 views

Restore back up strategy for history tables

I have historical/log tables which are: very large holds data that is not rarely queried only inserts are performed (constantly, very often) I want to either compressed them or move them to ...
0
votes
0answers
28 views

SQL Query to get the Sales Qty of the Item and the its Returned Quantity for past 6 Months

I want retrieve the Sales Qty and return qty of the Items in the following format for the past six months. From two different tables,I TxnInvoice Table :Invoice header TxnInvoiceLine Table :Invoice ...
-6
votes
0answers
25 views

sql server …plz reply me asap [on hold]

I got requirement below. the records in table id record_name record_value 1001 price1 12 1001 price2 1 1001 price3 8 1201 price1 ...
1
vote
0answers
37 views

How to determine next value to use in composite key in SQL Server?

I am trying to figure out how to determine the next value to use when adding a new record to a table that uses a composite/compound primary key in a system with concurrent users. Suppose I have an ...
1
vote
2answers
37 views

How to pass output of one stored procedure to the input of another

I have a stored procedure which outputs @billingInvoiceIDOut. I want to use it as input in my next stored procedure. Can I just do in my second stored procedure INSERT INTO table ( billingID ) VALUE ...
1
vote
1answer
15 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
17 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 Server 2008 R2 for everything but my Full Text data files. When I start up the SQL ...
0
votes
1answer
11 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
16 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
27 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
44 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
2answers
43 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
31 views

how to define trigger scope variable [on hold]

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
58 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
183 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
11 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
51 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
21 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
39 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
129 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
29 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
37 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 ...
2
votes
2answers
32 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
48 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
53 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 ...
1
vote
0answers
86 views
+100

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
17 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
31 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?
1
vote
0answers
15 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 ...