Showing posts with label via. Show all posts
Showing posts with label via. Show all posts

Friday, March 30, 2012

ProSQL

Hi all,
Dose anyone know where i can get quick infor about ProSQL.. The database
we're using uses ProSQL...
Thanks All
Message posted via http://www.droptable.com
Hi,
This group is specically meant for Microsoft SQL Server. Take a look into
dbmonster groups...
http://www.droptable.com/Uwe/ForumList.aspx
Thanks
Hari
"Naba via droptable.com" <u23570@.uwe> wrote in message
news:6a3ba2198df34@.uwe...
> Hi all,
> Dose anyone know where i can get quick infor about ProSQL.. The database
> we're using uses ProSQL...
> Thanks All
> --
> Message posted via http://www.droptable.com
>
|||Thanks Hari will do...
Hari Prasad wrote:[vbcol=seagreen]
>Hi,
>This group is specically meant for Microsoft SQL Server. Take a look into
>dbmonster groups...
>http://www.droptable.com/Uwe/ForumList.aspx
>Thanks
>Hari
Message posted via http://www.droptable.com

ProSQL

Hi all,
Dose anyone know where i can get quick infor about ProSQL.. The database
we're using uses ProSQL...
Thanks All
Message posted via http://www.droptable.comHi,
This group is specically meant for Microsoft SQL Server. Take a look into
dbmonster groups...
http://www.droptable.com/Uwe/ForumList.aspx
Thanks
Hari
"Naba via droptable.com" <u23570@.uwe> wrote in message
news:6a3ba2198df34@.uwe...
> Hi all,
> Dose anyone know where i can get quick infor about ProSQL.. The database
> we're using uses ProSQL...
> Thanks All
> --
> Message posted via http://www.droptable.com
>|||Thanks Hari will do...
Hari Prasad wrote:[vbcol=seagreen]
>Hi,
>This group is specically meant for Microsoft SQL Server. Take a look into
>dbmonster groups...
>http://www.droptable.com/Uwe/ForumList.aspx
>Thanks
>Hari
>
Message posted via http://www.droptable.com

ProSQL

Hi all,
Dose anyone know where i can get quick infor about ProSQL.. The database
we're using uses ProSQL...
Thanks All
--
Message posted via http://www.sqlmonster.comHi,
This group is specically meant for Microsoft SQL Server. Take a look into
dbmonster groups...
http://www.dbmonster.com/Uwe/ForumList.aspx
Thanks
Hari
"Naba via SQLMonster.com" <u23570@.uwe> wrote in message
news:6a3ba2198df34@.uwe...
> Hi all,
> Dose anyone know where i can get quick infor about ProSQL.. The database
> we're using uses ProSQL...
> Thanks All
> --
> Message posted via http://www.sqlmonster.com
>|||Thanks Hari will do...
Hari Prasad wrote:
>Hi,
>This group is specically meant for Microsoft SQL Server. Take a look into
>dbmonster groups...
>http://www.dbmonster.com/Uwe/ForumList.aspx
>Thanks
>Hari
>> Hi all,
>> Dose anyone know where i can get quick infor about ProSQL.. The database
>> we're using uses ProSQL...
>> Thanks All
--
Message posted via http://www.sqlmonster.comsql

Tuesday, March 20, 2012

programtically capture query runtime

What are some sound solutions to capture the query runtime via a
script/proc? The info returned from Statistics time is hard to process.
The goal is to run a statement(s) and capture and track the execution
time to check on the availability of SQL Server. The data can be
analyzed to determine when perf is high and low. But the main reason is
to check db availability.

Thanks,

Mike

--
Posted via http://dbforums.comwukie (member30544@.dbforums.com) writes:
> What are some sound solutions to capture the query runtime via a
> script/proc? The info returned from Statistics time is hard to process.
> The goal is to run a statement(s) and capture and track the execution
> time to check on the availability of SQL Server. The data can be
> analyzed to determine when perf is high and low. But the main reason is
> to check db availability.

I'm not sure that I understand what you are looking for. But have
you investigated whether the Profiler can be useful for the task?

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||What I am trying to do is write a web page that executes a simple update
statement which will go through the complete application stack. If
successfull then the system is up and available for use. Additionally I
would like to record the timing for each exectution (which is actually
icing on the cake).

Profile would only get me the DB portion and I want to feel our
customers experience ...

Mike

--
Posted via http://dbforums.com|||What I am trying to do is write a web page that executes a simple update
statement which will go through the complete application stack. If
successfull then the system is up and available for use. Additionally I
would like to record the timing for each exectution (which is actually
icing on the cake).

Profile would only get me the DB portion and I want to feel our
customers experience ...

Mike

--
Posted via http://dbforums.com

Wednesday, March 7, 2012

Programmatically create a Data Driven Subscription

Hi,
I have seen the examples of creating a Subscription via code.
I actually wish to create a data driven subscription. Can someone point me
to an example of this or post me an example?
many thanks
MattFound an example.
Have question on this though, how to set the data source to a shared data
source rather than a literal?
I assume you need to use DataSourceDefinitionOrReference rather than
dataSourceDefinition. How do you populate this?
"Matt" <NoSpam:Matthew.Moran@.Computercorp.com.au> wrote in message
news:%23vHHGkbeEHA.3616@.TK2MSFTNGP10.phx.gbl...
> Hi,
> I have seen the examples of creating a Subscription via code.
> I actually wish to create a data driven subscription. Can someone point
me
> to an example of this or post me an example?
> many thanks
> Matt
>|||Got it. Sorry pls ignore
"Matt" <NoSpam:Matthew.Moran@.Computercorp.com.au> wrote in message
news:uAx8KaceEHA.1424@.tk2msftngp13.phx.gbl...
> Found an example.
> Have question on this though, how to set the data source to a shared data
> source rather than a literal?
> I assume you need to use DataSourceDefinitionOrReference rather than
> dataSourceDefinition. How do you populate this?
>
> "Matt" <NoSpam:Matthew.Moran@.Computercorp.com.au> wrote in message
> news:%23vHHGkbeEHA.3616@.TK2MSFTNGP10.phx.gbl...
> > Hi,
> >
> > I have seen the examples of creating a Subscription via code.
> >
> > I actually wish to create a data driven subscription. Can someone point
> me
> > to an example of this or post me an example?
> >
> > many thanks
> >
> > Matt
> >
> >
>

Saturday, February 25, 2012

programatically obtain primary keys

Given a table, is there a way to look into the systables and obtain the primary keys of that table via a select statement?

Thanks,

Phil

I got it nevermind.

select s.name as TABLE_SCHEMA, t.name as TABLE_NAME

, k.name as CONSTRAINT_NAME, k.type_desc as CONSTRAINT_TYPE
, c.name as COLUMN_NAME, ic.key_ordinal AS ORDINAL_POSITION
from sys.key_constraints as k
join sys.tables as t
on t.object_id = k.parent_object_id
join sys.schemas as s
on s.schema_id = t.schema_id
join sys.index_columns as ic
on ic.object_id = t.object_id
and ic.index_id = k.unique_index_id
join sys.columns as c
on c.object_id = t.object_id
and c.column_id = ic.column_id
order by TABLE_SCHEMA, TABLE_NAME, CONSTRAINT_TYPE, CONSTRAINT_NAME, ORDINAL_POSITION;

programatically move to the next column

Hello All...
I am writing to an .xls via an ActiveX script in a DTS.
I need to programatically move to the next column when
the data dictates.
After checking params, I'd like to simply say...
If I am currently in column B, I need to make the
CurCol (Current Column) = C
Is there anything that works like
CurCol = Select 'b' + 1
Thanks in advance,
bob mcclellanNot sure if I follow your requirements, but using column names directly is
the most reliable approach. If you want the "column number" for some reason,
you'd have to query the metadata, for instance like:
DECLARE @.index INT
SET @.index =1
SELECT COL_NAME( OBJECT_ID( QUOTENAME( '<tbl>' ) ), @.index )
Anith|||Hello Anith.
I simply want to increment alphabetically.
I know that I can create a table with all the columns of
a spreadsheet and then increment through the table
but I was wondering if there was a way to simply say
what comes after B and then what comes after C...
the same way that you can say
declare @.i int
Select @.i = 1
Select @.i = @.i +1
I would like to say
declare @.c char(2)
Select @.c = 'A'
Select @.c = @.c + 1
I just want to gain control over what column in a spreadsheet I
am writing to.
like... .range(@.c + "1) = myValue
Thanks in advance,
bob mcclellan
"Anith Sen" <anith@.bizdatasolutions.com> wrote in message
news:eYudD1KCFHA.3236@.TK2MSFTNGP15.phx.gbl...
> Not sure if I follow your requirements, but using column names directly is
> the most reliable approach. If you want the "column number" for some
> reason, you'd have to query the metadata, for instance like:
> DECLARE @.index INT
> SET @.index =1
> SELECT COL_NAME( OBJECT_ID( QUOTENAME( '<tbl>' ) ), @.index )
> --
> Anith
>|||One common approach is to use a staging table that corresponds to your
source data and then manipulate the data into your final table
structure using an INSERT...SELECT.
ActiveX does support referencing a column by position number in a
fields collection but I'm not sure that will help you very much. Maybe
if you explain the actual problem someone can help you with an
alternative. Why can't you reference columns by name?
--
David Portas
SQL Server MVP
--|||I misread your post. I though you were imporiting an Excel spreadsheet
rather than exporting it.
Is SQL Server the data source? If so, I expect it's possible to write a
SELECT statement that prepares the data in the form your spreadsheet
requires. If you want help, please post DDL for your tables, sample
data INSERTs and show your required end result.
--
David Portas
SQL Server MVP
--|||Hello David...
> ActiveX does support referencing a column by position number in a
> fields collection but I'm not sure that will help you very much.
--this is part of the code that I use to write the labels into Column A.
----
--
xlBook.Worksheets(1).Range("A1..iv500") = Null
xlBook.Save
'This puts the classes in Column A
with xlBook.Worksheets(1)
do while not rs.eof
.Range("A" &rs.fields("arc_id")) = rs.fields("Class")
rs.movenext
loop
end with
----
--
I've created a proc that builds the cross ref table I need...
To identify each Column increment so that I can dynamically
write the cell range to the column I need ...
I'm sorry David if this explanation is not Clear....
I can make it work, using the table created from the following proc...
Thanks in advance,
bob mcclellan
----
--
alter Proc AlphaIncrement_MakeTable
as
Set NoCount On
IF EXISTS(SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'AlphaIncrement')
DROP TABLE AlphaIncrement
CREATE TABLE AlphaIncrement
(
Alpha_ID int
IDENTITY(1,1)
PRIMARY KEY CLUSTERED,
Letter char(2) Not Null
)
declare @.i int
Select @.i = 97
While @.i < 123
begin
Insert into AlphaIncrement (Letter)
SELECT CHAR(@.i)
Select @.i = @.i + 1
end
Select @.i = 97
While @.i < 123
begin
Insert into AlphaIncrement (Letter)
SELECT 'a'+CHAR(@.i)
Select @.i = @.i + 1
end
Select @.i = 97
While @.i < 123
begin
Insert into AlphaIncrement (Letter)
SELECT 'b'+CHAR(@.i)
Select @.i = @.i + 1
end
Select @.i = 97
While @.i < 123
begin
Insert into AlphaIncrement (Letter)
SELECT 'c'+CHAR(@.i)
Select @.i = @.i + 1
end
Select @.i = 97
While @.i < 123
begin
Insert into AlphaIncrement (Letter)
SELECT 'd'+CHAR(@.i)
Select @.i = @.i + 1
end
Select @.i = 97
While @.i < 123
begin
Insert into AlphaIncrement (Letter)
SELECT 'e'+CHAR(@.i)
Select @.i = @.i + 1
end
Select @.i = 97
While @.i < 123
begin
Insert into AlphaIncrement (Letter)
SELECT 'f'+CHAR(@.i)
Select @.i = @.i + 1
end
Select @.i = 97
While @.i < 123
begin
Insert into AlphaIncrement (Letter)
SELECT 'g'+CHAR(@.i)
Select @.i = @.i + 1
end
Select @.i = 97
While @.i < 123
begin
Insert into AlphaIncrement (Letter)
SELECT 'h'+CHAR(@.i)
Select @.i = @.i + 1
end
Select @.i = 97
While @.i < 119
begin
Insert into AlphaIncrement (Letter)
SELECT 'i'+CHAR(@.i)
Select @.i = @.i + 1
end
select * from AlphaIncrement order by alpha_ID
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:1107354249.455002.35430@.l41g2000cwc.googlegroups.com...
> One common approach is to use a staging table that corresponds to your
> source data and then manipulate the data into your final table
> structure using an INSERT...SELECT.
> ActiveX does support referencing a column by position number in a
> fields collection but I'm not sure that will help you very much. Maybe
> if you explain the actual problem someone can help you with an
> alternative. Why can't you reference columns by name?
> --
> David Portas
> SQL Server MVP
> --
>|||Thanks David...
I really appreciate it.
I actually worked through this prior to reading your post.
Thanks again...
bob mcclellan
Following is the script I put together ....
'***************************************
*********************************
'D:\Common\Mailers\Batches\AvgRatesByCla
ss\Avg.Rates.By.Class.xls
'Populate Spreadsheet with Monthly Rates
'***************************************
*********************************
Function Main()
Dim xlApp
Dim xlBook
Dim i
Set xlApp = CreateObject("Excel.Application")
Set xlBook =
xlApp.Workbooks.Open(" D:\Common\Mailers\Batches\AvgRatesByClas
s\Avg.Rates.By
.Class.xls")
Dim sqlText
sqlText = "select arc_ID, Class from avgRatesClasses"
sqlColsText = "Select * from alphaIncrement"
dim con
dim rs
dim rsCols
set con = createobject("ADODB.Connection")
set rs = createobject("ADODB.recordset")
set rsCols = createobject("ADODB.recordset")
con.open = "Provider = SQLOLEDB.1; data source = (local); initial catalog
= MyWorkDB; user id = 'me'; password ='mypassword';"
rs.open sqltext, con
rsCols.open sqlColstext, con
xlBook.Worksheets(1).Range("A1..iv500") = Null
xlBook.Worksheets(1).Range("A1") = "CLASS"
xlBook.Save
rs.movenext
'This puts the classes in Column A
with xlBook.Worksheets(1)
do while not rs.eof
.Range("A" &rs.fields("arc_id")) = rs.fields("Class")
rs.movenext
loop
end with
sqlText = "Select c.arc_id, d.* from avgRatesClassesData d " _
& " inner join avgRatesClasses c on " _
& " d.class = c.class " _
& "order by yr desc, Mnth desc, d.class " _
rs.close
rs.open sqltext, con
'Move to Column B
rsCols.movenext
dim CurMnthDate
CurMnthDate = rs.fields("yrMnth")
dim CurCol
CurCol = rtrim(rsCols.fields("letter"))
with xlBook.Worksheets(1)
.Range(CurCol & 1) = rs.fields("yrMnth")
do while not rs.eof
if CurMnthDate <> rs.fields("yrMnth") then
rsCols.movenext
CurCol = rtrim(rsCols.fields("letter"))
.Range(CurCol & "1") = rs.fields("yrMnth")
CurMnthDate = rs.fields("yrMnth")
end if
.Range(CurCol &rs.fields("arc_id")) = rs.fields("avgRate")
rs.movenext
loop
end with
xlBook.Save
rs.close
set rs = nothing
rsCols.close
set rsCols = nothing
xlBook.Close
Set xlBook = Nothing
xlApp.Quit
Set xlApp = Nothing
Main = DTSTaskExecResult_Success
End Function
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:1107354731.006660.43150@.g14g2000cwa.googlegroups.com...
>I misread your post. I though you were imporiting an Excel spreadsheet
> rather than exporting it.
> Is SQL Server the data source? If so, I expect it's possible to write a
> SELECT statement that prepares the data in the form your spreadsheet
> requires. If you want help, please post DDL for your tables, sample
> data INSERTs and show your required end result.
> --
> David Portas
> SQL Server MVP
> --
>

Programatically find out the SQL Server Version and SP via registry or WMI?

Hi All,
Just keen to find a way to find the version of SQL Server and the current installed SQL Server Service pack via either a registry key or a WMI class entry...
I've had a good look, but can't seem to find anything that matches or is useful. I know you can retrieve this via a SQL query (with Select @.@.version), but I'm after a way that uses our existing WMI/registry reading process as we are collecting info from s
ervers all over the world, so I don't want to have to deal with all the SQL permissions issues & have to use a different tool in order to run a SQL query...
Any info or advice that people can offer would be greatfully accepted
Thanks in Advance
Cheers
Iain
HKEY_LOCAL_MACHINE/Software/Microsoft/MSSQLServer/MSSQLServer/CurrentVersion
/CSDVersion
It's for default instance, don't know what will be for named instance really
but you can check it by yourself
"iain sandercock" <iain*DOT*sandercock@.*NOSPAM*riotinto.com> wrote in
message news:8E21AF3D-25DF-4709-AB10-4CD106A57340@.microsoft.com...
> Hi All,
> Just keen to find a way to find the version of SQL Server and the current
installed SQL Server Service pack via either a registry key or a WMI class
entry...
> I've had a good look, but can't seem to find anything that matches or is
useful. I know you can retrieve this via a SQL query (with Select
@.@.version), but I'm after a way that uses our existing WMI/registry reading
process as we are collecting info from servers all over the world, so I
don't want to have to deal with all the SQL permissions issues & have to use
a different tool in order to run a SQL query...
> Any info or advice that people can offer would be greatfully accepted
> Thanks in Advance
> Cheers
> Iain
|||Alex,
A named instance can be found here:
HKEY_LOCAL_MACHINE/Software/Microsoft/Microsoft SQL
Server/INSTANCE_NAME/MSSQLServer/CurrentVersion/CSDVersion
Where INSTANCE_NAME is the name of your SQL Server named instance.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Alex Cieszinski" <nomail@.thanks> wrote in message
news:ODWl%23YwPEHA.3304@.TK2MSFTNGP12.phx.gbl...
>
HKEY_LOCAL_MACHINE/Software/Microsoft/MSSQLServer/MSSQLServer/CurrentVersion
> /CSDVersion
> It's for default instance, don't know what will be for named instance
really
> but you can check it by yourself
>
|||Thanks Mark & Alex...
This is exactly what I need
Can't believe I didn't spot this, must have been due to a long day on friday for me to have missed it. The other method I found was to check the event log via WMI for the event that SQL records on startup, which give the version of SQL, and also the versi
on of SQL Server that is running (Enterprise / Standard /Developer etc)...the only limitation on this is that you need a relatively specific WQL (WMI Query Language) query - as its an information event that only differs in the message text from a range of
other event log informational messages from SQLServer, and the LIKE operator for WQL is only suppported in XP/Server2003.....not w2k which the majority of the servers will be.
Given that this info is in the registry, I wonder why in the PSS collection tool they retrieve the version from SQL statement, but I assume that it is to grab the SQL product type (enterprise edition etc) at the same time.....is this something that is al
so stored in the registry, as the only reference that might give this info is the productID (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\80\Registration), which I'll check on some different version machines to see if it actaully does identi
fy the product type...
if you already know if productID correlates with the different editions, and what the productIDs are for the various editions, that would be great, otherwise I'll post the results of what I find out back here for your reference
Thanks again
cheers
Iain
|||Ok, CSDVersion gives me "8.00.760" - what does that tell me about the Service Pack installed?
Regards
|||Thanks Mark,
I can use the list of version numbers - but what a crappy way of encoding the SP version into the version number.
It's impossible for me to write an algorithm displaying the SP version - that'll also work when SP4 i released!
Any ideas?
|||... and on a related node:
- how do i retrieve the version and SP of Internet Explorer?

Programatically find out the SQL Server Version and SP via registry or WMI?

Hi All,
Just keen to find a way to find the version of SQL Server and the current installed SQL Server Service pack via either a registry key or a WMI class entry..
I've had a good look, but can't seem to find anything that matches or is useful. I know you can retrieve this via a SQL query (with Select @.@.version), but I'm after a way that uses our existing WMI/registry reading process as we are collecting info from servers all over the world, so I don't want to have to deal with all the SQL permissions issues & have to use a different tool in order to run a SQL query..
Any info or advice that people can offer would be greatfully accepte
Thanks in Advanc
Cheer
IainHKEY_LOCAL_MACHINE/Software/Microsoft/MSSQLServer/MSSQLServer/CurrentVersion
/CSDVersion
It's for default instance, don't know what will be for named instance really
but you can check it by yourself
"iain sandercock" <iain*DOT*sandercock@.*NOSPAM*riotinto.com> wrote in
message news:8E21AF3D-25DF-4709-AB10-4CD106A57340@.microsoft.com...
> Hi All,
> Just keen to find a way to find the version of SQL Server and the current
installed SQL Server Service pack via either a registry key or a WMI class
entry...
> I've had a good look, but can't seem to find anything that matches or is
useful. I know you can retrieve this via a SQL query (with Select
@.@.version), but I'm after a way that uses our existing WMI/registry reading
process as we are collecting info from servers all over the world, so I
don't want to have to deal with all the SQL permissions issues & have to use
a different tool in order to run a SQL query...
> Any info or advice that people can offer would be greatfully accepted
> Thanks in Advance
> Cheers
> Iain|||Alex,
A named instance can be found here:
HKEY_LOCAL_MACHINE/Software/Microsoft/Microsoft SQL
Server/INSTANCE_NAME/MSSQLServer/CurrentVersion/CSDVersion
Where INSTANCE_NAME is the name of your SQL Server named instance.
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Alex Cieszinski" <nomail@.thanks> wrote in message
news:ODWl%23YwPEHA.3304@.TK2MSFTNGP12.phx.gbl...
>
HKEY_LOCAL_MACHINE/Software/Microsoft/MSSQLServer/MSSQLServer/CurrentVersion
> /CSDVersion
> It's for default instance, don't know what will be for named instance
really
> but you can check it by yourself
>|||Thanks Mark & Alex..
This is exactly what I nee
Can't believe I didn't spot this, must have been due to a long day on friday for me to have missed it. The other method I found was to check the event log via WMI for the event that SQL records on startup, which give the version of SQL, and also the version of SQL Server that is running (Enterprise / Standard /Developer etc)...the only limitation on this is that you need a relatively specific WQL (WMI Query Language) query - as its an information event that only differs in the message text from a range of other event log informational messages from SQLServer, and the LIKE operator for WQL is only suppported in XP/Server2003.....not w2k which the majority of the servers will be.
Given that this info is in the registry, I wonder why in the PSS collection tool they retrieve the version from SQL statement, but I assume that it is to grab the SQL product type (enterprise edition etc) at the same time.....is this something that is also stored in the registry, as the only reference that might give this info is the productID (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\80\Registration), which I'll check on some different version machines to see if it actaully does identify the product type..
if you already know if productID correlates with the different editions, and what the productIDs are for the various editions, that would be great, otherwise I'll post the results of what I find out back here for your referenc
Thanks agai
cheer
Iain|||Rasmus,
This should help:
How do I know which version of SQL Server I'm running?
http://aspfaq.com/show.asp?id=2160
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Rasmus wrote:
> Ok, CSDVersion gives me "8.00.760" - what does that tell me about the Service Pack installed?
>
> Regards|||Thanks Mark
I can use the list of version numbers - but what a crappy way of encoding the SP version into the version number.
It's impossible for me to write an algorithm displaying the SP version - that'll also work when SP4 i released
Any ideas?|||... and on a related node
- how do i retrieve the version and SP of Internet Explorer?

Programatically find out the SQL Server Version and SP via registry or WMI?

Hi All,
Just keen to find a way to find the version of SQL Server and the current in
stalled SQL Server Service pack via either a registry key or a WMI class ent
ry...
I've had a good look, but can't seem to find anything that matches or is use
ful. I know you can retrieve this via a SQL query (with Select @.@.version), b
ut I'm after a way that uses our existing WMI/registry reading process as we
are collecting info from s
ervers all over the world, so I don't want to have to deal with all the SQL
permissions issues & have to use a different tool in order to run a SQL quer
y...
Any info or advice that people can offer would be greatfully accepted
Thanks in Advance
Cheers
IainHKEY_LOCAL_MACHINE/Software/Microsoft/MSSQLServer/MSSQLServer/CurrentVersion
/CSDVersion
It's for default instance, don't know what will be for named instance really
but you can check it by yourself
"iain sandercock" <iain*DOT*sandercock@.*NOSPAM*riotinto.com> wrote in
message news:8E21AF3D-25DF-4709-AB10-4CD106A57340@.microsoft.com...
> Hi All,
> Just keen to find a way to find the version of SQL Server and the current
installed SQL Server Service pack via either a registry key or a WMI class
entry...
> I've had a good look, but can't seem to find anything that matches or is
useful. I know you can retrieve this via a SQL query (with Select
@.@.version), but I'm after a way that uses our existing WMI/registry reading
process as we are collecting info from servers all over the world, so I
don't want to have to deal with all the SQL permissions issues & have to use
a different tool in order to run a SQL query...
> Any info or advice that people can offer would be greatfully accepted
> Thanks in Advance
> Cheers
> Iain|||Alex,
A named instance can be found here:
HKEY_LOCAL_MACHINE/Software/Microsoft/Microsoft SQL
Server/INSTANCE_NAME/MSSQLServer/CurrentVersion/CSDVersion
Where INSTANCE_NAME is the name of your SQL Server named instance.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Alex Cieszinski" <nomail@.thanks> wrote in message
news:ODWl%23YwPEHA.3304@.TK2MSFTNGP12.phx.gbl...
>
HKEY_LOCAL_MACHINE/Software/Microsoft/MSSQLServer/MSSQLServer/CurrentVersion
> /CSDVersion
> It's for default instance, don't know what will be for named instance
really
> but you can check it by yourself
>|||Thanks Mark & Alex...
This is exactly what I need
Can't believe I didn't spot this, must have been due to a long day on friday
for me to have missed it. The other method I found was to check the event l
og via WMI for the event that SQL records on startup, which give the version
of SQL, and also the versi
on of SQL Server that is running (Enterprise / Standard /Developer etc)...th
e only limitation on this is that you need a relatively specific WQL (WMI Qu
ery Language) query - as its an information event that only differs in the m
essage text from a range of
other event log informational messages from SQLServer, and the LIKE operator
for WQL is only suppported in XP/Server2003.....not w2k which the majority
of the servers will be.
Given that this info is in the registry, I wonder why in the PSS collection
tool they retrieve the version from SQL statement, but I assume that it is t
o grab the SQL product type (enterprise edition etc) at the same time.....i
s this something that is al
so stored in the registry, as the only reference that might give this info i
s the productID (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\M
icrosoft SQL Server\
80\Registration), which I'll check on some different version machines to see
if it actaully does identi
fy the product type...
if you already know if productID correlates with the different editions, and
what the productIDs are for the various editions, that would be great, othe
rwise I'll post the results of what I find out back here for your reference
Thanks again
cheers
Iain|||Ok, CSDVersion gives me "8.00.760" - what does that tell me about the Servic
e Pack installed?
Regards|||Thanks Mark,
I can use the list of version numbers - but what a crappy way of encoding th
e SP version into the version number.
It's impossible for me to write an algorithm displaying the SP version - tha
t'll also work when SP4 i released!
Any ideas?|||... and on a related node:
- how do i retrieve the version and SP of Internet Explorer?

Monday, February 20, 2012

Programatic or expression for failure

Hello,

Is there a way is a script task or via a procedural expression to tell if a package is going to fail because of an error?

This would be used to fire something which should occure if the max number of errors/error severity to fail the package had been reached

Thanks

Paul

Hi Paul,

I'm unaware of a way to tell before execution that a package is going to encounter n number of errors. You can use the DtExec /Validate switch (or check the Validate package without executing checkbox in DtExecUI) to perform a package validation, but validation will not catch all conditions that can raise errors during execution.

You may want to check into SSIS Event Handlers. These allow you to respond to error conditions.

Hope this helps,

Andy

|||

Sorry I did not clarify the problem very well.

When a package is running and an OnError event handeler is called i want it to do somthing specific if the package will fail because of the error. usually a OnError would cause the package to fall over but i have changed the package to allowed errors to be 3 so not every error would cause the package to fail.

e.g.

Error 1 would send an email

Error 2 would send an email

Error 3 would send an email and move a file (the package would fail at this point)

|||

Hi Paul,

Oh, ok. Count the errors.

Create a package-scoped variable called iErrorCount of Int32 data type. Make the first task in your OnError Event Handler a Script Task that contains code similar to the following:

Code Snippet

Dim iErrCount as Integer =

Convert.ToInt32(

Dts.Variables("iErrorCount").Value)

iErrCount += 1

If iErrCount >= 3 Then

...

Hope this helps,

Andy