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)

2
votes
0answers
38 views

SQL Server restore differential after restoring full backup

Here is the situation: I had a full backup, and a differential backup. I have restored the full backup into the database. But accidentally lost that backup file. Now I would like to apply the ...
2
votes
1answer
43 views

How can I compare the number of transactions in the first weeks or months of different stores

I need to make a comparison of the number of transactions per week and month of different stores since its opening date. The problem is that the stores has a different opening date. So, The idea is ...
-1
votes
2answers
44 views

Where clause in the query [on hold]

I can group by Qty but not woitempart. I \tTried to use a where clause but in vain due to this exception: Exception: ERROR #50805215 Query failed to execute. GDS Exception. 335544569. Dynamic SQL ...
-1
votes
0answers
64 views

which is the cost of evaluation of the request? [on hold]

I have a question I do not understand you could explain to me ? Consider a table R (K,A,B) where the attribute K is a key the (whole) values of which are uniformly distributed meanwhile [1...4000]. ...
3
votes
2answers
58 views

Query to calculate database growth

I have the following query that outputs some good information from MDW data collectors regarding database space usage. I am wondering with the following columns (db size, reserved space, unused space, ...
0
votes
1answer
33 views

DTS Type Mismatch at Join

I am new to ETL and VB in general and need some help resolving this issue. I have looked online and found some interesting answers but none seem to be working for me. varamt = Lookup ( ...
1
vote
1answer
21 views

SQL Trace for compatibility check?

My idea is to trace a few days all statements (scripted the replay template) on a SQL Server 2008 r2 and replay those against a deployed version of the db on a newer version (SQL Server 2014). Is a ...
3
votes
0answers
158 views

Install SQLServer 2000 on Windows 10 [duplicate]

I need to install SQL Server MSDE 2000 SP4 on Windows 10. I have other machines that run Windows 7 and 8.1 and SQL Server MSDE 2000 works fine (with merge replication configured too). Now I testing ...
0
votes
0answers
25 views

Ways for a Windows Administrator to get sysadmin [duplicate]

Based on a question why Builtin\Administrators don't get sysadmin by default, I want to ask which ways are known to get sysadmin rights as a normal windows Administrator without any given rights ...
3
votes
3answers
207 views

“Specify SQL Server administrators” - unusual default value

When installing SQL Server, you get to specify SQL Server administrators, i.e., the list of users initially in the sysadmin role. By default, this list contains the current user. (Image quoted from ...
2
votes
2answers
33 views

avg_page_space_used_in_percent and fill factor

Trying to find an answer to this one but struggling. sys.dm_db_index_physical_stats contains column avg_page_space_used_in_percent. How does this fit in with the fill factor of an index? For ...
4
votes
1answer
32 views

Should Service Broker use SQL or Windows Authentication?

I was curious what the best practice would be, for properly setting up Service Broker in SQL Server 2008. Should I use a SQL authenticated user, or should I use a Windows NT Authenticated user based ...
1
vote
0answers
32 views

Step by step connect to SQL Server 2014 from Oracle 12c and vice versa

I have installed Oracle 12c enterprise on my laptop with Windows 8.1 x64 os. I also have access to SQL Server 2014 through SSMS, that is located in another place and having so many transactions per ...
2
votes
1answer
46 views

remove maintenance plan

I have the following error while trying to delete some old Miantenance plans on the MS-SQL server: Please help.
-3
votes
0answers
52 views

i want get all left and right user with all details [on hold]

Sample data: CREATE TABLE [dbo].[binaryUser] ( [id] [int] IDENTITY(1,1) NOT NULL, [joiningDate] [date] NULL, [placement] [varchar](100) NULL, [pId] [int] NOT NULL, [cId] [int] NOT ...
1
vote
1answer
21 views

Must declare the scalar variable “@VarName” [duplicate]

Could anyone shed some light on this error for me? To a beginner of course. This will probably be no more than a simple fix for someone else. I'm trying to read in the Product to be used in the where ...
2
votes
0answers
23 views

Mirroring won't fail back

Got an interesting mirroring issue. I am using SQL Server 2008 R2. Server A mirrors 8 databases to Server B ideally. Right now the 8 databases are principal on Server B (otherwise healthy). When I ...
4
votes
2answers
341 views

Which command Deletes and Frees Space

I'm reading through the 98-364 exam book and there's a question I can't quite answer: "What command would you use to remove all records from the Contact table that do not have a country of USA ...
-1
votes
1answer
30 views

How to reduce the size of ldf file? [duplicate]

We take full backups of the DB every day (in full recovery mode) and keep them for 10 days. Because of our requirements, we don't want to take incremental or differential backups of the DBs. Now we ...
4
votes
1answer
122 views

Count the nodes in a binary tree structure

I need to count the left and right nodes in a binary tree structure (output grouped by joiningDate), given a particular starting node parent id (pid). The tree is stored in the table shown below: ...
2
votes
1answer
49 views

Converting old SQL Server outer join syntax

I'm a Power Builder (PB) developer. I've migrated PB from 10 .5 to 12.5, and now I need to migrate the stored procedures from SQL Server 2005 to 2012 as well. I get a invalid expression error when I ...
1
vote
0answers
17 views

Update remote MySQL database upon changes in local SQL Server database

I have a Web store running with MySQL on the remote host. And I have inventory management software using Microsoft SQL Server on my local system. I want to update product stock in the web store when ...
-6
votes
0answers
22 views

I have SqlConnection problem [closed]

How to open an closed sqlConnection inorder to access database. Please help me out.
0
votes
1answer
58 views

Problem when connecting to SQL Server

I'm trying to connect to my SQL Server Express and I get this error. This happens both locally and on client. Connection Timeout Expired. The timeout period elapsed during the post-login phase. ...
0
votes
1answer
52 views

SQL Server 2012 Exclude a value

I'm teaching myself SQL, and I ran into a scenario that I cannot seem to solve. Please any help. I have a table called tblRecord with a column called BuyerID, in this case there are two BuyerIDS, and ...
13
votes
9answers
738 views

Alternative to WHERE clause [closed]

Is there a way to only SELECT rows with certain data in a column, without using WHERE? e.g. If I had this: SELECT * FROM Users WHERE town = 'Townsville' is there a way to implement the WHERE ...
1
vote
0answers
35 views

Change Root Directory on server properties page in SQL Server 2014 SSMS

We did in inplace upgrade from SQL 2012 to SQL 2014 (I know it wasn't the best choice, and it won't happen again, so no need to beat that horse). I have both the MSSQL11.MSSQLSERVER and ...
0
votes
1answer
59 views

How can I generate a script to choose only top 10 items from each table in SQL database?

I know how to generate scripts that would contain insert queries of all records in all tables. But how can I limit this to top 10 records only from each table?I can select "Data Only" when generating ...
-2
votes
0answers
41 views

SQL Server 2014 - Query output

To be clear: I want to use the result of first query in the second query. Below are the two queries: Query 1 select files.originalfilename from files inner join digitalfiles on files.fileid ...
0
votes
1answer
24 views

Create a SQL Server Redirect (Alias / Linked Server)

I currently have a database on a named SQL server instance called \Mobius and database name of Mobius We need to move the database to the default (parent) instance but don't necessarily want to ...
1
vote
1answer
31 views

can i shrink log file in full recovery model

i have configured Always on Availability group where iam unable to shrink log file size through simple recovery model. can i shrink the log file size in full recovery model if yes or possible then is ...
3
votes
0answers
36 views

SQL DatabaseMail smtp error 5.7.57 at one site, email works at another with the same details

I have several SQL databases on different servers. I have used a script to set up Database mail. EXECUTE msdb.dbo.sysmail_add_account_sp @account_name = 'Emailer' ,@description = 'Email out ...
4
votes
2answers
95 views

How to avoid a “duplicate key” error?

This statement: INSERT INTO deleteme SELECT #t.id, 'test' FROM #t LEFT JOIN deleteme ON deleteme.id = #t.id WHERE deleteme.id IS NULL; ...will fail with a primary key violation in the concurrent ...
1
vote
1answer
33 views

Unable to Watch Live Data on Extended Events Session

I am running SQL Server 2014 Developer Edition on my PC. I am trying to view the data in the system_health session. In SSMS, I have connected to the database, expanded the server / Management / ...
0
votes
0answers
16 views

Error While restoring backup in SSMS

When I tried to restore a backup an error occurred showing access denied. The error message is as follows: Restore failed for Server 'VAIO\sqlexpress'. (Microsoft.SqlServer.SmoExtended) ...
2
votes
1answer
16 views

Returning XML Value for Extended Event

I would like to get the filepath for my extended event event_file and put it inside a variable but I'm stuck. Here's what I have: DECLARE @ExpensiveXML XML SET @ExpensiveXML = (SELECT ...
0
votes
1answer
33 views

Select tree-based structure

I have a table in my SQL Server database with data like this: ID ParentID --- --------- 1 NULL 2 1 3 1 5 1 5 4 5 6 8 6 7 9 9 10 I need a select statement that will return all the ...
3
votes
1answer
53 views

Fractional Transaction Count [on hold]

Based on this question I understand the meaning of the following sorts of errors: Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 1, ...
7
votes
3answers
274 views

Index tuning question

I am tuning some indexes and seeing some issues would like to take your advice On 1 table there are 3 indexes dbo.Address.IX_Address_ProfileId [1 KEY] ProfileId {int 4} Reads: 0 Writes:10,519 ...
0
votes
0answers
20 views

Send trigger email when someone connects to a database

How do I set up a trigger or alert so that when anyone connects to a specific database, an email will get send with that user's login credentials?
0
votes
0answers
9 views

SQL Server 2008 R2 FREETEXTTABLE with FORMSOF(inflectional, string)

Can anyone confirm that using FORMSOF(inflectional, ...) is redundant when querying FREETEXTTABLE in SQL Server 2008 R2? Using FreeTextTable without formsof... gives me the same result list but with ...
0
votes
1answer
50 views

How to insert values through inner join

Could anybody tell me how to do insert statement with inner join. i am trying to insert ProductName,ProductCompany,ProductPrice,ProductQty in Product table and CategoryName in category Table. And ...
0
votes
1answer
47 views

SQL server 2014 Transaction Log Backup fails

I have setup a Maintenance Plan for my SQL server 2014 Database. This Plan Generates Full Backup every Sunday, and Differential backup every Day and Transaction Log every hour. This Maintenance plan ...
1
vote
1answer
57 views

SQL Server deprecated Functions effect

I'm using SQL Server in various versions. In case of this I'm using functions which got deprecated. My question is, how a deprecated function affects the usage of SQL Server? The functions are ...
2
votes
1answer
64 views

Single row update using primary key affects many rows

I'm doing a very simple datetime update in a table using its primary key: update TABLE set END_DATE = '2015-10-14 00:00:00' where ID = 1165027; I received the message (1 row(s) affected) 183 ...
0
votes
0answers
23 views

how to shrink database log file size where the database is in full recovery and configured for AOA

How can i shrink database log file where the database is in full recovery and configured for Always on Availability group and i am unable to change it to simple recovery model. Earlier i used to ...
0
votes
0answers
23 views

Can I use Data Quality Services for checking data integrity?

As Data Quality Services documentation seems too broad, could anyone tell me if the DQS is suitable for solving such issue: find if each row in one table has corresponding row in second table and if ...
-2
votes
0answers
27 views

SQL Server SSIS job failure [closed]

Below are the messages for a task which succeeds when run from "schedule 9" and fails when run from username: Failure message The job failed. The Job was invoked by User WUNDERWEAR\dd1. The last ...
-1
votes
0answers
32 views

Database(In Recovery) Mode [closed]

I am using SQL Server 2008. My database is often switching to (In Recovery) mode. But still i can access the database through SSMS. When I try to access my database from ETL tool it is not ...
3
votes
1answer
32 views

How to call modify() on a nodelist in T-SQL?

I have a process step where I have an XML document in a SQL Server column and I need to alter the text of a node that could occur multiple times. Modify() with 'replace' DML only operates on single ...