I have the following inside a foreach loop (displaying my various videos), I'm trying to display some alternate text for the top three voted videos. What on earth am I doing wrong (a lot clearly)...
$sql = "SELECT video_id FROM videos WHERE displayable='y' ORDER BY votes desc LIMIT 0,3";
$result = mysql_query($sql);
$row = @mysql_fetch_...
Hi,
I do have an oracle 8 database from which I want to fetch data to SQL Server 2005. The following statement works fine, if the table on SQL Server 2005 is empty. If I run with let's say one entry missing, it does not work. Please let me know, if any additional information would be usefull!
SELECT wdmsoracle.NO
FROM (Select * from OP...
I am working with Microsoft Access (not SQL server) and have written a stored procedure (Query) as shown below in SQL.
This procedure works but it relies on a hard coded path to the database from which to pull (SELECT) the data.
To make the query more useful I want to pass the database to SELECT from as a parameter to the query - how d...
I have a table in my schema that has a unique constraint on two columns:
UNIQUE(Column1, Column2)
The SQlite documentation tells me that this creates a unique index on these columns. My question is, does that make an explicitly created index on one of the columns, say Column1, redundant?
...
I have a function call in a query, and that result has to be returned with two names.
Example:
SELECT myFunction(column1) as Name1, column2 as Name2 FROM myTable
I want the result of myFunction to be returned in two different columns. Is this possible without making another function call in the column list?
...
Question: If I add IF not exists to a create procedure as external name statement, I get a syntax error... why?
Both statements work fine if I run them separately...
IF NOT EXISTS
(
SELECT * FROM sys.objects
WHERE object_id = OBJECT_ID(N'PriceSum')
AND type in (N'P', N'PC')
)
CREATE PROCEDURE PriceSum(@sum int OUTPUT)
...
Hi, I'd like to force SQL Management Studio - Import Data - from XLS excel file to read one column as specific data type? It does a type guessing. My first N rows contain decimal data, but some later columns have also characters in there. I know I need to specify IMEX=1 in the connection string to the XLS file, but as far as I know this ...
Hi,
I need help with a query to get distinct records from the table.
SELECT distinct cID, firstname, lastname,
typeId, email from tableA
typeId and email has different values in the table. I know this one causing to return 2 records because these values are different.
Is there anyway I can get 1 record for ...
hi!
Started working after some days off, and generated a new dbml file through vs 2008. then it sent an error:
Object reference not set to an instance of an object.
MyBase.New(Global.System.Configuration.ConfigurationManager.ConnectionStrings("C__USERS_JIMMY_DOCUMENTS_VISUAL_STUDIO_2008_WEBSITES_LUNCHGUIDEN_APP_DATA_LUNCHGU"& _
row 88:...
Hi
I am looking into using JBoss 5.1.0GA on Oracle, and have seen this, warning that I should explicitly state the name of the schema into which the TIMERS table should be created, as Oracle doesn't permit the same table name to be used twice, even across schemas.
After reading this, I saw this question on StackOverflow, and would like...
Using Sql-Server 2005.
I have Users table with 3 columns. userID, parentUserID and userEmail. Top level users have null in parentUserID, child users have some userID.
I want to write a query that counts children up to lowest level of certain userID.
Select user with all his children, their children .... so on. I just need count of tho...
Hi!
I am trying to create stored procedure that gone return varchar value, and that value I need to display in textbox.
This is the code for stored procedure:
Create PROCEDURE Status @id_doc int, @Name varchar(50) OUTPUT
AS
select @Name =items.name
from Doc,Items where @id_doc=IDN and doc.IDN=Items.ID
return @Name
This is the...
Hi, I'm using SQL Server 2008 R2 and I can't seem to be able to use the geography column type it's meant to have. It doesn't show up in the data type column when I create a new column and when I run this code:
CREATE TABLE [Core].[Address2](
[Geo_Id] [geography] NULL);
I get
Column, parameter, or variable #2: Cannot find data type...
I have a row of strings that are in the following format:
'Order was assigned to lastname,firsname'
I need to cut this string down into just the last and first name but it is always a different name for each record.
The 'Order was assigned to' part is always the same.......
Thanks
I am using SQL Server. It is multiple records with d...
I have a problem executing queries having comments via JDBC. Can you help us?
This works:
select * from notf_worklist; SELECT * FROM NOTF_TASK_INSTANCE
The following query throws an error:
"Error :com.microsoft.sqlserver.jdbc.SQLServerException: The index 1 is out of range. ErrorCode:0 SQLState:S1093"
select * from notf_worklist; --...
I try to fill listbox. I generated textbox and labels from database. (My platform asp.net) I dynamically filled the created textbox. I want to send all data from textboxes to listbox. But disappear all datas.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.We...
If I have three queries and rows from the queries are not all alike. How can I write an SQL statement that will combine all three queries and all their rows of data into one final query??
The query I'm using currently leaves some of the rows off, I'm assuming because the rows are not all equal, and from my understanding Access does not ...
I'm using MS Visual Studio 2010 to create an application with SQL Server 2008 database access, but what I did to create the database was add a new "SQL Server 2008 Database Project", it added it, and shows me everything on my Solution Explorer, but how do I write the connection string to connect to it, because I wrote this one, and it di...
What kind of error occurs? What do users experience? Can you access the database using tools and what if you get it back under the 4GB / 10GB limit?
...
Hello. I am trying to perform what I believe is a difficult recursion using a CTE is SQL Server 2008. I can't seem to wrap my head around this one.
In the below examples you can assume a fixed depth of 3...nothing will ever be lower than that. In real life, the depth is "deeper" but still fixed. In the example I tried to simplify it som...