How to connect to database from Unity

Please disregard any security risks with this approach Do not do it like this. It doesn’t matter if security will come before or after. You will end of re-writing the whole code because the password is hard-coded in your application which can be decompiled and retrieved easily. Do the connection the correct way now so that you won’t …

Read more

An explicit value for the identity column in table can only be specified when a column list is used and IDENTITY_INSERT is ON SQL Server

Summary SQL Server won’t let you insert an explicit value in an identity column unless you use a column list. Thus, you have the following options: Make a column list (either manually or using tools, see below) OR make the identity column in tbl_A_archive a regular, non-identity column: If your table is an archive table …

Read more

Using Excel VBA to run SQL query

Below is code that I currently use to pull data from a MS SQL Server 2008 into VBA. You need to make sure you have the proper ADODB reference [VBA Editor->Tools->References] and make sure you have Microsoft ActiveX Data Objects 2.8 Library checked, which is the second from the bottom row that is checked (I’m using Excel …

Read more

How to truncate string using SQL server

If you only want to return a few characters of your long string, you can use: See SQL Fiddle with Demo. This will return the first 15 characters of the string and then concatenates the … to the end of it. If you want to to make sure than strings less than 15 do not …

Read more