Tuesday, March 27, 2012
Help with code
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
drop proc VerifyRequest
go
/*
* VerifyRequestTransfer - run a command that looks for @.filename in the output
*
*
* This proc looks for a file matching 'tbl_%' in the output of an ftp command.
* The output message reports success/failure of transfer.
* A return code of 1 indicates success
* Return code = 0 indicates failure.
*
* How it Works:
* ftp is executed using @.ftpcommandfile as input to the -s parameter.
* The output of ftp is written to a table
* The table is cleared of garbage records
* The count of records matching @.filename is checked
* if the count = 1 then there success!
*/
CREATE proc VerifyRequest
@.filename varchar(200),
@.ftpcommandfile varchar(1000)
as
declare @.rc int
declare @.rows int, @.errcode int, @.rows2 int
set @.rc = 0
set @.rows = -9998
set nocount on
-- build a table containing list of files in Request directory
if exists (select * from tempdb.dbo.sysobjects where name='RequestFiles' and type = 'U')
drop table tempdb.dbo.RequestFiles
create table tempdb.dbo.RequestFiles (
line_no int identity(1,1) Primary key clustered,
Filename varchar(200) NULL
)
declare @.cmd varchar(2000)
--Get list of remote files
set @.cmd = 'ftp -i -s:' + @.ftpcommandfile
Insert into tempdb.dbo.RequestFiles (Filename)
Exec master.dbo.xp_cmdshell @.cmd
select @.rows = @.@.rowcount, @.errcode = @.@.error
if @.rows = 0 OR @.errcode != 0
begin
set @.rc = -1
goto done
end
-- remove non-files and already processed files ( there might have been old files on remotesystem )
Delete
From tempdb.dbo.RequestFiles
Where coalesce(Filename, '') not like '%tbl_%'
-- check count
select @.rows = (select count(*) from tempdb.dbo.RequestFiles
Where tempdb.dbo.RequestFiles.Filename like '%'+@.filename+'%' )
if @.rows = 1
set @.rc = 1
done:
return @.rc
go
Now the message I am getting is:
The task reported failure on execution. Procedure 'VerifyRequest' expects Parameter '@.filename', which was not supplied.
I don't know where to set this parameter.
I hope someone can help.
Thanks
LystraYou will need to supply both the @.filename and @.ftpcommandfile parameters when you call the procedure from your code:
VerifyRequest 'C:\Yourfile.nam', 'C:\YourCommandFile.nam'|||If that was THAT easy the error would have referenced @.ftpcommandfile parameter, not @.filename.|||THe vb scripts that is first started which is:
Function Main()
DTSGlobalVariables("PostDate") = month(now()) & "/" & day(now()) & "/" & year(now())
dim tmp
dim filename
tmp = right("0" & datepart("m", DTSGlobalVariables("PostDate")), 2)
tmp = tmp & right("0" & datepart("d", DTSGlobalVariables("PostDate")), 2)
tmp = tmp & datepart("yyyy", DTSGlobalVariables("PostDate"))
DTSGlobalVariables("Datestamp") = tmp
filename = DTSGlobalVariables("TransferFileNameRoot") & DTSGlobalVariables("Datestamp") & DTSGlobalVariables("FileExtension")
DTSGlobalVariables("TransferFilename") = DTSGlobalVariables("TransferFileDir") & "\" & DTSGlobalVariables("TransferFileNameRoot") & DTSGlobalVariables("Datestamp") & DTSGlobalVariables("FileExtension")
' use the output file name to generate an FTP command file
set oFSO = CreateObject("Scripting.FileSystemObject")
set oFile = oFSO.OpenTextFile( DTSGlobalVariables ("TransferFTPCommands").Value , 2, 1)
oFile.writeline ("open " & DTSGlobalVariables("TransferFTPServer"))
oFile.writeline DTSGlobalVariables("TransferFTPLogin")
oFile.writeline DTSGlobalVariables("TransferFTPPassword")
oFile.writeline "cd /fs11/infiles"
oFile.writeline "mput " & DTSGlobalVariables("TransferFilename").Value
oFile.writeline "quit"
oFile.Close
set oFile = nothing
' Generate an FTP command file to verify that transfer worked.
set oFile = oFSO.OpenTextFile( DTSGlobalVariables ("TransferFTPVerifyReq").Value , 2, 1)
oFile.writeline ("open " & DTSGlobalVariables("TransferFTPServer"))
oFile.writeline DTSGlobalVariables("TransferFTPLogin")
oFile.writeline DTSGlobalVariables("TransferFTPPassword")
oFile.writeline "cd /fs11/infiles" & vbCRLF & "ls -l " & vbCRLF & "quit"
oFile.Close
set oFile = nothing
set oFSO = nothing
' save the output filename into the transfer verification query
tmp = "Select count(*) from tempdb.dbo.RequestFiles " & vbCRLF & _
"Where tempdb.dbo.RequestFiles.Filename like '%"+ filename + "%'"
'Create a new query to look for files with the output filename
' find the task that counts the number of transferred files
set oTasks = DTSGlobalVariables.Parent.Tasks
for each task in oTasks
if task.Properties("Description") = "Evaluate File Count" then
' set the Query in DynamicProperties Task so that it checks for today's file
For Each oAssignment In task.CustomTask.Assignments
if instr( oAssignment.DestinationPropertyID , "'TransferredFileCount'" ) then
oAssignment.SourceQuerySQL = tmp
end if
next
end if
next
Main = DTSTaskExecResult_Success
End Function
Since I have created a ftp transfer file that lists the file names and should put the files in a temp table. I am having trouble with the ftp command to list the file in my file.
Thanking you in advance.
Lystra
Help with Cluster
nodes run on identical HP DL580's with 4 Xeon processors and 8GB memory.
The former dba attempted to setup AWE memory but missed a couple of fine
points. The first thing missed: the boot.ini only has the /PAE and no /3GB
switch. The second thing missed: sp_configure 'awe enabled' is set to 0.
As a result, SQL gets only 2GB of virtual memory and 0GB of PAE memory.
My question is how do I fix this on an active/passive cluster. Here is what
I think. Add the /3GB switch to the passive node and reboot the passive
node. Now it seems I am in trouble. If I pause the active node, I cause
the passive node to wake up, but the memory images do not match. If I start
with the active node and add the /3GB switch and reboot, I fail-over to the
passive. Everything is still OK, the memory matches until I reboot, then
the memory maps do not match.
So, do I break the cluster, install the /3GB switch on each box and then
recreate the cluster? Isn't there an easier way?
Also, can I enable AWE before I begin the /3GB shuffle. I seems I could
avoid a second dance.
Please help.
GaryGary,
I can answer one of your questions.
> Also, can I enable AWE before I begin the /3GB shuffle. I seems I could
> avoid a second dance.
You do not need to use the "/3GB" switch in order to use AWE memory.
You may find an explanation of each switch helpful:
The "/PAE" switch allows Windows to use memory above the 4GB native
limit. So this switch is needed to enable Windows to address memory
above 4GB. (Additionally, you must use a Server Operating System that
supports more than 4GB. You're using Windows 2000 Advanced Server,
which allows up to 8GB to be addressed.)
The "/3GB" switch allows Windows applications to use 3GB out of the
4GB Windows supports natively thereby leaving 1GB of memory for the
Windows OS. By default (i.e., not using the "/3GB" switch),
applications will only use 2GB out of the first 4GB on the server and
leave 2GB for the Windows OS.
You have a total of 8GB of RAM. If you don't use the "/3GB" switch,
then SQL Server will still have 6GB of RAM available to use. You may
prefer to leave the 2GB available to the OS rather than take it for
SQL Server. But at you stated, you must set the "awe enabled" option
from "0" to "1" and restart the SQL Server service. In case you are
not aware, AWE does not dynamically manage memory like SQL Server does
by default, so if you have more than one instance of SQL Server
running on each node in the cluster, you may not want to use AWE
memory.
You may find the following link helpful:
AWE Memory SQL Server Performance Tuning Tips
http://www.sql-server-performance.com/awe_memory.asp
HOW TO: Configure Memory for More Than 2 GB in SQL Server
http://support.microsoft.com/defaul...KB;EN-US;274750
Large Memory Support Is Available in Windows 2000 and Windows Server
2003
http://support.microsoft.com/defaul...b;EN-US;q283037
SQL Server Books Online Topics "Managing AWE Support", "Effects of min
and max server memory"; "Memory Architecture"; "Memory Architecture";
"Server Memory Options"; "SQL Server Memory Pool"
I hope you find this information helpful.
Regards,
Matt Patterson
HP Services
Business Critical Enterprise Team
Microsoft Database Supportsql
Monday, March 19, 2012
Help with a Query
larger Query and have a nice simple table listing all the SQL servies
going on and when it was started.
-TIA-
CREATE TABLE #System_Monitor_Information_SQL_Informat
ion
SystemName varchar(50)
MSSQLServer varchar(50)
SQLServerAgent varchar(50)
SQLStartDate smalldatetime
ProductVersion varchar(50)
AuditDateTime smalldatetime
DECLARE @.datetime smalldatetime
SET @.datetime = (SELECT GETDATE())
INSERT System_Monitor_Information_SQL_Informati
on (SystemName,
AuditDateTime)
SELECT SystemName = @.@.SERVERNAME,
AuditDateTime = @.datetime
INSERT System_Monitor_Information_SQL_Informati
on (SQLStartDate)
SELECT crdate FROM master.dbo.sysdatabases
WHERE name = 'tempdb'
INSERT System_Monitor_Information_SQL_Informati
on (ProductVersion) EXEC
xp_msver 'ProductVersion'
INSERT System_Monitor_Information_SQL_Informati
on (MSSQLServer) EXEC
master..xp_servicecontrol 'QUERYSTATE', 'MSSQLServer'
INSERT System_Monitor_Information_SQL_Informati
on (SQLServerAgent) EXEC
master..xp_servicecontrol 'QUERYSTATE', 'SQLServerAgent'
SELECT * FROM #System_Monitor_Information_SQL_Informat
ion
DROP TABLE #System_Monitor_Information_SQL_Informat
ionMatthew,
It's not clear how you want to treat multi-row results
from single-value results, but here's one snippet that
might help you. It gets the results of EXEC xp_msver
as a table, which should help. (You can get this bit
of information without xp_msver, too, using the
SERVERPROPERTY function, but I'm assuming
the question is how to get this kind of information
more conveniently.)
If you have a loopback linked server set up
UPDATE #System_Monitor_Information_SQL_Informat
ion SET
ProductVersion = (
SELECT Character_Value
FROM OPENQUERY(ME,'SET FMTONLY OFF; EXEC master..xp_msver
''ProductVersion''')
)
That isn't the most convenient solution, but you can also do this:
CREATE TABLE #ProductVersion (
s varchar(50)
)
INSERT INTO #ProductVersion
EXEC master..xp_msver 'ProductVersion'
UPDATE #System_Monitor_Information_SQL_Informat
ion SET
ProductVersion = (
SELECT s FROM #ProductVersion
)
DROP TABLE #ProductVersion
Steve Kass
Drew University
Matthew wrote:
>I am trying to get the following all into a single line, so i can run a
>larger Query and have a nice simple table listing all the SQL servies
>going on and when it was started.
>-TIA-
>CREATE TABLE #System_Monitor_Information_SQL_Informat
ion
> SystemName varchar(50)
> MSSQLServer varchar(50)
> SQLServerAgent varchar(50)
> SQLStartDate smalldatetime
> ProductVersion varchar(50)
> AuditDateTime smalldatetime
>DECLARE @.datetime smalldatetime
>SET @.datetime = (SELECT GETDATE())
>INSERT System_Monitor_Information_SQL_Informati
on (SystemName,
>AuditDateTime)
>SELECT SystemName = @.@.SERVERNAME,
> AuditDateTime = @.datetime
>INSERT System_Monitor_Information_SQL_Informati
on (SQLStartDate)
>SELECT crdate FROM master.dbo.sysdatabases
>WHERE name = 'tempdb'
>INSERT System_Monitor_Information_SQL_Informati
on (ProductVersion) EXEC
>xp_msver 'ProductVersion'
>INSERT System_Monitor_Information_SQL_Informati
on (MSSQLServer) EXEC
>master..xp_servicecontrol 'QUERYSTATE', 'MSSQLServer'
>INSERT System_Monitor_Information_SQL_Informati
on (SQLServerAgent) EXEC
>master..xp_servicecontrol 'QUERYSTATE', 'SQLServerAgent'
>SELECT * FROM #System_Monitor_Information_SQL_Informat
ion
>DROP TABLE #System_Monitor_Information_SQL_Informat
ion
>
>|||To get the status of the service, though it is easier to use
xp_servicecontrol, it is not recommended due to its undocumented nature.
Otherwise, for the reminder of the script you can shorten the query as:
INSERT System_Monitor_Information_SQL_Informati
on
( SystemName, AuditDateTime, SQLStartDate, ProductVersion )
SELECT @.@.SERVERNAME, CURRENT_TIMESTAMP, crdate,
SERVERPROPERTY( 'ProductVersion' )
FROM master.dbo.sysdatabases
WHERE name = 'tempdb' ;
Anith
Monday, March 12, 2012
help with 2005 profiler
sql2000 and sql2005 databases. i created a trace template when
connected to a sql2000 db. i want to use the exact same template for
traces against sql2005. how do i get that template so that i can use it
when connected to a sql2005 instance? i've tried exporting, importing,
saving as a trace file, etc. i can't get that trace template to load
when connected to sql2005.
ch wrote:
> i'm trying to use the sql2005 profiler to run traces against both
> sql2000 and sql2005 databases. i created a trace template when
> connected to a sql2000 db. i want to use the exact same template for
> traces against sql2005. how do i get that template so that i can use
> it when connected to a sql2005 instance? i've tried exporting,
> importing, saving as a trace file, etc. i can't get that trace
> template to load when connected to sql2005.
The trace templates are saved according to the SQL Server version. I'm
not sure exactly where they are saved. I did a quick check and could not
find them on the local PC or in the registration database - unless they
were exported.
David Gugick
Quest Software
www.imceda.com
www.quest.com
|||Local machine, it seems:
C:\Program Files\Microsoft SQL Server\90\Tools\Profiler\Templates\Microsoft SQL Server\80
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"David Gugick" <david.gugick-nospam@.quest.com> wrote in message
news:eNbokIw7FHA.3984@.TK2MSFTNGP11.phx.gbl...
> ch wrote:
> The trace templates are saved according to the SQL Server version. I'm not sure exactly where they
> are saved. I did a quick check and could not find them on the local PC or in the registration
> database - unless they were exported.
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com
|||Tibor Karaszi wrote:
> Local machine, it seems:
> C:\Program Files\Microsoft SQL
> Server\90\Tools\Profiler\Templates\Microsoft SQL Server\80
Tibor,
I checked in that folder and did not see the (user) templates. I created
two custom templates for SQL 2000 and SQL 2005 with the same name and
did not see either in the templates folder (I did not physically export
them to disk). I think that the "Templates" folder stores the default
templates that are delivered with SQL Server (for SQL 2000 and SQL
2005). But it's not clear to me where the user templates are stored. I'm
guessing they are in encrypted format either in the registration
database or in another file. Searching all files that contained the
string representing the template name revealed nothing on my server.
Still searching...
David Gugick
Quest Software
www.imceda.com
www.quest.com
|||Maybe in your "My Documents" under the "SQL Server Management Studio"
folder?
"David Gugick" <david.gugick-nospam@.quest.com> wrote in message
news:eHShgB47FHA.3224@.TK2MSFTNGP09.phx.gbl...
> Tibor Karaszi wrote:
> Tibor,
> I checked in that folder and did not see the (user) templates. I created
> two custom templates for SQL 2000 and SQL 2005 with the same name and did
> not see either in the templates folder (I did not physically export them
> to disk). I think that the "Templates" folder stores the default templates
> that are delivered with SQL Server (for SQL 2000 and SQL 2005). But it's
> not clear to me where the user templates are stored. I'm guessing they are
> in encrypted format either in the registration database or in another
> file. Searching all files that contained the string representing the
> template name revealed nothing on my server. Still searching...
>
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com
|||Sorry, David. I just noticed some files in that directory and incorrectly assumed that user defined
templates would also be stored there.
However, after some searching, I did find the location for user defined trace templates:
C:\Documents and Settings\Tibor\Application Data\Microsoft\SQL Profiler\9.0\Templates\Microsoft SQL
Server\90
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"David Gugick" <david.gugick-nospam@.quest.com> wrote in message
news:eHShgB47FHA.3224@.TK2MSFTNGP09.phx.gbl...
> Tibor Karaszi wrote:
> Tibor,
> I checked in that folder and did not see the (user) templates. I created two custom templates for
> SQL 2000 and SQL 2005 with the same name and did not see either in the templates folder (I did not
> physically export them to disk). I think that the "Templates" folder stores the default templates
> that are delivered with SQL Server (for SQL 2000 and SQL 2005). But it's not clear to me where the
> user templates are stored. I'm guessing they are in encrypted format either in the registration
> database or in another file. Searching all files that contained the string representing the
> template name revealed nothing on my server. Still searching...
>
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com
help with 2005 profiler
sql2000 and sql2005 databases. i created a trace template when
connected to a sql2000 db. i want to use the exact same template for
traces against sql2005. how do i get that template so that i can use it
when connected to a sql2005 instance? i've tried exporting, importing,
saving as a trace file, etc. i can't get that trace template to load
when connected to sql2005.ch wrote:
> i'm trying to use the sql2005 profiler to run traces against both
> sql2000 and sql2005 databases. i created a trace template when
> connected to a sql2000 db. i want to use the exact same template for
> traces against sql2005. how do i get that template so that i can use
> it when connected to a sql2005 instance? i've tried exporting,
> importing, saving as a trace file, etc. i can't get that trace
> template to load when connected to sql2005.
The trace templates are saved according to the SQL Server version. I'm
not sure exactly where they are saved. I did a quick check and could not
find them on the local PC or in the registration database - unless they
were exported.
David Gugick
Quest Software
www.imceda.com
www.quest.com|||Local machine, it seems:
C:\Program Files\Microsoft SQL Server\90\Tools\Profiler\Templates\Micro
soft
SQL Server\80
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"David Gugick" <david.gugick-nospam@.quest.com> wrote in message
news:eNbokIw7FHA.3984@.TK2MSFTNGP11.phx.gbl...
> ch wrote:
> The trace templates are saved according to the SQL Server version. I'm not
sure exactly where they
> are saved. I did a quick check and could not find them on the local PC or
in the registration
> database - unless they were exported.
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com|||Tibor Karaszi wrote:
> Local machine, it seems:
> C:\Program Files\Microsoft SQL
> Server\90\Tools\Profiler\Templates\Micro
soft SQL Server\80
Tibor,
I checked in that folder and did not see the (user) templates. I created
two custom templates for SQL 2000 and SQL 2005 with the same name and
did not see either in the templates folder (I did not physically export
them to disk). I think that the "Templates" folder stores the default
templates that are delivered with SQL Server (for SQL 2000 and SQL
2005). But it's not clear to me where the user templates are stored. I'm
guessing they are in encrypted format either in the registration
database or in another file. Searching all files that contained the
string representing the template name revealed nothing on my server.
Still searching...
David Gugick
Quest Software
www.imceda.com
www.quest.com|||Maybe in your "My Documents" under the "SQL Server Management Studio"
folder?
"David Gugick" <david.gugick-nospam@.quest.com> wrote in message
news:eHShgB47FHA.3224@.TK2MSFTNGP09.phx.gbl...
> Tibor Karaszi wrote:
> Tibor,
> I checked in that folder and did not see the (user) templates. I created
> two custom templates for SQL 2000 and SQL 2005 with the same name and did
> not see either in the templates folder (I did not physically export them
> to disk). I think that the "Templates" folder stores the default templates
> that are delivered with SQL Server (for SQL 2000 and SQL 2005). But it's
> not clear to me where the user templates are stored. I'm guessing they are
> in encrypted format either in the registration database or in another
> file. Searching all files that contained the string representing the
> template name revealed nothing on my server. Still searching...
>
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com|||Sorry, David. I just noticed some files in that directory and incorrectly as
sumed that user defined
templates would also be stored there.
However, after some searching, I did find the location for user defined trac
e templates:
C:\Documents and Settings\Tibor\Application Data\Microsoft\SQL Profiler\9.0\
Templates\Microsoft SQL
Server\90
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"David Gugick" <david.gugick-nospam@.quest.com> wrote in message
news:eHShgB47FHA.3224@.TK2MSFTNGP09.phx.gbl...
> Tibor Karaszi wrote:
> Tibor,
> I checked in that folder and did not see the (user) templates. I created t
wo custom templates for
> SQL 2000 and SQL 2005 with the same name and did not see either in the tem
plates folder (I did not
> physically export them to disk). I think that the "Templates" folder store
s the default templates
> that are delivered with SQL Server (for SQL 2000 and SQL 2005). But it's n
ot clear to me where the
> user templates are stored. I'm guessing they are in encrypted format eithe
r in the registration
> database or in another file. Searching all files that contained the string
representing the
> template name revealed nothing on my server. Still searching...
>
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com
help with 2005 profiler
sql2000 and sql2005 databases. i created a trace template when
connected to a sql2000 db. i want to use the exact same template for
traces against sql2005. how do i get that template so that i can use it
when connected to a sql2005 instance? i've tried exporting, importing,
saving as a trace file, etc. i can't get that trace template to load
when connected to sql2005.ch wrote:
> i'm trying to use the sql2005 profiler to run traces against both
> sql2000 and sql2005 databases. i created a trace template when
> connected to a sql2000 db. i want to use the exact same template for
> traces against sql2005. how do i get that template so that i can use
> it when connected to a sql2005 instance? i've tried exporting,
> importing, saving as a trace file, etc. i can't get that trace
> template to load when connected to sql2005.
The trace templates are saved according to the SQL Server version. I'm
not sure exactly where they are saved. I did a quick check and could not
find them on the local PC or in the registration database - unless they
were exported.
--
David Gugick
Quest Software
www.imceda.com
www.quest.com|||Local machine, it seems:
C:\Program Files\Microsoft SQL Server\90\Tools\Profiler\Templates\Microsoft SQL Server\80
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"David Gugick" <david.gugick-nospam@.quest.com> wrote in message
news:eNbokIw7FHA.3984@.TK2MSFTNGP11.phx.gbl...
> ch wrote:
>> i'm trying to use the sql2005 profiler to run traces against both
>> sql2000 and sql2005 databases. i created a trace template when
>> connected to a sql2000 db. i want to use the exact same template for
>> traces against sql2005. how do i get that template so that i can use
>> it when connected to a sql2005 instance? i've tried exporting,
>> importing, saving as a trace file, etc. i can't get that trace
>> template to load when connected to sql2005.
> The trace templates are saved according to the SQL Server version. I'm not sure exactly where they
> are saved. I did a quick check and could not find them on the local PC or in the registration
> database - unless they were exported.
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com|||Tibor Karaszi wrote:
> Local machine, it seems:
> C:\Program Files\Microsoft SQL
> Server\90\Tools\Profiler\Templates\Microsoft SQL Server\80
Tibor,
I checked in that folder and did not see the (user) templates. I created
two custom templates for SQL 2000 and SQL 2005 with the same name and
did not see either in the templates folder (I did not physically export
them to disk). I think that the "Templates" folder stores the default
templates that are delivered with SQL Server (for SQL 2000 and SQL
2005). But it's not clear to me where the user templates are stored. I'm
guessing they are in encrypted format either in the registration
database or in another file. Searching all files that contained the
string representing the template name revealed nothing on my server.
Still searching...
David Gugick
Quest Software
www.imceda.com
www.quest.com|||Maybe in your "My Documents" under the "SQL Server Management Studio"
folder?
"David Gugick" <david.gugick-nospam@.quest.com> wrote in message
news:eHShgB47FHA.3224@.TK2MSFTNGP09.phx.gbl...
> Tibor Karaszi wrote:
>> Local machine, it seems:
>> C:\Program Files\Microsoft SQL
>> Server\90\Tools\Profiler\Templates\Microsoft SQL Server\80
> Tibor,
> I checked in that folder and did not see the (user) templates. I created
> two custom templates for SQL 2000 and SQL 2005 with the same name and did
> not see either in the templates folder (I did not physically export them
> to disk). I think that the "Templates" folder stores the default templates
> that are delivered with SQL Server (for SQL 2000 and SQL 2005). But it's
> not clear to me where the user templates are stored. I'm guessing they are
> in encrypted format either in the registration database or in another
> file. Searching all files that contained the string representing the
> template name revealed nothing on my server. Still searching...
>
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com|||Sorry, David. I just noticed some files in that directory and incorrectly assumed that user defined
templates would also be stored there.
However, after some searching, I did find the location for user defined trace templates:
C:\Documents and Settings\Tibor\Application Data\Microsoft\SQL Profiler\9.0\Templates\Microsoft SQL
Server\90
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"David Gugick" <david.gugick-nospam@.quest.com> wrote in message
news:eHShgB47FHA.3224@.TK2MSFTNGP09.phx.gbl...
> Tibor Karaszi wrote:
>> Local machine, it seems:
>> C:\Program Files\Microsoft SQL
>> Server\90\Tools\Profiler\Templates\Microsoft SQL Server\80
> Tibor,
> I checked in that folder and did not see the (user) templates. I created two custom templates for
> SQL 2000 and SQL 2005 with the same name and did not see either in the templates folder (I did not
> physically export them to disk). I think that the "Templates" folder stores the default templates
> that are delivered with SQL Server (for SQL 2000 and SQL 2005). But it's not clear to me where the
> user templates are stored. I'm guessing they are in encrypted format either in the registration
> database or in another file. Searching all files that contained the string representing the
> template name revealed nothing on my server. Still searching...
>
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com
Help with "Problem generating manifest" error
Hi!
I'm using VS 2005 SP 1 on my first project with CE. I've recently run into the problem that if I do anything with my SDF file in Visual Studio I get the following error when I run the project (in debug mode from VS):
The process cannot access the file 'C:\xxx\MySDF.sdf' because it is being used by another process.
The solution is to close the project and reopen it however this is getting painful. Anyone else seen this problem?
Thanks!
This problem hasn't gone away....was hoping someone else has seen it and has a solution.
Thanks!
|||Do you have the connection open in Server Explorer or any other place. Basically as long as there is some connection open to that database, you can not delete it. However, you can open multiple connection to the same database. We support multiple connecitons.
Thanks,
Laxmi
Help with "Problem generating manifest" error
Hi!
I'm using VS 2005 SP 1 on my first project with CE. I've recently run into the problem that if I do anything with my SDF file in Visual Studio I get the following error when I run the project (in debug mode from VS):
The process cannot access the file 'C:\xxx\MySDF.sdf' because it is being used by another process.
The solution is to close the project and reopen it however this is getting painful. Anyone else seen this problem?
Thanks!
This problem hasn't gone away....was hoping someone else has seen it and has a solution.
Thanks!
|||Do you have the connection open in Server Explorer or any other place. Basically as long as there is some connection open to that database, you can not delete it. However, you can open multiple connection to the same database. We support multiple connecitons.
Thanks,
Laxmi
Help with "Error 80040e18: Rowset cannot be restarted."
The code below runs fine in Access, but in migrating to SQL Server I've run
into this error:
"Microsoft OLE DB Provider for SQL Server error '80040e18'. Rowset position
cannot be restarted."
The code (ASP) is:
#######
If Request.Form("Make") <> "" then
set objCommand = server.CreateObject("ADODB.command")
objCommand.ActiveConnection = objConn
objCommand.CommandText = "usp_ANALYZE_MAKE"
objCommand.CommandType = adCmdStoredProc
objCommand.Parameters.Refresh
objCommand.Parameters(1).Value = Request.Form("Make")
set objRS = objCommand.Execute
set objCommand = Nothing
If Not objRS.EOF then
r = objRS.GetRows
End if
If IsArray(r) Then
intRecordCount = UBound(r, 2) + 1
objRS.MoveFirst
End If
Response.Write "<p><b>Your search returned " & intRecordCount & " result(s)
for: </b></p>"
Response.Write "<blockquote>"
Response.Write "<p><b>Make</b></p>"
Response.Write "</blockquote>"
Response.Write "<p>"
Response.Write "<blockquote>"
Do until objRS.EOF
Response.Write Code Here...
objRS.MoveNext
Loop
Response.Write "</blockquote>"
Response.Write "<p></p>"
objRS.Close
set objRS = Nothing
End If
#######
Is this a case of needing to utilize (based on the above code) a different
cursor, or...? There sure are a lot of differences in how Access and SQL
Server allow you to do things (beyond 'basic' DB structure), or perhaps how
'forgiving' each of them are.
Anyone with a suggestion or workaround? Thanks.
--
Message posted via http://www.sqlmonster.comhttp://support.microsoft.com/kb/174225/en-us
http://groups.google.de/groups?hl=de&lr=&threadm=%23NwSu47ECHA.1732%40tkmsftngp07&rnum=11&prev=/groups%3Fq%3DRowset%2Bcannot%2Bbe%2Brestarted%2Bmovefirst%26start%3D10%26hl%3Dde%26lr%3D%26selm%3D%2523NwSu47ECHA.1732%2540tkmsftngp07%26rnum%3D11
HTH, Jens Suessmeyer.
--
http://www.sqlserver2005.de
--
"The Gekkster via SQLMonster.com" <forum@.nospam.SQLMonster.com> schrieb im
Newsbeitrag news:2723f97d6dc4470492871a765551178f@.SQLMonster.com...
> Hi everyone,
> The code below runs fine in Access, but in migrating to SQL Server I've
> run
> into this error:
> "Microsoft OLE DB Provider for SQL Server error '80040e18'. Rowset
> position
> cannot be restarted."
> The code (ASP) is:
> #######
> If Request.Form("Make") <> "" then
> set objCommand = server.CreateObject("ADODB.command")
> objCommand.ActiveConnection = objConn
> objCommand.CommandText = "usp_ANALYZE_MAKE"
> objCommand.CommandType = adCmdStoredProc
> objCommand.Parameters.Refresh
> objCommand.Parameters(1).Value = Request.Form("Make")
> set objRS = objCommand.Execute
> set objCommand = Nothing
> If Not objRS.EOF then
> r = objRS.GetRows
> End if
> If IsArray(r) Then
> intRecordCount = UBound(r, 2) + 1
> objRS.MoveFirst
> End If
> Response.Write "<p><b>Your search returned " & intRecordCount & "
> result(s)
> for: </b></p>"
> Response.Write "<blockquote>"
> Response.Write "<p><b>Make</b></p>"
> Response.Write "</blockquote>"
> Response.Write "<p>"
> Response.Write "<blockquote>"
> Do until objRS.EOF
> Response.Write Code Here...
> objRS.MoveNext
> Loop
> Response.Write "</blockquote>"
> Response.Write "<p></p>"
> objRS.Close
> set objRS = Nothing
> End If
> #######
> Is this a case of needing to utilize (based on the above code) a different
> cursor, or...? There sure are a lot of differences in how Access and SQL
> Server allow you to do things (beyond 'basic' DB structure), or perhaps
> how
> 'forgiving' each of them are.
> Anyone with a suggestion or workaround? Thanks.
> --
> Message posted via http://www.sqlmonster.com
Friday, March 9, 2012
Help w/aggregate function in Matrix
=iif(Fields!Score.Value=0, "", Fields!Score.Value)
When we run the report, we get the following warning:
The value expression for the textbox 'Score' references a field
outside an aggregate function. Value expressions in matrix cells should be
aggregates, to allow for subtotaling.
What does this mean and how can I resolve it?
The goal it to suppress the display of zero (0). We have tried setting the
format of the data cell to be "#", but the zero is still displayed. So we
have been using expressions like the above to achieve this.
The user creating this report is using the stand-alone C# IDE with Reporting
Services. This warning prevents them from previewing the report. Another
user using VS.NET 2003 is able to preview the report despite the warning.
The report renders on our test reporting server. If we need to just ignore
the warning, how can we get the user using C# to be able to preview the
report?
Thanks,
ChrisMatrix cells are always in the scope of two groupings and you could have
multiple data rows which match the group instance values. Therefore, you
should always use aggregate functions when referencing fields in a matrix
cell (hence, a processing warning gets generated).
If you don't use an explicit aggregate function in the matrix cell, we would
implicitly use the first row's field value. I believe you actually don't
want just the first value, but rather the sum - so you should change the
expression to:
=iif(Sum(Fields!Score.Value)=0, "", Sum(Fields!Score.Value))
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
In your case, I believe you want
"Chris Walls" <chwalls@.community.nospam> wrote in message
news:OVqzX42OFHA.1500@.TK2MSFTNGP09.phx.gbl...
> On a report we have a matrix. The data cell has the following expression:
>
> =iif(Fields!Score.Value=0, "", Fields!Score.Value)
>
> When we run the report, we get the following warning:
>
> The value expression for the textbox 'Score' references a field
> outside an aggregate function. Value expressions in matrix cells should
> be aggregates, to allow for subtotaling.
>
>
> What does this mean and how can I resolve it?
>
>
> The goal it to suppress the display of zero (0). We have tried setting
> the format of the data cell to be "#", but the zero is still displayed.
> So we have been using expressions like the above to achieve this.
>
>
> The user creating this report is using the stand-alone C# IDE with
> Reporting Services. This warning prevents them from previewing the
> report. Another user using VS.NET 2003 is able to preview the report
> despite the warning. The report renders on our test reporting server. If
> we need to just ignore the warning, how can we get the user using C# to be
> able to preview the report?
>
>
> Thanks,
> Chris
>
>
Sunday, February 26, 2012
help store procedure timeout
I have one store procedure (SP) on a Sqlservr2000 under win2003 that SP
takes 7 minutes to run but if I get the query and tput it to the
queryanalizer it takes 16 seconds!!! I dont understand why, two days ago
that SP was working right but sudenly got slow!!! i dont know what to do ,
please helpppppppppp
Antother tip, my asp.net application reports the timeout problem but If I
run the same app with a copy of that DataBase on my nootebook (xp) using
the debuger all works fine!!! I am really confused
THANKS for your help
SergioHi Sergio
How did you run the query in Query Analyser? If you ran the query with hard
coded parameter values it is not the same as running the stored procedure.
Have you updated statistics and defragemented your indexes? You should have
a
regular maintenance plan to do this and also do this if you make significant
changes to the data (such as a batch update!). If the indexes and statistics
are up-to-date you could have a poor query plan, try executing the procedure
with the with RECOMPILE option or use sp_recompile to force a new query plan
.
If your code does not branch in the stored procedure you may be better
splitting it into multiple sub-procedures.
John
"SergioT" wrote:
> hi
> I have one store procedure (SP) on a Sqlservr2000 under win2003 that SP
> takes 7 minutes to run but if I get the query and tput it to the
> queryanalizer it takes 16 seconds!!! I don′t understand why, two days ago
> that SP was working right but sudenly got slow!!! i don′t know what to do
,
> please helpppppppppp
> Antother tip, my asp.net application reports the timeout problem but If
I
> run the same app with a copy of that DataBase on my nootebook (xp) using
> the debuger all works fine!!! I am really confused
>
> THANKS for your help
> Sergio
>
>|||Hi Sergio
How did you run the query in Query Analyser? If you ran the query with hard
coded parameter values it is not the same as running the stored procedure.
Have you updated statistics and defragemented your indexes? You should have
a
regular maintenance plan to do this and also do this if you make significant
changes to the data (such as a batch update!). If the indexes and statistics
are up-to-date you could have a poor query plan, try executing the procedure
with the with RECOMPILE option or use sp_recompile to force a new query plan
.
If your code does not branch in the stored procedure you may be better
splitting it into multiple sub-procedures.
John
"SergioT" wrote:
> hi
> I have one store procedure (SP) on a Sqlservr2000 under win2003 that SP
> takes 7 minutes to run but if I get the query and tput it to the
> queryanalizer it takes 16 seconds!!! I don′t understand why, two days ago
> that SP was working right but sudenly got slow!!! i don′t know what to do
,
> please helpppppppppp
> Antother tip, my asp.net application reports the timeout problem but If
I
> run the same app with a copy of that DataBase on my nootebook (xp) using
> the debuger all works fine!!! I am really confused
>
> THANKS for your help
> Sergio
>
>
help store procedure timeout
I have one store procedure (SP) on a Sqlservr2000 under win2003 that SP
takes 7 minutes to run but if I get the query and tput it to the
queryanalizer it takes 16 seconds!!! I don´t understand why, two days ago
that SP was working right but sudenly got slow!!! i don´t know what to do ,
please helpppppppppp
Antother tip, my asp.net application reports the timeout problem but If I
run the same app with a copy of that DataBase on my nootebook (xp) using
the debuger all works fine!!! I am really confused
THANKS for your help
SergioHi Sergio
How did you run the query in Query Analyser? If you ran the query with hard
coded parameter values it is not the same as running the stored procedure.
Have you updated statistics and defragemented your indexes? You should have a
regular maintenance plan to do this and also do this if you make significant
changes to the data (such as a batch update!). If the indexes and statistics
are up-to-date you could have a poor query plan, try executing the procedure
with the with RECOMPILE option or use sp_recompile to force a new query plan.
If your code does not branch in the stored procedure you may be better
splitting it into multiple sub-procedures.
John
"SergioT" wrote:
> hi
> I have one store procedure (SP) on a Sqlservr2000 under win2003 that SP
> takes 7 minutes to run but if I get the query and tput it to the
> queryanalizer it takes 16 seconds!!! I don´t understand why, two days ago
> that SP was working right but sudenly got slow!!! i don´t know what to do ,
> please helpppppppppp
> Antother tip, my asp.net application reports the timeout problem but If I
> run the same app with a copy of that DataBase on my nootebook (xp) using
> the debuger all works fine!!! I am really confused
>
> THANKS for your help
> Sergio
>
>
Help stop my spinning wheels on user sql
blocker
but have spun wheels for a long long time unable to find sql run by top
blocker.
Any body done this before or has directions to scripts that can do this
Your input is highly appreciated
MassaTry:
select
p1.*
from
dbo.sysprocesses p1
where exists
(
select
*
from
dbo.sysprocesses p2
where
p2.blocked = p1.spid
)
and p1.blocked in (0, p1.spid)
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
.
<mngong@.gmail.com> wrote in message
news:1153233005.503275.256110@.i42g2000cwa.googlegroups.com...
Can query sysprocesses to get user information .Can find the top
blocker
but have spun wheels for a long long time unable to find sql run by top
blocker.
Any body done this before or has directions to scripts that can do this
Your input is highly appreciated
Massa|||Thanks Dr Tom
Needed the complete sql that has been my bete noire.
at the time the blocking occured
Tom Moreau wrote:
> Try:
> select
> p1.*
> from
> dbo.sysprocesses p1
> where exists
> (
> select
> *
> from
> dbo.sysprocesses p2
> where
> p2.blocked = p1.spid
> )
> and p1.blocked in (0, p1.spid)
>
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Toronto, ON Canada
> .
> <mngong@.gmail.com> wrote in message
> news:1153233005.503275.256110@.i42g2000cwa.googlegroups.com...
> Can query sysprocesses to get user information .Can find the top
> blocker
> but have spun wheels for a long long time unable to find sql run by top
> blocker.
> Any body done this before or has directions to scripts that can do this
> Your input is highly appreciated
> Massa|||In that case, you'd pretty much need to be running the profiler at the time
it occurred.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
.
<mngong@.gmail.com> wrote in message
news:1153234728.918733.70910@.35g2000cwc.googlegroups.com...
Thanks Dr Tom
Needed the complete sql that has been my bete noire.
at the time the blocking occured
Tom Moreau wrote:
> Try:
> select
> p1.*
> from
> dbo.sysprocesses p1
> where exists
> (
> select
> *
> from
> dbo.sysprocesses p2
> where
> p2.blocked = p1.spid
> )
> and p1.blocked in (0, p1.spid)
>
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Toronto, ON Canada
> .
> <mngong@.gmail.com> wrote in message
> news:1153233005.503275.256110@.i42g2000cwa.googlegroups.com...
> Can query sysprocesses to get user information .Can find the top
> blocker
> but have spun wheels for a long long time unable to find sql run by top
> blocker.
> Any body done this before or has directions to scripts that can do this
> Your input is highly appreciated
> Massa|||I can't tell if you're using SQL Server 2005 here, but if you are, you might
be interested in the 'blocked process threshold' parameter of sp_configure.
On our testing servers I have a trace going that continually monitors for
these problem areas. What gets returned is an XML block which details the
blocking and blocked processes - very nice indeed. If you're on SQL Server
2000, the sp_blocker_pss80 scripts would be worth looking at
(http://support.microsoft.com/?id=271509).
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
Help stop my spinning wheels on user sql
blocker
but have spun wheels for a long long time unable to find sql run by top
blocker.
Any body done this before or has directions to scripts that can do this
Your input is highly appreciated
MassaTry:
select
p1.*
from
dbo.sysprocesses p1
where exists
(
select
*
from
dbo.sysprocesses p2
where
p2.blocked = p1.spid
)
and p1.blocked in (0, p1.spid)
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
.
<mngong@.gmail.com> wrote in message
news:1153233005.503275.256110@.i42g2000cwa.googlegroups.com...
Can query sysprocesses to get user information .Can find the top
blocker
but have spun wheels for a long long time unable to find sql run by top
blocker.
Any body done this before or has directions to scripts that can do this
Your input is highly appreciated
Massa|||Thanks Dr Tom
Needed the complete sql that has been my bete noire.
at the time the blocking occured
Tom Moreau wrote:
> Try:
> select
> p1.*
> from
> dbo.sysprocesses p1
> where exists
> (
> select
> *
> from
> dbo.sysprocesses p2
> where
> p2.blocked = p1.spid
> )
> and p1.blocked in (0, p1.spid)
>
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Toronto, ON Canada
> .
> <mngong@.gmail.com> wrote in message
> news:1153233005.503275.256110@.i42g2000cwa.googlegroups.com...
> Can query sysprocesses to get user information .Can find the top
> blocker
> but have spun wheels for a long long time unable to find sql run by top
> blocker.
> Any body done this before or has directions to scripts that can do this
> Your input is highly appreciated
> Massa|||In that case, you'd pretty much need to be running the profiler at the time
it occurred.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
.
<mngong@.gmail.com> wrote in message
news:1153234728.918733.70910@.35g2000cwc.googlegroups.com...
Thanks Dr Tom
Needed the complete sql that has been my bete noire.
at the time the blocking occured
Tom Moreau wrote:
> Try:
> select
> p1.*
> from
> dbo.sysprocesses p1
> where exists
> (
> select
> *
> from
> dbo.sysprocesses p2
> where
> p2.blocked = p1.spid
> )
> and p1.blocked in (0, p1.spid)
>
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Toronto, ON Canada
> .
> <mngong@.gmail.com> wrote in message
> news:1153233005.503275.256110@.i42g2000cwa.googlegroups.com...
> Can query sysprocesses to get user information .Can find the top
> blocker
> but have spun wheels for a long long time unable to find sql run by top
> blocker.
> Any body done this before or has directions to scripts that can do this
> Your input is highly appreciated
> Massa|||I can't tell if you're using SQL Server 2005 here, but if you are, you might
be interested in the 'blocked process threshold' parameter of sp_configure.
On our testing servers I have a trace going that continually monitors for
these problem areas. What gets returned is an XML block which details the
blocking and blocked processes - very nice indeed. If you're on SQL Server
2000, the sp_blocker_pss80 scripts would be worth looking at
(http://support.microsoft.com/?id=271509).
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
Friday, February 24, 2012
Help sending email
obvious reasons). The code is placed inside a DTS task via VBS scripting.
But when I try to run directly from the server where sqlserver is installed,
the script fails.
I have SMTP running, but there is no outlook installed.
Can someone please advise what I am missing.
Thanks
Bob
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "send@.test.com"
objEmail.To = "receive@.test.com"
objEmail.Subject = "TEST SUBJECT"
objEmail.AddAttachment "\\server\test.csv"
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
ration/sendusing") = 2
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
ration/smtpserver") = "SERVER_NAME"
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
ration/smtpauthenticate") = 1
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
ration/sendusername") = "username"
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
ration/sendpassword") = "userpwd"
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
ration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send
set objEmail = nothingHi B
One thing you might try is change
> objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
> ration/sendusing") = 2
to
> objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
> ration/sendusing") = "2"
quotes around the 2.
I spent several hours a week ago trying the very same thing and that made
all the difference.
Also is \\server\test.csv accessible from the server you are running this
on?
Here is the full text of the DTS Package I wrote. Note that I don't think
all the fields you included are necessary.
'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************
Function Main()
email_alert "dchristo@.yahoo.com", "George_Bush@.whitehouse.gov","Test
Subject", "Test Body"
Main = DTSTaskExecResult_Success
End Function
Sub email_alert(strTo, strFrom, strSubject, strBody)
Dim iConf 'As CDO.Configuration
Dim imsg 'As CDO.Message
Dim flds
Set imsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set flds = iConf.Fields
'The http://schemas.microsoft.com/cdo/configuration/ namespace defines
the majority of fields used to set configurations for various CDO objects.
We set and update the following three fields (SendUsing, SMTP_SERVER, and
TimeOut) of the Configuration object:
With flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") =
"2"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"smtp-server.mn.rr.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")
= 10
.Update
End With
Set imsg.Configuration = iConf
imsg.To = strTo
imsg.From = strFrom
imsg.Subject = strSubject
imsg.TextBody = strBody
imsg.AddAttachment "c:\log\myfile.txt"
imsg.Send
End Sub
--
-Dick Christoph
"B" <no_spam@.no_spam.com> wrote in message
news:KsydnTnYtfFV2wbZnZ2dnUVZ_uqdnZ2d@.rcn.net...
> My code below works fine when run from my pc (changed all the values for
> obvious reasons). The code is placed inside a DTS task via VBS scripting.
> But when I try to run directly from the server where sqlserver is
> installed,
> the script fails.
> I have SMTP running, but there is no outlook installed.
> Can someone please advise what I am missing.
> Thanks
> Bob
>
> Set objEmail = CreateObject("CDO.Message")
> objEmail.From = "send@.test.com"
> objEmail.To = "receive@.test.com"
> objEmail.Subject = "TEST SUBJECT"
> objEmail.AddAttachment "\\server\test.csv"
> objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
> ration/sendusing") = 2
> objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
> ration/smtpserver") = "SERVER_NAME"
> objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
> ration/smtpauthenticate") = 1
> objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
> ration/sendusername") = "username"
> objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
> ration/sendpassword") = "userpwd"
> objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
> ration/smtpserverport") = 25
> objEmail.Configuration.Fields.Update
> objEmail.Send
> set objEmail = nothing|||Follow-up to my original post below.
Is it possible for the "objEmail.To" to lookup the values from a sqlserver
table?
At the moment, I type the email address separated by a semi-colon.
TIA~
"B" <no_spam@.no_spam.com> wrote in message
news:KsydnTnYtfFV2wbZnZ2dnUVZ_uqdnZ2d@.rcn.net...
> My code below works fine when run from my pc (changed all the values for
> obvious reasons). The code is placed inside a DTS task via VBS scripting.
> But when I try to run directly from the server where sqlserver is
installed,
> the script fails.
> I have SMTP running, but there is no outlook installed.
> Can someone please advise what I am missing.
> Thanks
> Bob
>
> Set objEmail = CreateObject("CDO.Message")
> objEmail.From = "send@.test.com"
> objEmail.To = "receive@.test.com"
> objEmail.Subject = "TEST SUBJECT"
> objEmail.AddAttachment "\\server\test.csv"
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
> ration/sendusing") = 2
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
> ration/smtpserver") = "SERVER_NAME"
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
> ration/smtpauthenticate") = 1
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
> ration/sendusername") = "username"
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
> ration/sendpassword") = "userpwd"
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
> ration/smtpserverport") = 25
> objEmail.Configuration.Fields.Update
> objEmail.Send
> set objEmail = nothing|||Hi B,
Well not directly but you could create an ADODB Command, Connection and
Recordset and use the command to return you a recordset from the Database
that would have 1 or many email addresses that you could concatenate
together and stick in the objEmail.To field.
--
-Dick Christoph
"B" <no_spam@.no_spam.com> wrote in message
news:c4mdnfssT45ImT7ZnZ2dnUVZ_r-dnZ2d@.rcn.net...
> Follow-up to my original post below.
> Is it possible for the "objEmail.To" to lookup the values from a sqlserver
> table?
> At the moment, I type the email address separated by a semi-colon.
> TIA~
>
> "B" <no_spam@.no_spam.com> wrote in message
> news:KsydnTnYtfFV2wbZnZ2dnUVZ_uqdnZ2d@.rcn.net...
>> My code below works fine when run from my pc (changed all the values for
>> obvious reasons). The code is placed inside a DTS task via VBS
>> scripting.
>> But when I try to run directly from the server where sqlserver is
> installed,
>> the script fails.
>>
>> I have SMTP running, but there is no outlook installed.
>>
>> Can someone please advise what I am missing.
>> Thanks
>> Bob
>>
>>
>> Set objEmail = CreateObject("CDO.Message")
>>
>> objEmail.From = "send@.test.com"
>> objEmail.To = "receive@.test.com"
>> objEmail.Subject = "TEST SUBJECT"
>> objEmail.AddAttachment "\\server\test.csv"
>>
> objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
>> ration/sendusing") = 2
>>
> objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
>> ration/smtpserver") = "SERVER_NAME"
>>
> objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
>> ration/smtpauthenticate") = 1
>>
> objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
>> ration/sendusername") = "username"
>>
> objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
>> ration/sendpassword") = "userpwd"
>>
> objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
>> ration/smtpserverport") = 25
>> objEmail.Configuration.Fields.Update
>> objEmail.Send
>>
>> set objEmail = nothing
>>
>>
Help requred
[quote]
declare @.P1 int
set @.P1=1
exec sp_prepare @.P1 output, NULL, N'SELECT * FROM orders_tab', 1
select @.P1
go
/[quote]
SELECT * FROM orders_tab, is it really hapenning?
orders_tab contains 2 lac records.
I couldn't find sp_prepare in BOL.
Any ideas?
Howdy!Howdy
Sp_prepare are SQL system commands. You wont find them documented.
Sunday, February 19, 2012
Help required to do backup/restore from a client app
As part of a client application that we are building, we need to do database
backup and restore operations. The application could be run on a machine that
does not have SQL server.
Need clarification on:
1. How do we initiate the backup/restore operations from the client machine?
Should we be looking at SQL DMO objects?
If so, the client machine may not have SQL DMO objects and its dependent
files.
Are these files distributable so that they could be included along with our
application?
2. Our application is also 'localizable' and it should be able to work with
different language versions of SQL Server.
In this case, should we be using 'localized' versions of SQL DMO files?
3. Or is there an alternate way of achieving backup/restore and not be
concerned about 'redistributable' versions of SQL DMO files (and 'localized'
file set additionally, if it comes to requiring such files)?
Any help on these will be greatly appreciated.
Thanks.
Regards,
KK
DMO, ADO or any other type of connection that can execute TSQL commands is
all you need to initiate backups. DMO doesn't include any UI functionality
so AFAIK there is no localization setting in that API. As far as the server
is concerned the language is an option set in the connection (SET LANGUAGE).
DMO is redistributable (see the readme REDIST.TXT on your installation disc
for the actual file names) with the proviso that the client machine still
needs to be properly licensed as a client for SQL Server.
David Portas
SQL Server MVP
Help required to do backup/restore from a client app
As part of a client application that we are building, we need to do database
backup and restore operations. The application could be run on a machine tha
t
does not have SQL server.
Need clarification on:
1. How do we initiate the backup/restore operations from the client machine?
Should we be looking at SQL DMO objects?
If so, the client machine may not have SQL DMO objects and its dependent
files.
Are these files distributable so that they could be included along with our
application?
2. Our application is also 'localizable' and it should be able to work with
different language versions of SQL Server.
In this case, should we be using 'localized' versions of SQL DMO files?
3. Or is there an alternate way of achieving backup/restore and not be
concerned about 'redistributable' versions of SQL DMO files (and 'localized'
file set additionally, if it comes to requiring such files)?
Any help on these will be greatly appreciated.
Thanks.
Regards,
KKDMO, ADO or any other type of connection that can execute TSQL commands is
all you need to initiate backups. DMO doesn't include any UI functionality
so AFAIK there is no localization setting in that API. As far as the server
is concerned the language is an option set in the connection (SET LANGUAGE).
DMO is redistributable (see the readme REDIST.TXT on your installation disc
for the actual file names) with the proviso that the client machine still
needs to be properly licensed as a client for SQL Server.
David Portas
SQL Server MVP
--
Help required to do backup/restore from a client app
As part of a client application that we are building, we need to do database
backup and restore operations. The application could be run on a machine that
does not have SQL server.
Need clarification on:
1. How do we initiate the backup/restore operations from the client machine?
Should we be looking at SQL DMO objects?
If so, the client machine may not have SQL DMO objects and its dependent
files.
Are these files distributable so that they could be included along with our
application?
2. Our application is also 'localizable' and it should be able to work with
different language versions of SQL Server.
In this case, should we be using 'localized' versions of SQL DMO files?
3. Or is there an alternate way of achieving backup/restore and not be
concerned about 'redistributable' versions of SQL DMO files (and 'localized'
file set additionally, if it comes to requiring such files)?
Any help on these will be greatly appreciated.
Thanks.
Regards,
KKDMO, ADO or any other type of connection that can execute TSQL commands is
all you need to initiate backups. DMO doesn't include any UI functionality
so AFAIK there is no localization setting in that API. As far as the server
is concerned the language is an option set in the connection (SET LANGUAGE).
DMO is redistributable (see the readme REDIST.TXT on your installation disc
for the actual file names) with the proviso that the client machine still
needs to be properly licensed as a client for SQL Server.
--
David Portas
SQL Server MVP
--