Originally, I created my SQL Server database on a local computer. I set its collation to Latin1_General_CI_AI and everything worked well. When I moved the finished work to the web hosting SQL Server, I encountered problem: they use a different database collation. So what can I do now? To be more specific, I n…
Tag: sql
MySQL 1062 – Duplicate entry ‘0’ for key ‘PRIMARY’
I have the following table in MySQL version 5.5.24 DROP TABLE IF EXISTS `momento_distribution`; CREATE TABLE IF NOT EXISTS `momento_distribution` ( `momento_id` INT(11) NOT NULL, `…
Why database designers do not make IDENTITY columns start from the min value rather than 1?
As we know, In Sql Server, The IDENTITY (n,m) means that the values will start from n, and the increment value is m, but I noticed that all database designers make Identity columns as IDENTITY(1,1) , …
Using GetSchemaTable() to retrieve only column names
Is it possible to use GetSchemaTable() to retrieve only column names? I have been trying to retrieve Column names (only) using this method, is it possible. This code retrieves a lot of table data unwanted, I only need a list containing column names!: Answer You need to use ExecuteReader(CommandBehavior.Schema…
php starup sqlsrv unable to initialize module
I am trying to connect MSSQL to PHP. i am following this tutorial. Anyway after i added the dll files as described in that tutorial, i get the following warning. How can i solve this ? note:i have gone through this post but none helped. Answer Looks like you’ve tried to install the sqlsrv extension for …
SQL query with NULL Value Comparison in MS Access
I am trying to compare two tables and output results where a column in table1 and the same column in table2 are not equal. The query looks like this: Column1, Column2, Column3 together form the primary key for the two tables. When Column4 has missing values (null), the corresponding record is not showing up a…
PHP/MS SQL Server display sql server datetime
im trying to display date and time from MSSQL Server datetime table using PHP, the value from from SQL Server is datetime EX. 2012-08-20 06:23:28:214. Now i want to display it the exact result but it php displays it like this EX. Aug 20 2012 6:23AM. I Have tried to use strtotime but the milliseconds does not …
Can’t UNION ALL on a temporary table?
I’m trying to run the following simple test- creating a temp table, and then UNIONing two different selections: CREATE TEMPORARY TABLE tmp SELECT * FROM people; SELECT * FROM tmp UNION ALL SELECT * …
getting “No column was specified for column 2 of ‘d'” in sql server cte?
I have this query, but its not working as it should, when I run this, I am getting Msg 8155, Level 16, State 2, Line 1 No column was specified for column 2 of ‘d’. Can any one tell me what am I doing wrong? Also, when I run this, I get Msg 8155, Level 16, State 2, Line 1
Oracle Sequence Transactionality
I need for a particular business scenario to set a field on an entity (not the PK) a number from a sequence (the sequence has to be a number between min and max I defined the sequence like this : …