|
hi friends,
I need to trigger a mail when i update data from a particular table. I got a Procedure for mailing, it executed successfully. but, when i update the data from a table, below error was Accured.
xp_sendmail: Either there is no default mail client or the current mail client cannot fulfill the messaging request. Please run Microsoft Outlook and set it as the default mail client.
how can i solve this problem? can anybody faced this before, give me a reply.
Thanks in Advance!!!
Sabarees
|
|
|
|
|
Stop Reposting
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
hi friends,
I need to trigger a mail when i update data from a particular table. I got a Procedure for mailing, it executed successfully. but, when i update the data from a table, below error was Occurred.
xp_sendmail: Either there is no default mail client or the current mail client cannot fulfill the messaging request. Please run Microsoft Outlook and set it as the default mail client.
how can i solve this problem? can anybody faced this before, give me a reply.
Thanks in Advance!!!
Sabarees
|
|
|
|
|
insert into #temp exec dbo.MyStoredProc 89,1
(MyStoredProc requires 2 integer parameters.)
The above works fine but in my stored proc where I write this insert statement, I need to create the #temp table and MyStoredProc results in 100 columns.
Only 5 columns have to be stored in #temp.
I need something like below. (As you would know, am making it clear, below does not work!!)
select col1,col2,col3,col4 into #temp
exec dbo.MyStoredProc 89,1
------------------------------------------------------------
"The only true wisdom is in knowing you know nothing." --Socrates
|
|
|
|
|
If i understand you well, you want to insert records into a Temp table and you expect to have atleast 100 records because the Source have atleast 100 records and what you get in that temp is 5recs?
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Hi,
This isn't a programming question so I hope it's okay to post it here.
I'm having trouble trying to connect to SQL Server on a colleague's PC. I keep getting a Timeout Expired error.
I decided to disable the firewall on her machine just to see if that was what was causing my problem. As soon as I disabled it I was able to connect.
Obviously I don't want to keep her firewall disabled so I re-enabled it. But I don't know what exceptions to add to it. I've already added sqlservr.exe but I still can't connect.
I'm not sure if this is related to my problem but I just noticed that the SQL Server Browser service isn't running. When I try to start it I get the following message:
Error 1067: The process terminated unexpectedly
Can you suggest what I should try next?
Thanks,
dlarkin77
Moved on Friday, July 11, 2008 11:59 AM
|
|
|
|
|
dlarkin77 wrote: Can you suggest what I should try next?
SQL server documentation
SQL server forums
SQL server online support
Google
Simon
|
|
|
|
|
Did you unblock port 1433?
|
|
|
|
|
That did the job. Thanks very much.
|
|
|
|
|
That's very old, very widespread common knowledge. You could have found it on Google in about 10 seconds rather than asking here in the lounge.
"It's so simple to be wise. Just think of something stupid to say and then don't say it."
-Sam Levenson
|
|
|
|
|
Are you using Sql 2005? if yes, you may need to set up an alias in Sql configuration manager for the server you try to connect.
TOMZ_KV
|
|
|
|
|
Hi,
I have One SP in Sql Server 2005.In that SP i need to get the IP number of the Local System. Can anyone tell me How?
thanks in Advance
sri
|
|
|
|
|
Member 4008492 wrote: IP number of the Local System
Local system ? You won't get IP address in a Stored Procedure. You can pass it as a parameter from outside.
|
|
|
|
|
If this is only internal network you can use SELECT HOST_NAME() giving you the name of the computer. You could then create a CLR proc to get the IP.
|
|
|
|
|
We have a data feed where we need the authors name description and then all the videos the author made.
I created a table DataFeed (authorId int, name, desc, items xml). I then filled it with all the authors names and descriptions.
I need the items to look like this
"Author"Author Name 1"/Author"
"Item"Video1"/Item"
"Item"Video2"/Item"
"Author"Author Name 2"/Author"
"Item"Video1"/Item"
"Item"Video2"/Item"
"Item"Video3"/Item"
I have a FOR XML query that leoinfo gave me yesterday where I query all videos for a author but when I tried the following I cant get the output because it needs a variable in the query to output to a OUTPUT var....
DECLARE @xml xml
DECLARE @cmd nvarchar(4000)
DECLARE @AuId int
DECLARE @AuName varchar(50)
DECLARE cur_author CURSOR FOR
SELECT AuthorId, AuthorName FROM dbo.DataFeed
OPEN cur_author
FETCH NEXT FROM cur_author INTO @AuId,@AuName
WHILE @@FETCH_STATUS = 0
BEGIN
SET @cmd = [SQL FOR XML Query Videos WHERE AuthorId = @AuId]
EXEC sp_executesql @cmd, @xml OUTPUT
UPDATE dbo.DataFeed SET items = @xml WHERE WHERE AuthorId = @AuId
FETCH NEXT FROM cur_author INTO @AuId,@AuName
END
..
here is the SQL FOR XML Query
'WITH XMLNAMESPACES (''uri1'' as media, ''uri2'' as live)
SELECT RTRIM(Title) AS ''media:title''
, [Description] AS ''media:description''
, Url AS ''live:link''
, DateCreated AS ''media:pubdate''
, thumbnail AS ''media:thumbnail''
FROM dbo.Videos
WHERE AuthorId = ' + '''' + @auId + '''' +'
FOR XML PATH(''item''), ROOT(''root'')'
|
|
|
|
|
WOW! A lot of code you put there ...
Try delete all the code and replace it with the block bellow
I don't know what are you using @AuName for, but I'm not kidding, everything you posted can be replaced by this:
;
;WITH XMLNAMESPACES ('uri1' as media, 'uri2' as live)
UPDATE dbo.DataFeed
SET items = (
SELECT RTRIM(Title) AS 'media:title'
, [Description] AS 'media:description'
, Url AS 'live:link'
, DateCreated AS 'media:pubdate'
, thumbnail AS 'media:thumbnail'
FROM dbo.Videos
WHERE dbo.Videos.AuthorId = dbo.DataFeed.AuthorId
FOR XML PATH('item'), ROOT('root')
) ;
;
Also, check the below example that I played with, maybe one of the following code styles suits you better:
CREATE TABLE #T(id int IDENTITY(1,1), name nvarchar(10));
INSERT INTO #T (name) SELECT 'Smith';
INSERT INTO #T (name) SELECT 'Yana';
INSERT INTO #T (name) SELECT 'Jane';
INSERT INTO #T (name) SELECT 'Mike';
CREATE TABLE #D(pk int, dsc xml);
INSERT INTO #D (pk, dsc) SELECT 1, NULL;
INSERT INTO #D (pk, dsc) SELECT 2, NULL;
SELECT 'D:EMPTY', * FROM #D;
;
DECLARE @xmlOUT XML;
;WITH XMLNAMESPACES ('uriA1' as media, 'uriA2' as live)
SELECT @xmlOUT = (
SELECT id as 'media:id1'
,name AS 'live:name'
FROM #T
FOR XML PATH('item'), ROOT('root')
);
UPDATE #D
SET dsc = @xmlOUT
WHERE pk = 1;
SELECT 'D:PK1', * FROM #D;
;
;WITH XMLNAMESPACES ('uriB1' as media, 'uriB2' as live)
UPDATE #D
SET dsc = (
SELECT id as 'media:id2'
, name AS 'live:name'
FROM #T
FOR XML PATH('item'), ROOT('root')
)
WHERE pk = 2 ;
SELECT 'D:PK2', * FROM #D;
CREATE TABLE #X(pk int, dsc xml);
INSERT INTO #X (pk, dsc) SELECT 1, NULL;
INSERT INTO #X (pk, dsc) SELECT 2, NULL;
INSERT INTO #X (pk, dsc) SELECT 3, NULL;
INSERT INTO #X (pk, dsc) SELECT 4, NULL;
SELECT 'X:EMPTY', * FROM #X;
;
;WITH XMLNAMESPACES ('uriB1' as media, 'uriB2' as live)
UPDATE #X
SET #X.dsc = (
SELECT #T.id as 'media:id2'
, #T.name AS 'live:name'
FROM #T
WHERE #T.id = #X.pk
FOR XML PATH('item'), ROOT('root')
);
SELECT 'X:FINAL', * FROM #X;
DROP TABLE #D;
DROP TABLE #T;
DROP TABLE #X;
|
|
|
|
|
You seem to have a very exciting job ...
I wish I had a job so demanding ... my new job is kind of boring ... but not for long
|
|
|
|
|
Wow thats a lot simpler. Thanks a lot. I have a bad habit of reverting to cursors when I cant get something to work.
For a Canadian your all right. (Just kidding my sister lives in Toronto)
|
|
|
|
|
I have a wierd issue I am facing. We have a machine that is running DTS pulling data from a SQL database and manipulating it and placing it in a csv file. After a lightning strike the motherboard of the machine had to be replaced, and since then data is being logged to the db just fine however the DTS scripts are no longer executing and the csv files are no longer being created. What would have changed that has stopped DTS scripts from running, since all this data would have been on the hard drive that is running just fine. Are there some services that may not be set to auto start with a hard ware change like a motherboard that need to be changed? I am at a loss as to why this is happenning any help would be greatly appreciated.
|
|
|
|
|
Did you reinstall OS and SQL Server?
|
|
|
|
|
No, all this was intact on the hard drive, we simply replaced the motherboard and fired it up.
|
|
|
|
|
Make sure your SQL Agent is running and that there is a job for it. There is an icon bottom right or go Administrative tools>Services>SQL Server Agent
|
|
|
|
|
|
Hi all,
i have three tables:
table 1 has two colomns: name and id
table 2 has two columns: countrycode and id(id in this table is the forgin key from table one)
table 3 has two columns: countryname and countrycode(countrycode is the forggin key from table two)
now i have to make a query to select the name from table one and the countryname that belongs to that name from table three .
can anyone help me to make this query???
Thanx.
|
|
|
|
|
SELECT t1.name, t3.countryname
FROM [table 1] as t1
INNER JOIN [table 2] as t2 ON t2.id = t1.id
INNER JOIN [table 3] as t3 ON t3.countrycode = t2.countrycode
|
|
|
|
|