I'm developing a form generator, and wondering if it would be bad mojo to store JSON in an SQL Server database?
I want to keep my database & tables simple, so I was going to have
`pKey, formTitle, formJSON`
on a table, and then store
{["firstName":{"required":"true","type":"text"},"lastName":{"required":"true","type":"text"}}
in...
Hi I'm trying to output something like the following but am finding that there is a lot of code duplication going on.
| australian_has_itch | kiwi_has_itch |
| yes | no |
| no | n/a |
| n/a | no |
...
My query looks like this with two case statements tha...
How can I select how many days old a field is based on it's "DateAdded" field?
E.g.:
SELECT DAYSOLD(tbl_stuff.DateAdded) as DaysOld
FROM tbl_stuff
...
Hi,
i have an big problem with an SQL Statement in Oracle. I want to select The TOP 10 Records ordered by STORAGE_DB wich arent in a list from an other select statement.
This one works fine for all records:
SELECT DISTINCT
APP_ID,
NAME,
STORAGE_GB,
HISTORY_CREATED,
TO_CHAR(HISTORY_DATE, 'DD.MM.YYYY') AS HISTORY_DATE
...
Hello
I have the following test-code:
CREATE TABLE #Foo (Foo int)
INSERT INTO #Foo SELECT 4
INSERT INTO #Foo SELECT NULL
INSERT INTO #Foo SELECT 2
INSERT INTO #Foo SELECT 5
INSERT INTO #Foo SELECT 1
SELECT * FROM #Foo
ORDER BY
CASE WHEN Foo IS NULL THEN Foo DESC ELSE Foo END
DROP TABLE #Foo
I'm trying to produce the following o...
I have a table (say "Demographics") on SQL Server. In this table are the following columns "LastName", "FirstName", "MiddleName", "Prefix" , "Suffix".
I have one textbox to search for them on a webpage. My question:
Whats a good design strategy for queries where the user could be searching for various combinations of names including las...
I have to show records in such a way that some selected records should come first. After this, another records come in sorted manner from the same table.
For example, If I select state having stateID = 5 then the corresponding record should come first. after this another records should come in sorted manner.
For this, I tried union but...
Hi All,
I have a SQL 2005 TSQL script which sets up my FT Catalog and Indexes, but I would like to also create a Population schedule for these indexes via the same Code, can anyone point me in the right direction.
Thank you
Matt
...
Hi, I need to do migration date->timestamp with timezone similar to described here: http://stackoverflow.com/questions/1664627/migrating-oracle-date-columns-to-timestamp-with-timezone.
But I need to make additional convertion (needed to work correctly with legacy apps): for all dates we need to change timezone to UTC and set time to 12:...
I have been tasked with writting a report from MS Dynamic CRM. The report contains appointment and account information. I am using Visual Studio 2005 and SQL 2005.
The problem I have found is that if an appointment has a scheduled start date that falls after Britsh Summer Time but has a creation date before (BST) then the ScheduledStart...
Hi
I have the following query:
SELECT o.id,o.name FROM object o
WHERE
(
o.description LIKE '%Black%' OR
o.name LIKE '%Black%'
)
UNION ALL
SELECT o2.id,o2.name FROM object o2
WHERE
(
o2.description LIKE '%iPhone%' OR
o2.name LIKE '%iPhone%'
)
Which procude the following:
id name
2 ...
how does one calculate the beginning of a week from a given date e.g 23 March 2010 beginning of the week is 21 March 2010
...
Hi,
I am writing some new SQL queries and want to check the query plans that the Oracle query optimiser would come up with in production.
My development database doesn't have anything like the data volumes of the production database.
How can I export database statistics from a production database and re-import them into a development...
I am converting my database from sql server 2005 to mysql using asp .net mvc. I have bulk data in sql server(around 4 lakh records), But i am facing command timeout/wating for comand timeout error which when i search on google can be given 65535 as its highest value Or can be given 0 if someone wants that comand should wait for unlimite...
SELECT h11, HA11
FROM florin.h11
WHERE (3>d1 AND 3<d2) OR (3>d1 AND 3=d2 AND id=MAX(id))
UNION (3=d1 AND 3<d2 AND id=MIN(id));
Here a screenshot of my table stucture:
...
I have a simple table where I have to extract some records. The problem is that the evaluation function is a very time-consuming stored procedure so I shouldn't to call it twice like in this sentence:
SELECT *, slow_sp(row) FROM table WHERE slow_sp(row)>0 ORDER BY dist DESC LIMIT 10
First I thought in optimize like this:
SELECT *, sl...
How to find the worst performing queries in SQL Server 2008?
I found the following example but it does not seem to work:
SELECT TOP 5 obj.name, max_logical_reads, max_elapsed_time
FROM sys.dm_exec_query_stats a
CROSS APPLY sys.dm_exec_sql_text(sql_handle) hnd
INNER JOIN sys.sysobjects obj on hnd.objectid = obj.id
ORDER BY max_logical_r...
I have a temporary table that I'm using and I have a unique column, example:myID INT UNIQUE
Would this create an index on that column? Or do I have to explicitly create the index?
...
Hi,
I'm trying to connect to a server that the user inputs. When the server doesn't exist, I'd like to give a quick feedback to the end-user so he can correct what he's typed.
Is there any way to test if a server exists before trying to connect ?
Thanks
...
I have a SSAS cube which I am using in an excel document, prepare a report which has drill-down etc and i am publishing it to a sharepoint site. It gets published alright but when I try to drill down it throws an error "Data Refresh failed" etc.The data source and the sharpoint site are on the same machine(running windows server 2008) an...