Tag: database

Jetbrains Datagrip 2017.1.3, force columns exported when dumping data to sql inserts file

I have an SQL server database with a lot of tables and data. I need to reproduce it locally in a docker container. I have successfully exported the schema and reproduced it. When I dump data to an SQL file, it does not export automatically generated fields (Like ids or uuids for example) Here is […]

Design SQL Server database correctly

I have simple registration form, but there are 3 checkboxes for example: Name: [ ] Email: [ ] Pass: [ ] What do you like at free time? Reading: [ ] Travelling: [ ] Sport: [ ] As in example above you see “What do you like at free time?” There are 3 checkboxes. There […]

SQL – Why Does This Happen?

These are the tables that I’m working with. With that in mind, I want to showcase the Employees that are both a supervisor and a manager. But when I used this select e1.fname,e1.lname from employee e1,employee e2,department where e1.ssn=e2.super_ssn and e1.ssn = Mgr_ssn This was the output I know I can solve the problem with […]

Why does trying to save a URL with a stored procedure only insert a point?

What I want is to save the url of an image, as I have seen the URLs are saved with two or four diagonals depending, so they are not taken as special characters and I already try those two ways, sending my URL string with more than one Diagonal attached. I have debugged and followed […]

Making database mdf work across different computers

I know this is kind of a stupid question but it gives me a lot of problems. Me and my partners in college projects have a lot of issues making the database mdf work when we send each other the visual studio projects. It gives us errors about the versions of sql server. Is the […]

How to create a new database and tables inside it in SQL Server?

I’m using T-SQL in order to create a database, and then populate it with tables. The point is that I can create the database successfully, but then when I create the tables it adds them inside the master database, not the newly created one. Here is the code segment that I have: USE master; GO […]

Query against a view under master database is much slower than query directly under specific database

I am not sure whether there exists a general answer before I give more details. For exmaple: I have a view named vw_View I tried the following two queries to get the result: Under master database select * From [test].[dbo].[vw_View] Under test database select * From [dbo].[vw_View] Could anyone tell me why query against the […]

How to Automate Query Results in Microsoft SQL Management Studio 2012 and send the query results to WCF service as Instant Notifications?

I am new to SQL Server. I need track the Data Changes in Database Table inside the Microsoft SQL Server Management Studio.If any Data insertion,Deletion and modification done..in Table ,the WCF service should receive notifications from SQL Server 2012 Database. Is this possible to send instant notifications of Data Table from SQL server to WCF […]

storing feet/inches in DB

I have many different strings with feet/inches like this: 10 feet and 8 1/4 inches 7 feet and 4 3/8 inches I need to store it to DB (I use MS SQL) How to do it the best way? I see the following approaches: store separately. One field for feet, one field for numerator and […]

SQL case expression to create a range

I am currently using Microsoft SQL Server. I am trying to work with case expressions within my view to create a range. Here is an example: The range minimum cannot be below 0. The range maximum cannot be above 100. Expected output IE: 22.67-88.23. Here is what I attempted. CONVERT(varchar(12) ,(CASE WHEN (X.AVG – (2 […]

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