|
Does any one know of a query builder tool that can be used on Oracle databases and integrated into a WPF application. There seems to be a squillion SQL Server tools out there but not many Oracle ones. I specifically DON'T want a DB management tool.
I need the users to be able to browse views, then build reasonably complex queries and view the results.
[edit] This looks promising EasyQuery[^] [/edit]
Never underestimate the power of human stupidity
RAH
modified 30-Jun-15 20:44pm.
|
|
|
|
|
Do you need a graphical tool or just a text tool?
|
|
|
|
|
I have an C# Windows Forms application (let's call it "APP-A") that I use on a weekly basis. I've been using APP-A for a while and recently needed to add the ability to store data into a MS-SQL database.
So I added EntityFramework 6.1.3 to my project (using NuGet) and using Code First, I quickly added my model classes and a dbcontext class, targeting my local SQLEXPRESS instance.
All works, life is good, the data I need to store is in the DB, success!
Next, I needed to move my SQL DB to one of our MSSQL servers, so I changed the connection string in App.config and ran the application, expecting the DB would be created on the server.
The DB was not created so I manually created the DB on the server, then ran the application and it won't connect to the server DB. I then changed the connection string back to point to my local SQLEXPRESS, and the application again works perfectly.
Frustrated, I created a brand new C# console app (lets call it "APP-B") and added EF 6.1.3 to it, then copied my models and dbcontext classes and connection string from APP-A to APP-B and attempted to connect to the DB on the server, which APP-B did without a problem.
I then deleted the DB from the server, re-ran APP-B and the database was recreated correctly on the server.
I changed APP-B connection string to point to my local SQLEXPRESS and it connected to the local DB fine, then I changed the APP-B connection string to point at the server and it again works fine.
So now I have two projects, APP-A which will connect to my local SQLEXPRESS but not the server, and APP-B which can access BOTH the server DB and the local SQLEXPRESS DB.
I cannot emphasize this enough: both APP-A and APP-B contain the same models and dbcontext classes as well as the same connection strings.
Today I removed and reinstalled EF 6.1.3 from APP-A and I still get the same results - APP-A can access the local SQLEXPRESS DB, but not the server DB.
Has anyone ever seen this behavior before?
Sincerely,
-Mark
mamiller@rhsnet.org
modified 25-Jun-15 15:53pm.
|
|
|
|
|
SOLVED!
The problem was caused by WHERE my APP-A project was located.
At my work we have shared user folders that are hosted on the network, and that is where my APP-A project was located.
The problem with that is that these shared folders are not trusted by our SQL servers, so when my application ran from that location the SQL server would reject the connection.
I just moved my project to my local C: drive, rebuilt it and ran it and viola! it connects to the SQL server database without issue.
My APP-B project was created on my local C: drive which is why it was able to access both the local SQLEXPRESS and the SQL server databases without issue.
Sincerely,
-Mark
mamiller@rhsnet.org
|
|
|
|
|
i want to stop some peoples in my organization to access SQL server through SQL managment Studio.
|
|
|
|
|
You can't. You can't know how they're accessing it and it shouldn't matter anyway; either they have access or they don't.
|
|
|
|
|
How can you say this ? i know they are accessing through SQL management studio.what you think if we can change the port or any other method ?
|
|
|
|
|
Azam Niaz Ch. wrote: i know they are accessing through SQL management studio
How?
|
|
|
|
|
Just FYI, it looks like the Management Studio executable identifies itself as something similar to "Microsoft SQL Server Management Studio" or "Microsoft SQL Server Management Studio - Query" when it connects to SQL Server. This shows up in the program_name column of the dynamic management view sys.dm_exec_sessions.
Scott
|
|
|
|
|
Which means nearly nothing; you can set the applications' name in the connectionstring. It would not be hard to create a console-app to have me execute SQL with the same or no name at all.
If someone has access, he has access. Disabling the tool he/she uses simply means changing tool to achieve the same.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Forget the client tool, SSMS is just a UI and can be replaced by a number of tools. You need to control access to your database/servers using the standard security setting built into the database and server applications.
Assuming you are system admin for the database you can start setting login requirements, creating schemas and other standard practices.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
The quickish and simple way:
(1) remove SSMS from their computers
(2) restrict access to the server so that they can only access views and cannot perform any updates, inserts or deletes or do anything else for that matter - views only, that's a simple way of providing more security.
Notes: given (2), (1) is not strictly necessary, however the only people using SSMS should be the DBAs so it is probably best to get people out of the habit of having access to it(I know... if people download Toad they will have similar features available).
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
GuyThiebaut wrote: the only people using SSMS should be the DBAs NNnnnnnnooooo, don't make the developers use VS for Ghus sake. We have a bunch of DBA's who are so divorced from the developers I have never even met one. They only look after production and accept scripts from us for changes.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi All,
I am getting the following error when I am running the stored procedure.
Msg 217, Level 16, State 1, Procedure rptClassInformation_sel, Line 26. Maximum stored procedure, function, trigger, or view nesting level exceeded (limit 32).
When I remove the following part, it is not throwing that error. Can you please let me know where am I missing, am I making something wrong, is it related to Line 26 as in the message.
WITH CTE AS
(
SELECT FILTER.GroupKey,
FILTER.ClassScheduleId,
SUM(SlotCount) AS SlotCount
FROM #SlotInformation INFO
INNER JOIN #Base FILTER
ON FILTER.ClassScheduleId = INFO.ClassScheduleId
AND (
@Level = 'Class'
OR FILTER.UseInAggs = 1
)
WHERE SlotPlanTypeId IN (@SLOTPLAN_ECEAP, @SLOTPLAN_ECEAPSPED)
GROUP BY
FILTER.GroupKey,
FILTER.ClassScheduleId
)
INSERT INTO #Results
(GroupKey, Identifier, Name, Value)
SELECT WEEK.GroupKey,
'NIEER' AS Identifier,
'Number of ECEAP slots in ECEAP classes meeting 8 or more hours per day' AS Name,
SUM(CASE WHEN WEEK.AverageHoursPerDay >= 8 THEN CTE.SlotCount ELSE 0 END) AS Value
FROM #WeeklyOverview WEEK
INNER JOIN CTE
ON CTE.GroupKey = WEEK.GroupKey
AND CTE.ClassScheduleId = WEEK.ClassScheduleId
GROUP BY
WEEK.GroupKey
UNION ALL
SELECT WEEK.GroupKey,
'NIEER' AS Identifier,
'Number of ECEAP slots in ECEAP classes meeting at least 4 hours but fewer than 8 hours per day' AS Name,
SUM(CASE WHEN WEEK.AverageHoursPerDay >= 4 AND WEEK.AverageHoursPerDay < 8 THEN CTE.SlotCount ELSE 0 END) AS Value
FROM #WeeklyOverview WEEK
INNER JOIN CTE
ON CTE.GroupKey = WEEK.GroupKey
AND CTE.ClassScheduleId = WEEK.ClassScheduleId
GROUP BY
WEEK.GroupKey
UNION ALL
SELECT WEEK.GroupKey,
'NIEER' AS Identifier,
'Number of ECEAP slots in ECEAP classes meeting fewer than 4 hours per day' AS Name,
SUM(CASE WHEN WEEK.AverageHoursPerDay < 4 THEN CTE.SlotCount ELSE 0 END) AS Value
FROM #WeeklyOverview WEEK
INNER JOIN CTE
ON CTE.GroupKey = WEEK.GroupKey
AND CTE.ClassScheduleId = WEEK.ClassScheduleId
GROUP BY
WEEK.GroupKey;
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
modified 22-Jun-15 12:59pm.
|
|
|
|
|
A common table expression can only be used in the statement which immediately follows its declaration. In your code, that's the SELECT * FROM CTE; statement.
If you want to re-use it in the INSERT INTO statement, then you have to re-state it:
WITH CTE As
(
...
)
SELECT * FROM CTE;
WITH CTE As
(
...
)
INSERT INTO #Results
...
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I am sorry but that was not the issue even without putting the select statement error was coming. I put that select statement in process of debugging it.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
Hi all
Currently now I used MS SQL Server Management Studio 2008.
I have an existing table with data already store on that table.
Table Name :
Application
Column :
Categories (nvarchar(1), null)
Sequence (nvarchar(1), null)
Detail (nvarchar(150), null)
I would like to ask how to add primary key to column Categories and Sequence ? Do I need to use alter query?
Thank you in advance !
|
|
|
|
|
|
Alright ! i got it now. Thank you Peter
|
|
|
|
|
Hi,
for creating primary key u must need to maintain that columns as not null,
so first execute this query to make it as not null
<pre lang="sql"> ALTER TABLE D_D_ext
ALTER COLUMN Categories NVARCHAR(1) NOT NULL ;
ALTER TABLE D_D_ext
ALTER COLUMN Sequence NVARCHAR(1) NOT NULL ;
Then execute this query for creating Primary key
ALTER TABLE D_D_ext
ADD CONSTRAINT pk_D_D_ext_Categories_Sequence PRIMARY KEY (Categories, Sequence)
Thanks
dhamu
|
|
|
|
|
Hi dhamu
alright ! i try to apply the suggestion that you give. thank you for your response
|
|
|
|
|
You can't define a primary key on a nullable column, so first you will need to ensure there are no null values in the Categories column and in the Sequence column. Then you can alter the table so these columns are not null:
ALTER TABLE [Application] ALTER COLUMN Categories NVARCHAR(1) NOT NULL
ALTER TABLE [Application] ALTER COLUMN Sequence NVARCHAR(1) NOT NULL
Then you can create your primary key:
ALTER TABLE [Application] ADD CONSTRAINT PK_Application PRIMARY KEY (Categories, Sequence)
|
|
|
|
|
I'm developing a c# application to handle communication between two systems each one is interacting with the sql server database , the first one is a scada system used for supervision equipment (alerton envision for bactalk 3.0) and the second system is a coswin 8i which is a software package for a cmms system , thanks in advance . I add that I intend to work with windows services with a timer to ensure the recuperation of the lines that are added every 2 min to the table "Alarm" of the scada system and add them into the table "Intervenant" of the cmms system in order to get these informations as a service request interface at Coswin. I looked for the first time the server of the scada system and it wasn't something that gives hope for me especially since I could not find the interface of a dbms sql server , I found it integrated in the structure of the scada system also I don't find any sql server services in the Computer Management window on the computer server. If you can come to my assistance especially as it's a job I need to do for my final project studies , thank you very much .
|
|
|
|
|
Did you get any success with your project???
I'm developing a c# application to pull out data from the Alerton Envision Bactalk system, but there is no much information how to establish a connection between my interface and Alerton database, any help will be very appreciate.
|
|
|
|
|
Hi,
I was asked a question the other day which was, does using SQL Server Replication improve query response time. I answered no, because I couldn't quite see how it would. I thought I'd better do a bit of research before giving a definitive answer though
Thanks,
|
|
|
|