Most Popular
1500 questions
26
votes
4 answers
SQLCMD command is not able to insert accents
I am trying to run sqlcmd.exe in order to setup a new database from command line. I am using SQL SERVER Express 2012 on Windows 7 64 bits.
Here's the command I use:
SQLCMD -S .\MSSQLSERVER08 -V 17 -E -i %~dp0\aqualogyDB.sql -o…
Oskytar
- 363
- 1
- 3
- 7
26
votes
1 answer
How does this syntax work? {fn CurDate()} or {fn Now()} etc
Recently I've been looking through some fairly old stored procedures that were written for SQL Server 2005, and I've noticed something that I don't understand. It appears to be some type of function call.
A sample:
SELECT o.name, o.type_desc,…
Hannah Vernon
- 70,041
- 22
- 171
- 315
26
votes
2 answers
How to best use connection pooling in SQLAlchemy for PgBouncer transaction-level pooling?
Using SQLAlchemy to query a PostgreSQL database behind PgBouncer, using transaction-level pooling.
What is the best pattern to use for this kind of set up? Should I have one-engine-per-process, using a ConnectionPool, or should I create an engine…
Juan Carlos Coto
- 1,558
- 4
- 18
- 25
26
votes
4 answers
How to model inheritance of two tables MySQL
I have some tables where I store data and depending on the type of person (worker / civil) that did a job I want to store it in an event table, now these guys rescue an animal (there is an animal table).
Finally, I want to have a table to store the…
edgarmtze
- 361
- 1
- 3
- 6
26
votes
3 answers
How do I declare and use variables in Oracle?
My main skills are with SQL Server, but I have been asked to do some tuning of an Oracle query. I have written the following SQL:
declare @startDate int
select @startDate = 20110501
And I get this error:
declare @startDate int
select @startDate =…
Mark Allison
- 525
- 1
- 4
- 9
26
votes
1 answer
How many queries per second is my Postgres executing?
How can I tell how many queries per second my Postgres database is executing?
Konrad Garus
- 633
- 2
- 7
- 7
26
votes
4 answers
Is data retrieved from SQL Server compressed for transmission?
Is data retrieved from Microsoft SQL Server compressed? If this is controlled by the connection string, is there any simple way to tell if any particular app is using it?
I'm examining analysis tools, and the volume of data can take minutes to…
Jon of All Trades
- 5,967
- 5
- 45
- 62
26
votes
2 answers
SELECTing multiple columns through a subquery
I am trying to SELECT 2 columns from the subquery in the following query, but unable to do so. Tried creating alias table, but still couldn't get them.
SELECT
DISTINCT petid,
userid,
(SELECT MAX(comDate) FROM comments WHERE petid=pet.id) AS…
BufferStack
- 393
- 1
- 3
- 8
26
votes
2 answers
How do I properly perform a MySQL bake-off?
I want to performance test (aka bake-off) MySQL server rpm against some other forks such as Percona server, MariaDB, and possibly some others. I'm hoping that by asking this question I can better understand the methodology behind setting up a proper…
randomx
- 3,934
- 4
- 30
- 43
26
votes
1 answer
Why MERGE doesn't insert more than 277 records into a table which is configured with temporal table and a non-clustered index on history table
I found again an issue with SQL Server and MERGE statement and need some confirmation.
I can reproduce my issue constantly on a Azure Database (but not on a on premise SQL Server 2017/2019).
Please execute following steps (step by step, not in one…
Daniel C.
- 363
- 2
- 6
26
votes
4 answers
If NoSQL stands for "Not only SQL", is SQL a subset of NoSQL?
The definition is a bit confusing - basically I'm asking if SQL is a subset of the NoSQl family:
I'm asking this because "Not-only" means NoSQL is much larger, but still includes SQL as a part of it.
On the other hand, since we can't do typical sql…
ERJAN
- 465
- 5
- 7
26
votes
1 answer
Execution plan shows expensive CONVERT_IMPLICIT operation. Can I fix this with indexing or do I need to change the table?
I have a really important, really slow view which includes some really ugly conditions like this in its where clause. I am also aware that the joins are gross and slow joins on varchar(13) instead of integer identity fields, but would like to…
Warren P
- 1,087
- 2
- 14
- 24
26
votes
1 answer
Is the optimisation fence behaviour of a CTE (WITH query) specified in the SQL:2008 standard? If so, where?
I see frequent references to WITH queries (common table expressions, or CTEs) acting as an optimisation fence, where the server isn't permitted to push filters down into the CTE queries, pull common expressions up out of the CTE, etc. It's often…
Craig Ringer
- 56,343
- 5
- 158
- 190
26
votes
3 answers
Is there a tool to check if my database is normalized to the third normal form?
I learned about normalization recently, and understand how important it is when implementing a new schema.
How can I check if my database is 2NF or 3NF compliant ?
Manual review is a sure option, but I'm looking for an automated tool here.
I'm not…
ack__
- 363
- 1
- 3
- 8
26
votes
10 answers
"Could not find stored procedure' even though the stored procedure have been created in MS SQL Server Management Studio
I have created a table testtable inside the database testbase that have the following structure:
product_no (int, not null)
product_name (varchar(30), not null)
price (money, null)
expire_date (date, null)
expire_time (time(7), null)
which I used…
Jack
- 2,509
- 14
- 36
- 42