Tag: sql-server-2012

Refresh Application Automatically When Data changed in SQL Server

I use SQL Server and I have 3 Application servers. When a table in my database have changed I need to those application servers refresh there local cached data. I use a trigger to known change and send a message via Service broker queue. Then I create a stored procedure and assign it to activate […]

How do I copy SQL Server 2012 database to localdb instance?

I’m looking to copy a SQL Server 2012 Standard database to my localdb instance. I’ve tried the wizard which complains that localdb isn’t a SQL Server 2005 or later express instance. I also did a backup/restore but upon the restore in my localdb I get the following error… Running this… RESTORE DATABASE CSODev FROM DISK […]

SQL Server Management Studio won't let me add an index to a table

When I right click on the indexes folder in the table the “New Index” menu item is grayed out. I don’t understand why. I’ve deleted all data in the table just in case, and refreshed and restarted SSMS, but no luck. I’m using SQL Server 2012 Business Intelligence SP1 CTP.

Get difference between two times for SQL Server 2012

The background: I am trying to identify the length of time a Customer spends in a particular room. Each Customer is identifiable by a CustomerID, and when they visit they are assigned a VisitNumber. For example, if the customer visited today they would get a VisitNumber of say 111111. They would then leave and come […]

how to insert data parellel in three different tables

I have a stored procedure which will insert the bulk of records, now is there any possibility to insert data into 3 tables in parallel; First table inserting 1 million records. Second table inserting 1.5 million records. Third table inserting 500k records As per my knowledge – procedure insertion is happening one after other. So […]

What is the meaning of the following SQL Server declaration: datetime2(7)?

Inside a SQL Server query, there is: datetime2(7). I know datetime2, but I don’t understand (7). Can you explain the meaning of (7)?

Why is “close existing connections to destination database” is grayed out on SQL Server 2012 Management Studio?

I am normally using SQL Server 2012 Management Studio to restore a SQL Server database from a “bak” file. I do this by overwriting an existing database. In the “Options” page, there is a check-box labeled “Close existing connections to destination database”, which I mostly check because the target database is always “in use”, even […]

Unexpected results when using FIRST_VALUE() in SQL Server 2012

When I use FIRST_VALUE on a data set that I construct by hand I get one result, and when I use it on a data set that results from a left join, I get a different result – even though the data sets appear to me to contain the exact same data values. I’ve reproduced […]

A connection was successfully established with the server, but then an error occurred during the pre-login handshake in SQL Server 2012

Today I could not log into my local SQL Server 2012 instance with the following error message A connection was successfully established with the server, but then an error occurred during the pre-login handshake. provider: SSL Provider, error: 0 – An internal error occurred. (Microsoft SQL Server, Error: -2146893792) I found many similar questions here […]

Insert/Update/Delete with function in SQL Server

Can we perform Insert/Update/Delete statement with SQL Server Functions. I have tried with but SQL Server error is occured. Error: Invalid use of side-effecting or time-dependent operator in ‘DELETE’ within a function. AnyBody have any Idea why we can not use Insert/Update/Delete statements with SQL Server functions. Waiting for your good idea’s

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.