Transact SQL :: To Get FirstName And LastName From One Word
Aug 25, 2015
How to retrieve data as a two names from one columns.
For example: My column has naming like this Shannon.Cooley, I want to display like this:
FirstName        LastName                         FullName
Shannon        Cooley                          Â
Shannon Cooley
How to write the query to get the above table?
View 7 Replies
ADVERTISEMENT
Dec 7, 2007
Hello, I need some help being pointed in the right direction. I have a field in my Customer table called Name that is "LastName,FirstName". I need to be able to return a result set with "FirstName,LastName". Any ideas?
View 14 Replies
View Related
Sep 6, 2006
I'm sure you all have seen situations where a field has a combined namein the format of "Lastname, Firstname Middlename" and I've seenexamples of parsing that type of field. But what happens when the datawithin this type of field is inconsistent? Here are some examplesApple, John A.Berry John B.CherryJohn CDonald John DHow does one parse the data when the data isn't consistent?
View 2 Replies
View Related
Jan 13, 2008
My users wanted to view all the "FIRST and LAST" Lastname in each of the LastName initial in the database.
I have been trying to join/connect/subquery/merge/etc the following two set of codes but without good results.
Fist, i get all the lastname initials:
SELECT DISTINCT LEFT(LastName, 1) AS LastNameInitial
FROM Persons.Persons
ORDER BY LastNameInitial
Results to:
--------------------------------------
A
B
C
D
...
Y
Z
Then, i want to get all the FIRST and LAST LastName for each LastNameInitial
I only have this partial idea (can't get the rest):
--------------------------------------
SELECT MIN(LastName) + ' - ' + MAX(LastName) AS LastNameGroup
FROM Persons.Persons
WHERE (LastName LIKE 'A' + '%')
Only results to:
--------------------------------------
Abad - Ayun
MY USERS WANTED TO HAVE THIS RESULT (In a single query):
------------------------------------------
Abad - Ayun
Babaran - Buted
Cabaccan - Curugan
Dacquil - Durwin
Eda - Evangelista
...
Yadao - Yumul
Zalun - Zunajo
Thanks in advance for your help.
God bless!
View 3 Replies
View Related
Jun 30, 2015
Is there a function / way to extract a word from a particular position in the String.
I want to extract a word which is in the 16th position. All words are separated by spaces.
View 6 Replies
View Related
Sep 26, 2007
Hi,
I haven't found anything that shows that "sample" is a reserved word in SQL 2000. However when I enter it in Query Analyzer, the color changes to blue, as it is a transact-sql word. However, I'm still able to create a table called sample or name the column.
Does anybody know why query analyzer recognizes it as a transact-sql/reserverd word??
Thanks in advance,
Jorge
View 6 Replies
View Related
Jul 30, 2015
Is there a script that will return all rows in all tables that contain the word 'hello'?
I have (1) database named "Test" that has 129 tables in it and I just want to know which tables the word "hello" is in...
View 29 Replies
View Related
Aug 6, 2015
I am required to find or check that a specific word exists in string or not.
Suppose I have to find the word 'st' than I need the result true if and only if the following occurrences are there.
1. 'St is valid;' Â Â -> true
2. 'DOB is valid;ST is invalid;' Â Â -> true
3. 'DOB is valid; ST is invalid;'   -> true
4. 'DOB is valid;invalid ST;'   -> true
5. 'DOB is valid; invalid ST;'   -> true
6. 'DOB is valid; invalid STate;'Â Â Â -> false
Means the exact ST should be search. It is  not free text search.
T-SQL is needed to be used in select statement with case using PATINDEX, RegEx or any suitable t-sql command.
View 10 Replies
View Related
Apr 11, 2007
I'm having trouble figuring out how to use a UDT class. I'm simply trying to test out the class in a query window in the management studio. Here's the simple snippet:
declare @test TestObject;
set @test.FirstName = 'bob'
select @test.FirstName
Obviously my object has a string property called FirstName. When I execute this simple query I get the following error:
Mutator 'FirstName' on '@test' cannot be called on a null value.
Any ideas?
View 1 Replies
View Related
Aug 16, 2007
Hello fellows,
I am trying to write a query, here is the detail:
I have a table of users. Table schema:
FULL NAME, LOGIN
example data:
Anderman John, AndermaJ
Williams Robin, WilliamR
Foot Jay, FootJ
The LOGIN field will be my resulting field after I run my query.
It has a "FULL NAME" column, and a "LOGIN" column. I want to extract the first 7 characters of LAST Name from the FULL NAME field and extract the First Name Initial(just first letter of the first name) from the FULL NAME field and then set the LOGIN field with the resulting combination. The FULL NAME column is in the order of LastName FirstName.
Here is what I have been trying to write:
Declare @spacePos as int
Select @spacePos = charindex(' ', fullname) From TIUSER
Update TIUSER
SEt LOGIN = ltrim(Substring(fullname, 1, 7)) + Substring(fullname,@spacePos+1,1),
where @spacePos <> 0 and LOGIN = ' '
Currently we only have last and first names in our database and we will keep it that way since we don't store middle names and hopefully that will not be an issue.
But it seems that my solution was not working since if the last name is less than 7 characters then it should only grab upto the SPACE and not beyond that , but it was grabbing beyond the SPACE so how do you fix that?
That is I want atmost 7 characters from LAST NAME but incase of less than 7 then upto the space found.
Any help would be highly appreciated.
View 5 Replies
View Related
Jul 20, 2005
HI,i got a problem while using StrConv function in sql server.My requirement is:-suppose in a name field i have "jhon smith" Now i want to run a sqlwhich will give me the result like "Jhon Smith"--which means uppercase first.Now i am running a query like below which is giving me "Jhon smith"but i want "Jhon Smith".SELECT [CustomerID] ,upper(left(firstname,1)) + lower(right(firstname,len(firstname)-1)) AS [FirstName_] from my_table;But the above query is not giving me the right result. Pleasesuggest...ThanksHoque
View 2 Replies
View Related
Feb 24, 2008
i have report with parameter and he can have a null in parameter ther is null word can i change it to another word like all or any thing else
View 4 Replies
View Related
Mar 30, 2005
hi!
I'm just wondering does anyone know how to create an sql command that can search word by word?
what i mean is like I have a product with name 'harry potter broom'.
I want an sql command where if i type only 'harry broom' this 'harry potter broom' product will show up.
Does anyone have any idea?
Here's my sql comand: (I'm using asp.net vb script do develop this system)
-------------------------------------------------------------------------
query = "select distinct * from product where " & _
"(pname like '%" & keyword & "%' or " & _
"pdesc like '%" & keyword & "%' ) and " & _
"(price >= " & price1 & " and price <= " & price2 & _
") and status <> 'out of stock' order by price asc"
-------------------------------------------------------------------------
Thank you.
View 4 Replies
View Related
Sep 24, 2007
Is the word "Name" a reserved word in SQL? look at line 10 of my stored procedure. When I use the word "Name"it is highlited in blue by SQL Server?
Note I only list part of the stored proc
1 CREATE PROCEDURE [dbo].[GetXMLPeopleNames] 23 (4 @Status nvarchar(3)5)6 AS7 SELECT8 PersonId,9 PersonDescription,10 Name,11 UpdateDate,12 UpdateAppUser13 FROM14 Customer WHERE Customer.PersonDescription=@Status15 ORDER BY
View 2 Replies
View Related
Jan 19, 2007
Hi all,
I work for a financial company where we send out lots of correspondence to clients on a daily and monthly basis. This would typically be something like a financial report, account statements, etc. We've decided to use PDF as the format which these documents must be in when our clients receive them.
Our marketing and sales departments designs the templates of these documents using Microsoft Word. They can save these MS Word documents in the Word XML format (either 2003 or 2007). We want it in XML format, because it is text based, and we can therefore string replace the content to update the template with a client€™s information. In the same token RTF would also do, but the file size when converted to RTF is a problem.
What I am looking for is a way to convert this XML into PDF using something like XSL-FO - i.e. we do not want to use the Word Interopt on our Production Server, firstly it is a little slow and secondly the production server is unmanned and we cannot allow a WinWord.EXE process to not close successfully for some or other reason.
I've tried a number of companies' evaluation software to try and achieve this (converting the WordML to PDF via XSL-FO), but so far no luck.
Does anybody know of a stylesheet out there with which I will be able to achieve this? Or an alternative method of converting MS Word files into PDF without using Word to do it?
Thank you in advance.
Regards
View 4 Replies
View Related
Jan 27, 2007
I have 2 data flows tasks, salesperson and customer, where I want to concatenate name and Lastname into Name, using a Derived Column...
[name] + " " + Lastname
In the first one, Destination Preview show NULL on every Name row. In the other the names are joined as "DanWinter". Why don't the concatenate according to expression?
View 4 Replies
View Related
Feb 22, 2000
Ever store a word document in a sql table...? Just wondering how you did it...
Thanks!
Dean
View 1 Replies
View Related
Aug 5, 2013
DECLARE @url VARCHAR(1000)
SET @url ='http://www.microsoft.com/technet/security/bulletin/ms11-022.mspx';
How to get the result like 'ms11-022.mspx'
View 1 Replies
View Related
Sep 30, 2005
I have Sql Server 2000 and Word from Office Xp. Since a few weeks, I cannotimport Data from my database towards a Word document. I follow theprocedure, but at the end, it tells me Word cannot find the data source. IfI use Excel, well it works perfectly. What is the gig?thanks
View 5 Replies
View Related
Jun 18, 2007
Hi,
Can anyone assist me to convert .rdl files into an word file ?
Shall i need to write a program ??
Regards
Harsh
View 1 Replies
View Related
Sep 5, 2007
Can anyone find what is wrong with this? I think I am using the keyword "Like" correctly. I am trying to enforce some rules by doing this this way. No obvious typos or syntax errors are jumping out at me.
CREATE DATABASE VetClinic
ON
(NAME='VetClinic',
FILENAME = 'c:Program FilesMicrosoft SQL ServerMSSQL.1mssqldataVetClinic.mdf',
SIZE = 100MB,
MAXSIZE = 500MB,
FILEGROWTH = 10MB)
LOG ON
(NAME = 'VetClinicLog',
FILENAME = 'c:Program FilesMicrosoft SQL ServerMSSQL.1mssqldataVetClinic.ldf',
SIZE = 5MB,
MAXSIZE = 25MB,
FILEGROWTH = 5MB)
GO
CREATE TABLE Customers
(
CustID int IDENTITY NOT NULL PRIMARY KEY,
FirstName varchar(15) NOT NULL,
LastName varchar(15) NOT NULL,
StreetAddress varchar(25) NOT NULL,
City varchar(20) NOT NULL,
CustState char(2) NOT NULL,
Zip varchar(10) NOT NULL,
Phone1 char(13) NOT NULL
LIKE "([0-9][0-9][0-9]) [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]",
Phone2 char(13) NULL
LIKE "([0-9][0-9][0-9]) [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]",
Email varchar(30) NULL,
DateInSystem smalldatetime NOT NULL
DEFAULT GETDATE()
)
GO
CREATE TABLE PetDetails
(
PetID int IDENTITY NOT NULL PRIMARY KEY,
CustID int NOT NULL
FOREIGN KEY REFERENCES Customers(CustID),
PetName varchar(20) NOT NULL,
BreedID int NOT NULL,
Gender char(1) NOT NULL
LIKE "m" OR "f",
Weight decimal NOT NULL,
DOB smalldatetime NULL,
DateFixed smalldatetime NULL,
DateLastSeen smalldatetime NULL,
VetLastSeen int NULL
)
GO
CREATE TABLE Employees
(
EmpID int IDENTITY NOT NULL PRIMARY KEY,
PositionID int NOT NULL
FOREIGN KEY REFERENCES Positions(PositionID),
FirstName varchar(15) NOT NULL,
LastName varchar(15) NOT NULL,
SSN char(11) NOT NULL
LIKE "[0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9]",
StreetAddress varchar(25) NOT NULL,
City varchar(20) NOT NULL,
CustState char(2) NOT NULL,
Zip varchar(10) NOT NULL,
Phone1 char(13) NOT NULL
LIKE "([0-9][0-9][0-9]) [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]",
Phone2 char(13) NULL
LIKE "([0-9][0-9][0-9]) [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]",
Email varchar(30) NULL,
DateInSystem smalldatetime NOT NULL
DEFAULT GETDATE(),
HireDate smalldatetime NOT NULL,
TerminationDate smalldatetime NOT NULL,
PaySatus char(6) NOT NULL
LIKE "hourly" OR "salary",
PayAmount money NOT NULL
)
GO
CREATE TABLE Appointment
(
ApptID int IDENTITY NOT NULL PRIMARY KEY,
EmpID int NOT NULL,
ApptDate smalldatetime NOT NULL,
ApptTime smalldatetime NOT NULL,
PetID int NOT NULL,
CustID int NOT NULL,
)
GO
CREATE TABLE PetProcedures
(
ProcedureID int IDENTITY NOT NULL PRIMARY KEY,
ProcedureDescrip varchar(20) NOT NULL,
Cost money NOT NULL
)
GO
CREATE TABLE Breed
(
BreedID int IDENTITY NOT NULL PRIMARY KEY,
BreedName varchar(20) NOT NULL
)
GO
CREATE TABLE Prescriptions
(
PrescriptionID int IDENTITY NOT NULL PRIMARY KEY,
PetID int NOT NULL,
MedID int NOT NULL,
EmpID int NOT NULL,
DatePrescribed smalldatetime NOT NULL
)
GO
CREATE TABLE Medications
(
MedID int IDENTITY NOT NULL PRIMARY KEY,
MedName varchar(30) NOT NULL,
MedType varchar(20) NOT NULL,
Dosage varchar(20) NULL,
Frequency varchar(10) NOT NULL
LIKE "daily", "weekly", "monthly" OR "annually"
)
GO
CREATE TABLE Positions
(
PositionID int IDENTITY NOT NULL PRIMARY KEY,
PositionName varchar(20) NOT NULL
LIKE "vet", "tech", "front desk" OR "office manager"
)
- -----------------------------------------------------------------------------------------------------------------
Here are the errors that I got
Msg 156, Level 15, State 1, Line 12
Incorrect syntax near the keyword 'LIKE'.
Msg 156, Level 15, State 1, Line 10
Incorrect syntax near the keyword 'LIKE'.
Msg 156, Level 15, State 1, Line 10
Incorrect syntax near the keyword 'LIKE'.
Msg 156, Level 15, State 1, Line 9
Incorrect syntax near the keyword 'LIKE'.
Msg 156, Level 15, State 1, Line 6
Incorrect syntax near the keyword 'LIKE'.
View 1 Replies
View Related
Nov 29, 2006
Hi there, i need to know how to cut a string to the nearest word. For example, i've got an article and i need to extract just a part of the beginning, i could use LEFT([content], 250) but there is little chance this will cut on a word. Therefore i need to know if there is a function that will cut to the nearest word in T-SQL or i will simply put a summary field in the database. (I prefer to generate the summary on the fly if possible)
View 3 Replies
View Related
Dec 29, 2006
I need to be able to search article in several tables in a MSSQL DB. What is the best way to do a word search? Are there and freebies out there or code examples?
Dave
View 3 Replies
View Related
May 5, 2008
Is there a function how I can see how many caracters a word from my sql is?
for example:
if I want the lenght of the word "sql" => 3
if I want the lenght of the word "forum" => 5
View 1 Replies
View Related
Aug 3, 2007
Hi,
I was hoping somone could help. I need to count the number of words in a specfic column in a table if i didn't know what the words said.
I can count the number of words using
DECLARE @String VARCHAR(4000)
SET @String = ' words to be counted'
SELECT LEN(@String) - LEN(REPLACE(@String, ' ', '')) + 1
AS Results
but this requires me to know what the words are and not count them from the column.
View 2 Replies
View Related
Mar 19, 2007
Not sure if i am in the right forum or not.
I have been given the task to create a mail merge application.
For time sakes while this is being built i need to just export the name and address in to a pre written letter in word. how can i do this?
View 1 Replies
View Related
Nov 9, 2004
Hi all,
I took a search through the archives for related topics (and got Des in trouble along the way :( ) but couldn't find a directly related thread. If I missed one, feel free to tell me where to go (hey...watch that...only if I MISSED one!)
I wrote what is, essentially, a data verification stored proc that goes out to each of FOUR servers we have - each one running a mirror database. In a nutshell, there is one table that contains a row with a column in it that, if everything has gone well in the daily processing in all 4 databases, will match identically between all 4 DBs.
So, that said, here is the output: Job 'Index - Verify PortfolioIndex Across Servers' : Step 1, 'PortfolioIndex Check across all servers and portfolios' : Began Executing 2004-11-09 15:30:00
------------------- BEGINNING PortfolioIndex VERIFICATION -------------------- [SQLSTATE 01000]
WHOO-HOO!!! EVERYTHING MATCHES for porfolio number 2 on 11/09/2004! [SQLSTATE 01000]
WHOO-HOO!!! EVERYTHING MATCHES for porfolio number 3 on 11/09/2004! [SQLSTATE 01000]
WHOO-HOO!!! EVERYTHING MATCHES for porfolio number 11 on 11/09/2004! [SQLSTATE 01000]
WHOO-HOO!!! EVERYTHING MATCHES for porfolio number 67 on 11/09/2004! [SQLSTATE 01000]
WHOO-HOO!!! EVERYTHING MATCHES for porfolio number 72 on 11/09/2004! [SQLSTATE 01000]
WHOO-HOO!!! EVERYTHING MATCHES for porfolio number 84 on 11/09/2004! [SQLSTATE 01000]
WHOO-HOO!!! EVERYTHING MATCHES for porfolio number 90 on 11/09/2004! [SQLSTATE 01000]
WHOO-HOO!!! EVERYTHING MATCHES for porfolio number 92 on 11/09/2004! [SQLSTATE 01000]
WHOO-HOO!!! EVERYTHING MATCHES for porfolio number 100 on 11/09/2004! [SQLSTATE 01000]
WHOO-HOO!!! EVERYTHING MATCHES for porfolio number 105 on 11/09/2004! [SQLSTATE 01000]
WHOO-HOO!!! EVERYTHING MATCHES for porfolio number 110 on 11/09/2004! [SQLSTATE 01000]
WHOO-HOO!!! EVERYTHING MATCHES for porfolio number 115 on 11/09/2004! [SQLSTATE 01000]
WHOO-HOO!!! EVERYTHING MATCHES for porfolio number 120 on 11/09/2004! [SQLSTATE 01000]
WHOO-HOO!!! EVERYTHING MATCHES for porfolio number 125 on 11/09/2004! [SQLSTATE 01000]
WHOO-HOO!!! EVERYTHING MATCHES for porfolio number 130 on 11/09/2004! [SQLSTATE 01000]
WHOO-HOO!!! EVERYTHING MATCHES for porfolio number 135 on 11/09/2004! [SQLSTATE 01000]
WHOO-HOO!!! EVERYTHING MATCHES for porfolio number 140 on 11/09/2004! [SQLSTATE 01000]
WHOO-HOO!!! EVERYTHING MATCHES for porfolio number 145 on 11/09/2004! [SQLSTATE 01000]
WHOO-HOO!!! EVERYTHING MATCHES for porfolio number 150 on 11/09/2004! [SQLSTATE 01000]
WHOO-HOO!!! EVERYTHING MATCHES for porfolio number 155 on 11/09/2004! [SQLSTATE 01000]
UH-OH - TROUBLE!!! CloseIndex mismatch for porfolio number 160 on 11/09/2004! [SQLSTATE 01000]
--> Server TA1 shows an index of 110.582 [SQLSTATE 01000]
--> Server TRADEANALYSIS shows an index of 110.582 [SQLSTATE 01000]
--> Server RECEIVE1 shows an index of NULL [SQLSTATE 01000]
--> Server RECEIVE2 shows an index of NULL [SQLSTATE 01000]
UH-OH - TROUBLE!!! CloseIndex mismatch for porfolio number 1000 on 11/09/2004! [SQLSTATE 01000]
--> Server TA1 shows an index of 189.623 [SQLSTATE 01000]
--> Server TRADEANALYSIS shows an index of 189.623 [SQLSTATE 01000]
--> Server RECEIVE1 shows an index of NULL [SQLSTATE 01000]
--> Server RECEIVE2 shows an index of NULL [SQLSTATE 01000]
UH-OH - TROUBLE!!! CloseIndex mismatch for porfolio number 1001 on 11/09/2004! [SQLSTATE 01000]
--> Server TA1 shows an index of 164.058 [SQLSTATE 01000]
--> Server TRADEANALYSIS shows an index of 164.058 [SQLSTATE 01000]
--> Server RECEIVE1 shows an index of NULL [SQLSTATE 01000]
--> Server RECEIVE2 shows an index of NULL [SQLSTATE 01000]
UH-OH - TROUBLE!!! CloseIndex mismatch for porfolio number 1002 on 11/09/2004! [SQLSTATE 01000]
--> Server TA1 shows an index of 255.978 [SQLSTATE 01000]
--> Server TRADEANALYSIS shows an index of 255.978 [SQLSTATE 01000]
--> Server RECEIVE1 shows an index of NULL [SQLSTATE 01000]
--> Server RECEIVE2 shows an index of NULL [SQLSTATE 01000]
UH-OH - TROUBLE!!! CloseIndex mismatch for porfolio number 1003 on 11/09/2004! [SQLSTATE 01000]
--> Server TA1 shows an index of 159.009 [SQLSTATE 01000]
--> Server TRADEANALYSIS shows an index of 159.009 [SQLSTATE 01000]
--> Server RECEIVE1 shows an index of NULL [SQLSTATE 01000]
--> Server RECEIVE2 shows an index of NULL [SQLSTATE 01000]
UH-OH - TROUBLE!!! CloseIndex mismatch for porfolio number 1004 on 11/09/2004! [SQLSTATE 01000]
--> Server TA1 shows an index of 318.981 [SQLSTATE 01000]
--> Server TRADEANALYSIS shows an index of 318.981 [SQLSTATE 01000]
--> Server RECEIVE1 shows an index of NULL [SQLSTATE 01000]
--> Server RECEIVE2 shows an index of NULL [SQLSTATE 01000]
UH-OH - TROUBLE!!! CloseIndex mismatch for porfolio number 1005 on 11/09/2004! [SQLSTATE 01000]
--> Server TA1 shows an index of 145.921 [SQLSTATE 01000]
--> Server TRADEANALYSIS shows an index of 145.921 [SQLSTATE 01000]
--> Server RECEIVE1 shows an index of NULL [SQLSTATE 01000]
--> Server RECEIVE2 shows an index of NULL [SQLSTATE 01000]
UH-OH - TROUBLE!!! CloseIndex mismatch for porfolio number 1006 on 11/09/2004! [SQLSTATE 01000]
--> Server TA1 shows an index of 141.035 [SQLSTATE 01000]
--> Server TRADEANALYSIS shows an index of 141.035 [SQLSTATE 01000]
--> Server RECEIVE1 shows an index of NULL [SQLSTATE 01000]
--> Server RECEIVE2 shows an index of NULL [SQLSTATE 01000]
UH-OH - TROUBLE!!! CloseIndex mismatch for porfolio number 1007 on 11/09/2004! [SQLSTATE 01000]
--> Server TA1 shows an index of NULL [SQLSTATE 01000]
--> Server TRADEANALYSIS shows an index of NULL [SQLSTATE 01000]
--> Server RECEIVE1 shows an index of NULL [SQLSTATE 01000]
--> Server RECEIVE2 shows an index of NULL [SQLSTATE 01000]
UH-OH - TROUBLE!!! CloseIndex mismatch for porfolio number 1008 on 11/09/2004! [SQLSTATE 01000]
--> Server TA1 shows an index of 123.179 [SQLSTATE 01000]
--> Server TRADEANALYSIS shows an index of 123.179 [SQLSTATE 01000]
--> Server RECEIVE1 shows an index of NULL [SQLSTATE 01000]
--> Server RECEIVE2 shows an index of NULL [SQLSTATE 01000]
------------------- COMPLETE -------------------- [SQLSTATE 01000]
This was cut-n-pasted here from a log file created by the actual SQL SERVER 2000 job created to run the afore-mentioned stored procedure.
After all that...my quandry is this:
What is the best way to send this info out in an email format to interested parties? Currently I have the job send out an email notification on completion, but that still requires my lazy buttocks to go look at the log file in the job (or, more accurately, on the server in the logfile directory).
I want to get the actual DATA as shown above into the email.
As I see it, my options are:
(1) write the data out to a flat file during the run (or, as is done now, into a log file by the SQL Server scheduled job) and then attach that FILE to the email - this still requires my lazy buttocks to OPEN the attachment that comes with the email.
ro (2) write the message out a line at a time to a table with an IDENTITY column (used to order them on the select) and a VARCHAR(128) column that each line in the log would be written to. This option allows me to just do a SELECT in the call to xp_sendmail to get the data into the actual email...but I just really hate the idea of creating a permanent table for this cheesy solution.
I tried it with a temp table within my stored proc, but of course, when I made the call to xp_Sendmail, it can't see my temp table in order to select from (mind you, it's not that I mind USING a cheesy table, just that I don't want it to have a lifespan longer than the time I need to use it and toss it aside)
I know the common denominator here is "My Lazy Buttocks", but I really can't understate the laziness of my buttocks, so this is a valid concern ;)
Any thoughts? How do people get status messages like this into an email without using an attachment or a cheesy middleman table?
Sorry, as always, about the miniseries...just trying to set the mood before popping the question ;)
View 1 Replies
View Related
Mar 7, 2005
Hi
Does anyone know if you can specify certain characters to tokenise the search text(other than space and punctuation).
for example, id like to use `:` as a delimiter, word1:word2:word3 etc
Thanks in advance
View 4 Replies
View Related
Sep 2, 2013
how can i only grab the last 4 ID:
data
19Jul hello ID UKAU
9Jul hello ID UJKO
7Jul hello ID POJP
View 2 Replies
View Related
Feb 22, 2006
Yesterday I installed MS SQL 2000 for the first time and have no idea what I'm doing.
I have been sent a database and asked to convert this to MS Access, for most of the data that is ok and I have already managed to do this. My problem is that the database contains MS Word documents stored in some of the tables (field type - image). I need to extract these from the database and get them back to individual Word files, ideally with a file name that relates them to the primary key of the table from which they came.
I have less that 24 hours experience with SQL server and would be very grateful if anyone can explain how I can do this.
Thank you for your help
Shane
View 2 Replies
View Related
Jul 23, 2005
Hi all,I'm trying to figure out if it's possible to simply replace instancesof a given string of text wherever it occurs in all tables and columnsfor a given database. I'm using SQL Server 2000 sp3.All the update/replace commands I've looked at so far seem to requireup-front knowledge of the schema. What I need is something thatwouldn't treat the database as structured. For example, it would beidealif SQL Server could dump out the database in an XML format (sincewe don't have a lot of data and lots of disk space I'm not too worriedabout space/performance issues), which I could then run sed orsomething similar to do the replacement and re-import the XML back in.That would be ideal, but so far I haven't seen anything that would letme do that. Am I barking up the wrong tree here? Is there a simplerway?thanks,--dan
View 1 Replies
View Related
May 12, 2006
I desperatley need to export reports to MS Word - can anyone tell me a way around this please
thanks
View 2 Replies
View Related
Feb 28, 2007
Is there any recommended way to format and export a report so that it can be modified in Word if purchasing SoftArtisans OfficeWriter is not an option?
View 3 Replies
View Related