Hi
I have a spreadsheet containing addresses. Some of the addresses are in the format "123 Main Street", while others are "123, Main Street" and some may be "Apt 1, 123 Main Street".
I am trying to separate the number part of the address from the rest of the street name so that I am able to...
...declare @URN int, @Sport1 varchar(30), @Sport2 varchar(30), @Sport3 varchar(30), @mySport varchar(30)
declare curSport1 cursor for
select * from FavouriteSport
set @mySport = 'football'
open curSport1
fetch next from curSport1 into @URN, @Sport1 , @Sport2, @Sport3
while @@fetch_status =...
Thats great cheers.
Wondered if you could show me one more thing. How do I change it slightly so as if a row with the same details already exists in FavouriteSportMain then don't insert it.
Basically what I mean is if someone runs the cursor query a second time which inserts another 3 rows...
...what I need to demonstrate. Could someone please show me how to write the cursor code for this.
Cheers
Script to create table.
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FavouriteSport]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table...
Yeah that work ok for part of the problem, however there are so many variables in place which I need to work through before I decide whether to insert or update a record that i've been told a cursor is better to use. Your code worked but when it came to things like if a row in the merge table...
I have a query about writing code to use a sql server to loop through a record set in one table and then depending on the record insert a row into a new table. Each night I will receive a merge table file with new values in it. Depending on these values I will want to insert a record across to...
Not sure exactly what you meant by add an alias (a) to the MyTable after you plug the code in. So far I have the following can you show me what you mean. Cheers
INSERT INTO MOVE (MOVEFROMURN, MOVETOURN, MOVEDATEMERGED, RecNo)
SELECT MergeFromURN, MergeToURN, MIN(MergeDateMerged), Min(RecNo)...
I am trying to write some sql without using a cursor which looks at a row in a table and if the value exists in a row with a previous record no then i don't want to insert the record.
In the example below I would like to put another where clause into my insert statement which doesn't allow...
I want to ask everyone about this to see if anyone knows a work-around.
My environment is win2003, vs.net 2003, Java 2 runtime environment SE 1.4.2_08 (or jvm1.4 for short).
I have a java applet that I want to include in an asp.net page.
I can open it in IE6 in a html page and it runs happily...
I've got a real brain teaser which I'm trying to work out. Basically I recieve a merge table in every night which supplies a list of urns which have been merged into other urns. I'm using a .net application to search on urns and return results but when a user input a urn my stored procedures...
Unfortunately it isn't up to me - its my manager who likes the pretty pictures.
Having Saturdays and Sundays as working days may work in this case - I'll give it a go.
Cheers..
Does anyone know if there is a way to hide non-working days (e.g. Saturday, Sunday and overnight) in a Gantt chart?
I am trying to compare how long different tasks will take in terms of working hours, not actual time, and the non-working hours make some tasks look as if they are taking much...
Ok, but i've used this before and got this working fine so still can't understand it. My function that returns the date seems fine to me and should return a valid date and has done in the past. Any ideas what i've done wrong?
...Runat=server ErrorMessage="Please work"
Operator=LessThanEqual Type=Date ControlToValidate=txtStartDate ValueToCompare="<%#CompareDate()%>">*</asp:CompareValidator>
/// <summary>
/// Return a date for comparison
/// </summary>
/// <returns>a date string</returns>
public string CompareDate()...
I have an array list alSearchCriteria which contains values which vary each time its created. It will always have 15 items in the arraylist each time its created. Some of the values in the array list will be a string called null. I want to create some way of looping through the arraylist and...
I tried this and now it seems to return all my results even though i don't and it to. Any ideas why this is happening.
CREATE PROCEDURE [RegisteredUsers_SpecificSubscribers]
@publications int = null,
@consultation int = null,
@freedom int = null,
@judgments int = null,
@legislation int = null...
Hey there. I was wondering if someone could advise me whether or not i've writted an effective/efficent stored procedure.
Basically the below procedure will be run from a .net application and the values passed the the parameters will be 1 or null. It will allow the user to select as many or...
I have to write a query which i've know idea how to write and was wondering
if someone can help me.
I've got an asp.net front end and i'm trying to run a query to select all
the users in table UserObjects which have a value '1'. This seems simple
enough however I have to offer them the...
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.