Tag: database

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 […]

Unique index column order – is it important?

There are a lot of articles about index column order, and I got the idea. However, I found none about unique index. Simple example: Product and Category tables having n-n relationship using ProductCategoryMapping table with 3 columns: identity Id, ProductId and CategoryId. If I create a unique index UN_ProductCategoryMapping_Product with 2 columns: ProductId and CategoryId, […]

Establishing a new SQL Connection after creating a database in a server

Please pardon me for my English grammar. I’m currently coding a system and I was wondering if you could establish a new connection after you created a database in a server. This is the Connection String: Dim DBCon As SqlConnection = New SQLConnection(“Data Source=(localdb)\DbLocal;Integrated Security=True”) If I want to create a database I use a […]

How secure if i use database connectionstring values inside Xamarin application?

I am new to Xamarin, and currently building a SQL database driven application which connects to my remote MS SQL Database. To do this, I am supposed to use SQLClient and its commands. SQL Client requires database connection string which I am using as a string in my application just like this. string connectionstring=”Data Source=SomeRemoteAddress;Initial […]

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