Questions tagged [sql-manager]
22 questions
33
votes
4 answers
How to drop a SQL Server user with db owner privilege
I need to drop a user with dbowner schema from a SQL Server database. I cannot drop it as it is since I get this error message
Drop failed for User 'network service'. (Microsoft.SqlServer.Smo)
The database principal owns a schema in the database,…

Sofia Khwaja
- 1,909
- 3
- 17
- 20
4
votes
1 answer
How can I store a temporary table from an executed procedure?
I have the following code:
SELECT @Name = [TrigTable]
FROM [dbo].[setdevelopmentjob]
WHERE [TrigTable] IS NOT NULL
PRINT @Name
SET @sql = 'SELECT * FROM ' + @Name;
#TriggerTable = EXEC sp_executesql @sql;
SELECT * FROM #TriggerTable
Obviously…

Joshua Jack
- 65
- 3
2
votes
0 answers
SEARCH and eliminate duplicate row on 2 table
im new on SQL and trying to create a table based on two tables.
I have two tables with 7 columns each one some registers had incomplete information BUT i need to filter this.
Conditions.
-cannot have duplicates on ID_1 on result table. "easy i think…

LDRNSJ
- 21
- 4
2
votes
2 answers
incorrect syntax near 'go' - can t have ' into double comment
I don't understand what's happening.
This generates an error
create procedure sp_test
as
/*
/*
a
*/
e'
*/
begin
print''
end
go
"Msg 102, Level 15, State 1, Procedure sp_test, Line 13
Incorrect syntax near 'go'."
While this…

elle0087
- 840
- 9
- 23
1
vote
1 answer
Error occurs: "Using GRANT OPTION on procedures not allowed" when creating a PSQL variable
We are using SQL manager for interbase-firebird and also Firebird 3.0.5.
We are creating a procedure and that works fine.
However from the moment we add a psql variable to the procedure we get below error. When we remove the variable the procedure…

free
- 153
- 1
- 2
- 18
1
vote
2 answers
How can I seperate one column into multiple columns depending on their value when selecting it?
I have a table called assignment_answers, which has the following attributes:
assignment_answers_id, question_id and order. The order is an attribute, which can take a value from 0 to 9.
I would like for every value that it can take to make it be…

marialadelbario
- 325
- 1
- 4
- 19
1
vote
1 answer
SQL Server : trying to convert a date with a case
I have this SQL code that does warranty registration data transfer to the equipment sheet. But i get 4 error messages that are
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near ','.
Msg 102, Level 15, State 1, Line 16
Incorrect syntax…

MasterProgramer
- 25
- 5
1
vote
2 answers
C# SQL query is lagging
I developed an application which is manipulating data from a database. When I run the app from my PC, or PCs near me (in my company, same server) it's working properly, but when someone from the same company but another server (another Country) is…

Forgacs Norbert
- 43
- 4
0
votes
0 answers
SQL Manager: How to move favorite queries to another database
I use SQL Manager with PostgreSQL 9.3.18, and I have to restore the main database, located on server, to a new local DB every week. Ending up with 4 databases the last week of each month.
I have a bunch of favorite queries that I need them in all…

Ms workaholic
- 373
- 2
- 8
- 21
0
votes
1 answer
Set a variable based on an IF statement in SQL Manager
I have a table called Ordhdr, i want to create a query based on the [status] column of that table. I have many statuses that i want to group into Won, Lost, Pending for easier viewing. How do i set my declare, set statement to first 'rename' the…

Mary Mahoney
- 53
- 2
- 10
0
votes
0 answers
SQL variable in SELECT statement
This seems like it should be so easy but I'm doing something wrong. I want to declare a value so that I can enter it once on top and then use it throughout my code.
A simple version of the code is below, but it doesn't work. I get no results when I…

Mary Mahoney
- 53
- 2
- 10
0
votes
1 answer
Deleted database still shows in database list in PostgreSQL SQLmanager
Using PostgreSQL 9.4.12, I created a new database called new_db and before adding any table or any other object to it and probably before registering it (I don't remember if I've registered or not), I dropped it. Now, it still shows in database list…

Ms workaholic
- 373
- 2
- 8
- 21
0
votes
1 answer
How to use data from a table as a value for another command in SQL?
I have in mind something like this:
Let's say there is a
Select Client_name
From Clients_Master_Table
where Client_Name = 'DS_Store';
So, here's how to use 'DS_Store' which is given from the table as a value for the command:
As if to do
Select…
0
votes
1 answer
QUERY WHERE BOTH FIELDS DON'T CONTAIN SOMETHING
I want to query data where BOTH the phone1 and phone2 codes don't contain the word 'mobile'. Tried AND and OR statements but its not working when 'MOBILE' exists in one of the fields.
select ORDCON.* from PL00.dbo.ordhdr inner join…

Mary Mahoney
- 53
- 2
- 10
0
votes
0 answers
SQL Management Studio: "DBISAM Engine Error # 12035 The table 'step_log' is not the correct version'"
I´m using SQL Management Studio for PostgreSQL to migrate another DB to PostgreSQL. On starting up and closing down the studio i get the error message from above.
It does not affect any of the steps after yet (the actual work i do with the program)…

coffee_bear
- 31
- 1
- 8