If I have a column in a table contain names and I want to split out what should always be the surname what SQL can I use. I want to split off from the right until I reach the first whitespace
this was - "S R WILLIAMS"
becomes "S R" and then another field called "WILLIAMS".
Hi,
I've got a SQL Table in which I have imported dates in an american format. I am sure I can write a simply update statement to correct them. The select statement below gives me each part of the date (datewef being the field)
select day(datewef), month(datewef), year(datewef)
from...
Hello,
Has anybody come across this before on Win XP Pro?
When ever I run any video files on my PC (mpegs, avis etc..) the system grinds to a halt and will not play the media. I have to end task to get the CPU usage back down to normal levels.
This happens if I am offline or online and in a...
Hello,
I have a DTS that convert dates from a text file into dates to be held in SQL Server.
The source file dates are like so:
05OCT06
Therefore in my DTS I do the following conversion:
arrMonth = mid(DTSSource("Col003"),3,3)
if arrMonth = "DEC" then
arrMonth = "12"
elseif arrMonth...
Hi,
I have a DTS package that takes an Excel spreadsheet as the input and then runs an update statement on a SQL database based upon certain conditions. The data is rejected if an associated database record cannot be found to update, in these cases I can output the details of source row that...
Hi, I have installed MS Projects 2003 on my machine recently and was able to use it (create new projects and open existing ones) for a while.
I have gone back into it today and clicked on new project and the screen is just blank, there is nothing there at all. If I click any options from...
Hi,
I am trying to update a certain field within a database table. This SQL statement correctly identifies the records i need to update:
(1)
select max(date) from table
group by IDfield
I cannot do:
update table
set field = 1
where ..
then use a sub select of the statement (1) above because...
Hi,
I've need to do a comparison between 2 fields in two 2 tables and identify the differences, I am using this SQL but it returns nothing:
select
field1+field2
from
table1
where field1+field2 NOT IN
(select field3+field4
from table2)
All the fields are nvarchar(100). There is...
Hi,
Using a SQL statement how can I remove carriage returns from an ntext field? I have tried using the replace function but do not know what to use to denote a carriage return:
update <table>
set <field> = replace(cast(<field> as nvarchar), A, B)
A being a carriage return
B being what I...
How can I use VB Script to perform the following string manipulation?
e.g. A/RHSD/0/004
I need everything between the first / character and the second / character.
Hello,
Can anyone help me with this problem.
I have a column that contains values for years and another column containing dates.
What I want to do is update the date column and default the value of day and month to the 1st of Janurary and then change the value for the year to what is in the...
Hi,
i am trying to strip out all the whitespace on the left hand side of a field which set to ntext. I assume I have to cast or convert this field to a different format but am unsure what. Any ideas?
update <table>
set <field> = ltrim(<field>)
ITLee, I came across the very same issue about a month ago having moved a bunch of DTS packages to another server.
One solution is to go to Package - Disconnceted Edit. Here you will find a tree structure of all the items that comprise you package. Take a look at each one and see if there is...
Hi,
I am trying to write a series of insert statements to populate a table, however the strings I am trying to insert include characters such as & and / and when the string is delimeted by single quotes it is erroring:
String or binary data would be truncated.
The statement has been...
Thanks, the left function works and it does give me the first 10 characters. I then needed to get remaining characters and place them into a string. I used right(oldString, 10) but this did not give me all the characters to the right of the 10th character. The right function does not seem to...
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.