Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

splitting a string
Hello,

I have been placed in charge of migrating an old access based database
over to sql server 7.0.  So far, I have imported all the tables into
sql server, but now I have come across the issue of needing to split a
string variable.  For instance, in the old database, the variable for
name was such that it included both first and last names, whereas in
the new database there are seperate entities for first and last name.
I know that there is a way to write a script that will separate out the
two strings by using the "space" in between the name, but I'm
unfamiliar how to do this.  Any suggestions?  Thanks!

Rick


Report this thread to moderator Post Follow-up to this message
Old Post
RSummersJr@gmail.com
11-30-05 02:23 PM


Re: splitting a string
(RSummersJr@gmail.com)  writes:
> I have been placed in charge of migrating an old access based database
> over to sql server 7.0.  So far, I have imported all the tables into
> sql server, but now I have come across the issue of needing to split a
> string variable.  For instance, in the old database, the variable for
> name was such that it included both first and last names, whereas in
> the new database there are seperate entities for first and last name.
> I know that there is a way to write a script that will separate out the
> two strings by using the "space" in between the name, but I'm
> unfamiliar how to do this.  Any suggestions?  Thanks!

I suggest that you look up "Functions" in Books Online, and have a look at
the available string functions. String maninpulation is not a strong point
in T-SQL, but there are some functions. Most commonly used for this task
are substring() and charindex().


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Report this thread to moderator Post Follow-up to this message
Old Post
Erland Sommarskog
11-30-05 04:23 PM


Sponsored Links





Last Thread Next Thread
Post New Thread

Microsoft SQL Server forum archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 11:19 PM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006