Issue while implementing Entity Framework 6.0 in VS 2012

While implementing Entity Framework 6.0 in VS 2012 (i.e. creating edmx file & tried to generate my Model class out of it), I got below error message (even though Test Connection to DB is succeeding). The ‘SqlStudio Profile Package’ package did not load correctly As a resolution step I tried to re install “Microsoft SQL […]

Why is fulltextsearch for phrase ignored in SQL Server?

I am executing the following SQL statement on an indexed SQL Server 2008 R2 database. SELECT * FROM mydatabase WHERE (CONTAINS(ColumnA,'”The Apple is red”‘)) The problem is that it returns too many entries. It also returns entries where ‘ColumnA’ contains only one of the words (‘Apple’ or ‘is’ or ‘red’…) and not only the entries […]

Microsoft/SSRS report textbox returns #error when string value that is decimal is converted to decimal and empty string is just printed

I have a value that is coming back from a database as string, but it could be a decimal and when it is a decimal I want to display it as a decimal and format it a certain way, if it isn’t a decimal then I just display whatever value comes back. Here’s my code: […]

Getting correct result with Group By query in SQL Server

I have the following query with CTE as ( select Barkod, sum(kolicina) as Kolicina from stocks where Barkod = ‘555’ group by Barkod ) select s.Barkod, s.Kategorija, s.Artikal, s.Opis, s.Kolicina, s.N_cena, s.N_Iznos, s.P_cena, s.P_Iznos, s.datum, s.Golemina from Stocks as s join CTE as b on b.Barkod = s.Barkod The results from this query is 555 […]

Capture current and previous values, across multiple fields in a self joined table

I’m trying to create a report that essentially redisplays the log tables for better readability, so all changes are captured in two columns, one Original Value and one Current Value column with a attribute column labelling what was changed. I’ve created a Temp Table for SQL Server for ease of testing. declare @T table (Utility_ID […]

TSQL Select query that generates output similar to the ms access multiple value fields

I have tables in SQL Server 2008 such as: TopicTable TopicID: nvarchar (Primary Key) ProgID: nvarchar topic1: bit topic2: bit topic3: bit topic4: bit The topic table looks something like the following: TopicID ProgID topic1 topic2 topic3 topic4 topic001 prog001 1 1 0 0 topic002 prog002 1 0 1 1 topic003 prog003 1 0 0 […]

Accessing a server from sp_addlinkedserver

I just successfully added another server using the following: EXEC sp_addlinkedserver @server=’serverA’ EXEC sp_addlinkedsrvlogin ‘serverA’, ‘false’, NULL, ‘user’, ‘password’ Now I would like to access a database that is on “serverA” I tried doing a simple query but struck out: Select top 5 * from sys.serverA <–Did not work (intellisense did not recognize it either) […]

Select with “loop while” with agroupment of values

( sorry for my poor english at first! ) I have a table with a few fields like this PK Name1 Name2 Value 1 nmAA nm2AAA 01A 2 nmAA nm2AAA 01B 3 nmAA nm2AAA 01c I need to have this result Name1 Name2 ValueList nmAA nm2AAA 01A, 01B, 01c I’m thinking in a loop that […]

Can I connect two external databases using Microsoft Access?

First, I apologize if this has been asked or is a trivial question. But, is it possible to connect to two external SQL databases through Microsoft Access? By way of background one is our CRM and one is our email management system. The two are completely distinct databases. And, reside in different physical and virtual […]

Use send_dbmail to send an email for each row in sql table

I am having difficulties figuring out how to make send_dbmail loop through my table and send a new email for each record. My table is dropped and re-created each time this package runs, sometimes it will have zero records, other times it may have a few (never anything significant, always < 10). This works fine […]

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