An explicit value for the identity column in table can only be specified when a column list is used and IDENTITY_INSERT is ON SQL Server

Summary SQL Server won’t let you insert an explicit value in an identity column unless you use a column list. Thus, you have the following options: Make a column list (either manually or using tools, see below) OR make the identity column in tbl_A_archive a regular, non-identity column: If your table is an archive table … Read more

What is the data type for Currency in SQL Server?

answering to the question in the title, the datatype for currency is MONEY. the money datatype will store the information only, without the format: in your example the information is 11.23 so that’s what is saved into the database. the $ sign is part of the format so it will not be stored into the money field. the usual solution is to have a MONEY field … Read more

XOR in SQL Server

You can implement a XOR like this – don’t forget that the question will require you to use <= to correctly use the XOR operator:

The service cannot be started, either because it is disabled or because it has no enabled devices associated with it

Try to open Services Window, by writing services.msc into Start->Run and hit Enter. When window appears, then find SQL Browser service, right click and choose Properties, and then in dropdown list choose Automatic, or Manual, whatever you want, and click OK. Eventually, if not started immediately, you can again press right click on this service and click Start.

SQL Server Installation – What is the Installation Media Folder?

I am installing SQL Server 2008. I have installed .NET framework 3.5. Then I got folder SQL Server 2008 and performed following steps- I clicked configuration Tools. Then I clicked SQL Server Installation Center. I clicked “Installation” hyperlink on left side. Then I clicked “New SQL server stand-alone installation or add features to an existing … Read more

How to drop a table if it exists?

Is it correct to do the following? No. That will drop the table only if it contains any rows (and will raise an error if the table does not exist). Instead, for a permanent table you can use Or, for a temporary table you can use SQL Server 2016+ has a better way, using DROP TABLE IF … Read more