How can I script the deployment of a Visual Studio database project?

How can I script the deployment of a Visual Studio database project? I have a DB project in visual studio and I would like to use it in order to deploy on remote machines via a script. I notice that when I ‘deploy’ from visual studio, it generates a .sql file. I intercepted this file […]

PHP / PDO / MSSQL how to get error informations?

I’ve done a lot of searching, but can’t find anything about my issue. I’m using PDO with Driver PDO_DBLIB to access a MS SQL database. I generally use prepared statements, but if any query fails I don’t get any additional information about the error except for this: General SQL Server error: Check messages from the […]

Entity Framework not getting Spatial type data in result from Sql Server stored procedure

I’m using Entity Framework 6 with .Net 4.5. I have a stored procedure that selects and returns data. One of the return columns is a geography type. In Visual Studio 2015, I right click the .edmx file, click “Update Model From Database…”. This action gets my stored procedure and creates a complex type of storeprocedurename_Result. […]

SELECT COUNT(DISTINCT ) from several tables

I can perform the following SQL Server selection of distinct (or non-repeating names) from a column in one table like so: SELECT COUNT(DISTINCT [Name]) FROM [MyTable] But what if I have more than one table (all these tables contain the name field called [Name]) and I need to know the count of non-repeating names in […]

error when running any query in sql server management studio: the file exists

When I run any query in sql server management studio, I get the following error: An error occurred while executing batch. Error message is: The file exists. Restarting SSMS didn’t help. Neither did rebooting the machine. The only thing I found on Google was someone saying “report the bug to microsoft” 😛 (Windows XP Pro […]

How to restrict a user to access objects of only one schema in SQL Server 2008?

I want to restrict a user to only one schema and to only Select privilege in that schema in SQL Server 2008.

SQOOP SQLSERVER Failed to load driver “ appropriate connection manager is not being set”

I downloaded sqljdbc4.jar. I’m invoking sqoop like so from the folder (where the jar is stored): sqoop list-tables –driver –connect jdbc:sqlserver://localhost:1433;user=me;password=myPassword; -libjars=./sqljdbc4.jar I’m getting the following warning & error: 13/10/25 18:38:13 WARN sqoop.ConnFactory: Parameter –driver is set to an explicit driver however appropriate connection manager is not being set (via –connection-manager). Sqoop is going […]

Using a .MDF SQL Server Database with ASP.NET Versus Using SQL Server

I’m currently writing a website in ASP.NET MVC, and my database (which doesn’t have any data in it yet, it only has the correct tables) uses SQL Server 2008, which I have installed on my development machine. I connect to the database out of my application by using the Server Explorer, followed by LINQ to […]

Drop column and all dependent objects using data definition language

I need to remove a column from a table, but when I try to remove it: The object ‘object_name’ is dependent on column ‘column_name’. ALTER TABLE DROP COLUMN column_name failed because one or more objects access this column. I can look for the dependency in the system tables and remove it manually, but I need […]

What is the best way to fetch records batch-wise from SQL Server

Scenario: we are fetching rows from SQL Server to C#.Net console application and doing action on the retrieved data from SQL Server through stored procedure; after the action is performed the new data is stored into the MongoDB using C#-MongoDB-Driver. Issue: There are billions of rows. My stored procedure contains query as follows: select * […]

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