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
2answers
76 views

How to create a VIEW in SQL Server [closed]

I have a user table and I need to create a VIEW so a user can only see their own data/row. How could I achieve this? I have been searching online but I can't find anything useful User with user_id, ...
0
votes
0answers
22 views

create two foreign key from one table sql server

i am creating user table like code PK Table CREATE TABLE TblUser (UserId int identity primary key ,Name varchar(20)) AND creating one more table FK Table CREATE TABLE TblAnnouncements (Id int ...
0
votes
1answer
37 views

How to enforce that one row in a parent table MUST be associated with at least a row in a child table [duplicate]

I have a one to many relationship enforced via FK, classic example order and order_item, whereby a fk on the order_item to the order table enforces that one item belongs to one order, and one order ...
0
votes
1answer
38 views

how big of a role does hardware play? [closed]

I'm the developer, not the DBA. I don't know much about setting up databases but i'm concern of the setup at my current work. The server is installed on desktop PC hardware(i7, 16GB RAM, 1 TB SATA ...
1
vote
1answer
18 views

SSIS Package Security

I am writing a Package for one of my client according to his requirements. Package development is totally complete now time is to protect it with some security. Is this possible I encrypt all the data ...
3
votes
2answers
80 views

SQL Server 2008 R2 - Unable to delete Login

I've been using this site for a while and this is the first time I've had to ask a question, but just wanted to say "Thank You" to everyone who has helped me in the past (without knowing they did so). ...
5
votes
2answers
84 views

Is it possible to change the default style used by CAST/CONVERT when converting DATETIME? [closed]

When you attempt to CAST a DATETIME as VARCHAR in SQL Server, the default date formatting style is a fairly inaccurate date format that loses the precision of both seconds and milliseconds. For ...
2
votes
3answers
63 views

Order by query optimization for multi select data (enum)

We previously used to store multi select data (enum) using pipe separated characters, as shown below like this - which made ordering on that enum data very simple. ╔═══╦════════════╦═════════════╗ ║ ...
1
vote
2answers
74 views

Merge faster than Insert

Are there any advantages/disadvantages of making use of a merge over a insert function? Can an insert statement make use of the `OUTPUT' Note: the ON clause for the merge is set to 1=0 (always ...
0
votes
2answers
51 views

SQL Server : replication between two different locations

I have problem setting my replication between two servers on different locations (different network). Steps I have done: setup aliases in SQL Server Native Client configuration on both servers ...
10
votes
2answers
439 views

Help with PIVOT query

I have a table with below structure : CREATE TABLE [dbo].[AUDIT_SCHEMA_VERSION]( [SCHEMA_VER_MAJOR] [int] NOT NULL, [SCHEMA_VER_MINOR] [int] NOT NULL, [SCHEMA_VER_SUB] [int] NOT NULL, ...
1
vote
1answer
44 views

Open port 1433 to use SSMS securely

I have a SQL Server placed in DMZ and I want to give access to internal users (and VPN clients) to use SSMS to remotely connect to it via port 1433 so server will accept the connection only form ...
0
votes
0answers
15 views

Does splitting to multiple databases has performance impact? [duplicate]

I am scaling an old application which was designed to have ten databases. These databases are related to each other. The database is SQL Server 2008. The databases combined size is less than a GB. I ...
0
votes
0answers
30 views

Best method to implement HA and DR, replication via 1 PUB and 2 SUB or replication and LS both

I need a advise on one of our projects where: We have 3 SQL database servers A, B and C: A is the live production server with around 200 users with a database of size 1.5 TB hosted. B is going to ...
1
vote
1answer
43 views

LSCopy job fails on SQL Server 2005 - Insufficient space

I'm having some trouble getting my LSCopy job of Log-Shipping on my SQL Server 2005 server, to work. The LSBackup job is configured so the backup is made locally (D: drive) The LSCopy job is ...
0
votes
0answers
66 views

Sudden High CPU Usage On SQL Server 2008R2

Our SQL Server is experiencing sudden high CPU usage since 12:30am today. This server is used internally so nobody should be accessing the server at that time. I'm not sure why 12 hours later the CPU ...
2
votes
2answers
41 views

Do valid to/from columns on a fact table make sense?

I recently came across "valid from" and "valid to" columns on a fact table. Obviously this is common for dimensions but I've not seen them on fact tables before and can't find any info suggesting ...
0
votes
2answers
32 views

SQL Server database backup to store only the last 7 backups in a file

I want to create a scheduled task that will run (every night) a SQL script to fully backup my database X to a file. I want that file to store up to 7 full backups. The way I tried doing this is using ...
1
vote
0answers
50 views

SQL Server 2012 Security Best Practices [closed]

I'm looking to compile a good list of SQL Server 2012 security best practices. Do you know of any good articles or lists?
0
votes
1answer
23 views

Connection problem different errors .net application

We have a SQL server with some relational databases. We have another webbserver with applications which communicate with the databases. We have an issue with one of our customers and we get some ...
0
votes
0answers
24 views

How to run stored procedure with EXECUTE AS OWNER which modifies data on a linked server?

I suppose this will be marked as duplicate but I can not understand solutions in other questions. I have 2 SQL servers: SQL A (I will call it SQL) and SQL B (I will call it SQLinked). The second SQL ...
0
votes
0answers
34 views

Strange SSIS-Package problem ( ASYNC_NETWORK_IO)

I've read a lot of posts here about this warning. Have been searching on the Internet, but not like this case. We are having problem with integration services packages. When I run the query (that ...
0
votes
0answers
48 views

how to join two table columns ,one column value pivot using

CREATE TABLE [dbo].[NewsComments]( [TitleID] [nvarchar](100) NOT NULL, [Comments] [nvarchar](max) NOT NULL, [CreatedDate] [datetime] NOT NULL, [Status] [char](10) NOT NULL, ...
2
votes
0answers
34 views

Hiding server folders for specific user in SQL Server Management Studio [closed]

Is it possible to hide folders like Security/Server Objects/Replication/.. for a specific login? I have a user who now connects to the SQL Server and he can only see hes own database. This is fine but ...
3
votes
1answer
249 views

Delete using a composite key

I am trying to wrap my head around creating a delete statement for a table with a composite key. I would like to create something like: DELETE FROM table_example1 WHERE COLUMN1, COLUMN2 ...
-3
votes
1answer
49 views

How to migrate a database from SQL server to Oracle? [closed]

I have been assigned a task to migrate a database from SQL server to Oracle. But I have no idea about how to do it. Also, is there any need to change the existing data model?
1
vote
1answer
69 views

Moving SQL Server 2012 Database to SQL Server 2008 R2

I follow the answer of Mr. Kin in this post How to move a database from SQL Server 2012 to SQL Server 2005 I run the query without errors, but when I check my blank database created on SQL Server ...
0
votes
1answer
11 views

Access SQL Server Analysis Services Remotely for Data Mining Tool

I have SQL Server Enterprise trial in one computer. I want to use that the Analysis Sevices of that computer as a backend for using the data mining tool for excel in other computers. I was able to do ...
4
votes
2answers
45 views

Converting outer apply with Correlated subquery in SQL Server to SQLite

I need to convert a query in SQL Server to SQlite and I have replaced the outer apply to left outer join, but how to limit the subquery to return only 1 in this situation? And how to pass the ...
2
votes
1answer
46 views

Number of SQL Server languages

As per MSDN There are currently ten SQL Server languages. The report server language for a given report server instance will always be one of the ten available languages. Support for all ten ...
2
votes
0answers
27 views

How long does the final phase of an online index creation take?

In reading the whitepaper: Online Indexing Operations in SQL Server 2005 it says: The online index build process can be roughly divided into three phases: Preparation Build Final ...
0
votes
1answer
36 views

Triggers on Insert or Update SQL Server (Spatial)

I am looking at creating a trigger on a live SQL Server spatial table that will update a column when a user either: Creates a new feature Updates the geometry of a feature in a GIS application ...
0
votes
2answers
39 views

SQL Server user cannot select from a table it just created?

I'm having trouble understanding permissions in SQL Server (in this case SQL Server 2012, but not sure how version-dependent this issue is). I can create a database, create a login/user on master, ...
10
votes
1answer
127 views

How to optimize a query so that it seeks on one index first, and then another index after that

I have two sets of earth measurements from satellite data, each with time fields (mjd for mean julian date) and geography positions (GeoPoint, spacial) and I'm looking for coincidences between the two ...
0
votes
1answer
47 views

Restore user db from UNC

I need to create a job that restores all user databases from UNC to my SQL Server. All the backups, for 3 days, are located in the same folder and I need to restore the last modified backup. What is ...
0
votes
1answer
44 views

Replacing a Cursor with a single Query possible?

I have this challenge where I'm trying to figure out if I can write something in a single query rather than using a cursor. The problem is I need to get items from a batch table based on a list of ...
0
votes
1answer
35 views

Index cleanup/usage help

My question is this: When running sp_blitz, I get a lot of these 2 warnings/suggestions: Index Hoarder: Unused NC index and Feature-Phobic Indexes: Potential filtered index (based on column ...
0
votes
1answer
66 views

How to exclude weekends and holidays in a query

I have been tasked with creating a flat file. One of the fields that I need is a date field. I need the disco date to be LAST_EVENT_PROC_DT + 12 unless that date falls on a weekend or holiday,if so ...
1
vote
1answer
49 views

How to confirm if the backups are going to tape in SQL Server 2005 and 2008 R2

We have many of our SQL Servers where we take the backup locally on the server as well as over the network to other server in case of disaster. Also, we have a process set that server support team ...
3
votes
3answers
570 views

How does unique key help to improve SQL query performance?

Suppose I have a table with an id column and and I am maintaining unique values manually while inserting and updating records instead of creating a unique key on that column (e.g. by using a date ...
2
votes
2answers
100 views

Changing an nvarchar column to datetime

I am new to SQL Server and I have a problem. I created a database to store dates in an nvarchar field but now I need to convert that field to datetime. I searched the internet and couldn't find a ...
0
votes
1answer
35 views

How to Store text of 15 to 20 KB file data in blob or as text? [duplicate]

How to Store text of 15 to 20 KB file data in blob or as varchar in sql Server?
-2
votes
2answers
33 views

how to join one select statement to another pivot select statement [closed]

SELECT emp.UserId ,emp.EmployeeId ,emp.FirstName ,emp.MiddleName ,emp.LastName ,emp.MobileNumber ,emp.HomeNumber ,emp.OfficeNumber ,convert(VARCHAR(10), emp.USJoindate, ...
2
votes
1answer
22 views

SQL Server Active Directory login groups with limitation

I'm DBA in my organization and use SQL Server 2012 and 2014. I requestd to define multiple group in active directory such as Developer, DBA, supporter and ets... and add my users to this groups. after ...
0
votes
2answers
128 views

Calculating values from three related tables, without using join or union

I have a simple basic three tables on SQL Server database: What is needed is to get the quantity available, without using joins or unions which is calculated: Quantity Available = Items Opening ...
6
votes
1answer
378 views

Move live SQL Server database to a new server

I have a production server running SQL Server 2008 Web Edition, and it has to keep running 24x7 with almost no down time, and it's the time for us to move to a more advanced server hardware, also it's ...
1
vote
1answer
45 views

Overwhelmed with Sensor Data - Excel to SQL fails

I'm managing a lot of sensor data and need to do charting, smoothing, stats over time on the data. Currently I import the data from flat files using VBA to do ETL into Excel. The format of the data ...
0
votes
0answers
24 views

Log Shipping Fails to create backup after Server reboot

We made a change last week to point our log shipping backup jobs to a new Windows File Share. For three days everything was running successfully. On Saturday night we performed our monthly ...
0
votes
0answers
30 views

ASP.NET Session Database - what user to create?

I am migrating a .Net 3.5 website with SQL Server 2005 Enterprise databases to SQL Server 2012 Enterprise (website still .Net 3.5). It uses ASP.NET session state database of type "t" Temporary. ...
2
votes
0answers
62 views

bug in sp_rename

I've searched high and low, but I cannot find anyone mentioning that when you run sp_rename, then you should mark the objects for recompilation too. As in EXECUTE sp_rename 'fct.MyTable', ...