Dataset data is different that stored procedure

I have a stored procedure. SELECT ADDRESS.ADDRESSID, NAME, DOORNO, STREET, STATE, COUNT(SUB.ADDRESSID) AS FREQUENCY FROM ADDRESS JOIN ( (SELECT ADDRESSID FROM ADDRESS WHERE KEYWORD LIKE ‘%’ + @name + ‘%’) UNION ALL (SELECT ADDRESSID FROM ADDRESS WHERE KEYWORD LIKE ‘%’ + @doorno + ‘%’) UNION ALL (SELECT ADDRESSID FROM ADDRESS WHERE KEYWORD LIKE ‘%’ + […]

Calling web service from SQL Server stored procedure gives execute access denied (IIS Error)

I have created a stored procedure which calls a web service using Ole Automation Procedures. When I call it from one database server it does allow me to call web service, but when I call it from another database server it does not allow me to call web service and throws this response. I can’t […]

Using substring to strip text from text file & insert into SQL Server database & create script text file as result

Database Specification: SQL Server 2012 Problem Statement: I need a sql query (store procedure or function or set-base query … you the expert) to assist with processing 4.1 million records in efficient time. These records reside in a text file and therefore need to inserted into a database table. Note each record consist of the […]

Npgsql with linq expression to database

I develop windows service, which is connected to public web.service and incrementally download data to own database. This same service is for two customers. One of them have a MS SQL Server 2012 and the second have Postgres server. I created database structure (tables, indexes, foreign keys) for both database. Then a was creating Entity […]

Prevent man-in-the-middle attacks on ssms to SQL Server Connection

I’m connecting to a SQL Server instance in a shared environment using SQL Server Management Studio. I don’t want to take the hosting service’s word so I’d like to find a way to discover whether all communications are encrypted. Especially the password, since it seems from this answer that sometimes it’s sent in plaintext and […]

Using SSIS to create new Database from two separate databases

I am new to SSIS.I got the task have according to the scenario as explained. Scenario: I have two databases A and B on different machines and have around 25 tables and 20 columns with relationships and dependencies. My task is to create a database C with selected no of tables and in each table […]

How do I know a query plan is invalidated?

I’m executing EXEC sp_recompile <tablename> but I still see query plan cached for this table: SELECT CP.[objtype] , CP.[cacheobjtype] , CP.[size_in_bytes] , CP.[refcounts] , CP.[usecounts] , ST.[text] FROM sys.dm_exec_cached_plans as CP CROSS APPLY sys.dm_exec_sql_text (CP.[plan_handle]) as ST WHERE 1 = 1 AND ST.[text] NOT LIKE ‘%dm_exec_cached_plans%’ AND ST.[text] LIKE ‘%<tablename>%’ ORDER BY CP.[objtype] Why this […]

Sales Grouped by Week of the year

I have a requirement to output the number sales in a year to date in weekly format where Monday is the first day of the week and Sunday is the last. The table structure is as follows. SalesId | Representative | DateOfSale. Below is what I have tried but it doesn’t seem to give me […]

Webapi with EntityFramework gives Login failed for user

I have a Webapi project that runs fine when the database is local. However when I run the code locally and connect to a sql server on the Network I get a list of errors. It starts with The ‘ObjectContent`1’ type failed to serialize the response body for content type ‘application/json; charset=utf-8’. and the inner […]

syncing two database schemas

I have a source database and a destination database with common tables. Is there any online tool that will sync the schema of tables in the source to destination ? Both databases are in MSSQL

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