Hi,
I'd like to organize my data based on a datatime field grouped by 30 minute intervals.
I'm thinking about using a CASE statement that would look at the minute and if 0..30 then it would get 1, otherwise it would get 2...so 1 is the first half hour, and 2 is the second half hour. There are...
I've developed a trigger that runs for an UPDATE on table A. It simply calculates some information and updates table B when table A has an update.
It works fine if the update is on only 1 item in table A. However, if table A has multiple items that are updated, then the trigger returns an...
I have a variable that doesn't work properly, but the query works when I use a string of characters....
DECLARE @nameStr _str varchar(3500)
set @nameStr = 'aaa','bbb','ccc'
this works:
select * from tableA where name in ('aaa','bbb','ccc')
but this does NOT work:
select * from tableA where...
Hi,
I have a table with a document's history. The table's fields are: docid (int), name (varchar), version(int), status(varchar)
status could be = under construction, published, expired
with each editing of a document, a new record is inserted and the version number is incremented. Here is...
Hi,
I couldn't find an XSL forum, so I thought I'd post my question here.
I'm trying to create a hyperlink based on a value-of. Here is the code, which is not working:
<a href='<xsl:value-of select="myURL"/>' >the link</a>
How could I get this to work?
Thanks in advance.
Let's say I have a table field that contains "Joe, Bob, Mike"
and the names might be rearranged (like "Bob, Joe, Mike"). Is there an easy way to update ALL fields that contain "Bob" so that the field would simply have Bob removed from it?
So, in essence: there is a table with a text field...
Hi all,
I'm trying to build 2 drop-down lists. When the first (list A) drop-down is selected and an item is picked, the JS will automatically populate the second (list B) drop-down list. I have it working for most items. However, if list A contains an item with a "&" character, such as...
I'd like to apply the principles of Version Control to my database objects. How are others doing this?
I am thinking about saving the db scripts as text files and then using a version control program to organize and manage the text files. However, this puts a requirement on any database...
I'm not sure what it would be called, but could this be done?
Just as how I could do an INSERT by using a SELECT statement, such as:
insert into tableA(the_id, the_date)
select tableB.the_id as [the_id], '2006-01-01' as [the_date]
from tableB left outer join tableB_other
on tableB.the_id =...
what's the difference in SQL Server for these two statements?
set @a = 'hello'
select @a = 'hello'
they seem to have the same result...so what's the difference?
I have 2 tables. One gets a nightly feed of data. The second table contains my own calculations based off of the data from the feed.
Here is the sql that I'm using to make the calculations and make my customized data. It's very slow. Any thoughts on how to speed it up would be GREATLY...
Hi,
What if I use my local query analyzer to execute a stored procedure, but then lose my connection to the network? Would the SP continue running on the server, or would the SP stop running?
Thanks
Hi,
I have a query that looks like (variables are set before running the query):
select id
from tableA myA
where
a > @start_date
and a < @end_date
and a.userid not in (
select userid from userTable where age > myA.age
)
The purpose of the query has been made up, but the problem...
I have two select statements, both of which return two fields of information:
select a.something as [my_something], b.otherthing as [my_otherthing] from tableA a, tableB b where a.the_date > b.the_date
and
select a.something as [my_something], c.otherthing as [my_otherthing] from tableA a...
This is a beginner question: It seems like SQL Server caches a query and its results. Is there a way to clear the cache so that I can test the run-time for a query? I'd like to see how long it would run for a new visitor to my database-driven web site. Then I could optimize the query...
Hi,
I'm trying to use the code "DateAdd(day, datepart(dw, ReviewDate), ReviewDate )" to organize the ReviewDates by weeks. However, my code keeps grouping some items incorrectly. Since I don't know what is happening, I'll include all possible information.
-there is a date field that is...
Let's say I don't have any date items to select. How could I generate a list of dates? For example, I might want a list of all dates between Jan. 1, 2002 and Mar. 1, 2002.
Could I use something like "getdate()" or a similar date function to do a select?
Thanks in advance.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.