I'm trying to write this as part of stored procedure on SQL Server 2000. I keep getting a syntax error thrown on line starting Insert into OPENROWSET(.....
Help! I can't see the syntax error!
DECLARE @vDate Varchar(25)
DECLARE @vCommand nvarchar(1000)
DECLARE @fileName varchar(500)
SET @vDate = LEFT(DATENAME(month, DATEADD(m, -...
Here's the documentation: http://download-east.oracle.com/docs/cd/B12037_01/server.101/b10759/queries003.htm
Here's the execution order it describes:
A join, if present, is evaluated
first, whether the join is specified
in the FROM clause or with WHERE
clause predicates.
The CONNECT BY condition is
evaluated.
Any remaining WHERE claus...
Hello All,
Can you please guide me to the equivalent to this query in Oracle:
SELECT SQL_CALC_FOUND_ROWS * FROM tableName
SELECT FOUND_ROWS() as cnt
Thanks
...
I have a feeling this question might have been asked before, but I am not able to find it. So here it goes:
I am searching through articles for words, phrases typed by users on a website
my articles have different columns for title, keywords, body, summary.
when I am searching I want the result to be more relevant if found in Title tha...
I have a table that has 3 columns representing the stops in a bus route.
ID
stop_name
stop_order
I am wanting to return a list of stops starting with the current stop (which I know).
So if the current stop is stop number 5 then what is returned will be as follows:
stop_order
5
6
7
8
1
2
3
4
I tried:
Select * from routes where stop...
I'm looking for this information when executing queries:
# Query_time: 11.639269 Lock_time: 0.000192 Rows_sent: 2 Rows_examined:
6509098
How can I get this from the command line?
...
I am getting strange results from a query using XML EXPLICIT mode in T-SQL (SQL Server 2008).
Can someone explain what I am doing wrong?
Here is my example:
declare @parents table(id int, connection int, title nvarchar(255));
declare @children table(id int, connection int, title nvarchar(255));
insert into @parents(id, connection, ti...
If I have PRINT 'something' in a trigger, where does that output go?
I'm using SQL Server 2008R2
...
In my Visual Studio project I have a folder containing a number of .sql files. I have set VS to open these files with SQL Management Studio by default. The problem is that a new instance of SMS is started each time a .sql file is opened. This is really annoying when doing a project-wide Find in VS, when VS opens every single .sql file - ...
Hi,
Can anyone explain me how many constraints at most can be set on any given column of a table in SQL Server.
...
I have an excel csv file that i am uploading to sql server table using sqlbulkcopy,data in excel looks like this
121 **ABCDEFG** 138.00 141 XYZ
**HIJKLMN**
**OPQRSTUV**
So basically this 3 line make a single record in table,how should i merge these 3 line comments in one ?
...
How can you change the schema that is defined in the ssdl files generated by the Entity Framework at runtime? I understand that this is not support out of the box and I don't want to use any external projects (like the one suggest here).
...
so I am connecting a sql database.
I have a asp.net page and when the user selects the dropdownlist for status and selects the value to Closed, Then clicks update ticket button, i need it to take update the Closed_date column in the table.
my table has the column Closed_Date type datetime.
I have a stored procedure that updates that c...
Hi,
SELECT @s = ISNULL(@s + '. ' , '') + [Comments]
FROM [Customer]
RETURN @s
How can I catch Null or '', so that if its either It Won't append to the string and not add a '.'
Thanks
Jacob
...
I have three tables, categories, tags, and taggings. The categories table is put together in the fashion of a nested set, with relevant columns id, lft, rgt, and parent_id. Tags has id and name. Taggings has tag_id and taggable_id, which refers to categories.id.
If possible, I'd like for one query which returns in a field, say tag_list,...
I have a table containing hierarchical data. There are currently ~8 levels in this hierarchy.
I really like the way the data is structured, but performance is dismal when I need to know if a record at level 8 is a child of a record at level 1.
I have PL/SQL stored functions which do these lookups for me, each having a select * from tb...
I have a Django application which edits a database table, which another application polls and uses to update a downstream system. In order to minimize processing when the database has not been altered in between polls, I would like to use a global modification time for a model, which is updated every time a row is created/deleted/modifi...
I have this function:
public static IQueryable<Article> WhereArticleIsLive(this IQueryable<Article> q)
{
return q.Where(x =>
x != null
&& DateTime.UtcNow >= x.PublishTime
&& x.IsPublished
&& !x.IsDeleted);
}
And it works just fine in this query:
from a in Articles.WhereArticleIsLive()
where a.Id ==...
Hi there, This actually applies to a prior question, TSQL 2008 USING LTRIM(RTRIM and Still Have Spaces
I am at the point of writing a very lengthy SELECT statement using OMG PONIES statement to remove NON NULL non visible characters
(WHEN PropStreetAddr is NOT NULL THEN
(SELECT LTRIM(RTRIM((REPLACE(PropStreetAddr,
...
Is it possible somehow to do multiplie one-to-many relationships between 2 tables?
Like:
Table abc
abcID
defID
message
Table def
defID
abcID
message
If yes how can I then make a new abc entry with the entity framework?
...