Showing posts with label servers. Show all posts
Showing posts with label servers. Show all posts

Sunday, March 25, 2012

check MDAC version

I would like to check the MDAC version on our SQL Server 2005 servers on
windows 2003. How can I do so ?
Hassan,
I have not try this in a long time but this must be the link
How to check for MDAC version
http://support.microsoft.com/kb/301202
Hope this helps,
Ben Nevarez
Senior Database Administrator
AIG SunAmerica
"Hassan" wrote:

> I would like to check the MDAC version on our SQL Server 2005 servers on
> windows 2003. How can I do so ?
>
|||HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DataAccess
Kevin Hill
IC3 North Texas
www.ChristianCycling.com
Please support me in the 2008 MS150:
http://www.ms150.org/dallas/donate/donate.cfm?id=208000
"Hassan" <hassan@.test.com> wrote in message
news:eZ2c73WTIHA.5360@.TK2MSFTNGP03.phx.gbl...
>I would like to check the MDAC version on our SQL Server 2005 servers on
>windows 2003. How can I do so ?
>
|||Go to the Microsoft download site and look for CC_PKG.exe the MDAC Utility:
Component Checker 2.0
'"Hassan" <hassan@.test.com> wrote in message
news:eZ2c73WTIHA.5360@.TK2MSFTNGP03.phx.gbl...
>I would like to check the MDAC version on our SQL Server 2005 servers on
>windows 2003. How can I do so ?
>

check MDAC version

I would like to check the MDAC version on our SQL Server 2005 servers on
windows 2003. How can I do so ?Hassan,
I have not try this in a long time but this must be the link
How to check for MDAC version
http://support.microsoft.com/kb/301202
Hope this helps,
Ben Nevarez
Senior Database Administrator
AIG SunAmerica
"Hassan" wrote:
> I would like to check the MDAC version on our SQL Server 2005 servers on
> windows 2003. How can I do so ?
>|||HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DataAccess
--
Kevin Hill
IC3 North Texas
www.ChristianCycling.com
Please support me in the 2008 MS150:
http://www.ms150.org/dallas/donate/donate.cfm?id=208000
"Hassan" <hassan@.test.com> wrote in message
news:eZ2c73WTIHA.5360@.TK2MSFTNGP03.phx.gbl...
>I would like to check the MDAC version on our SQL Server 2005 servers on
>windows 2003. How can I do so ?
>|||Go to the Microsoft download site and look for CC_PKG.exe the MDAC Utility:
Component Checker 2.0
'"Hassan" <hassan@.test.com> wrote in message
news:eZ2c73WTIHA.5360@.TK2MSFTNGP03.phx.gbl...
>I would like to check the MDAC version on our SQL Server 2005 servers on
>windows 2003. How can I do so ?
>

check MDAC version

I would like to check the MDAC version on our SQL Server 2005 servers on
windows 2003. How can I do so ?Hassan,
I have not try this in a long time but this must be the link
How to check for MDAC version
http://support.microsoft.com/kb/301202
Hope this helps,
Ben Nevarez
Senior Database Administrator
AIG SunAmerica
"Hassan" wrote:

> I would like to check the MDAC version on our SQL Server 2005 servers on
> windows 2003. How can I do so ?
>|||HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Da
taAccess
Kevin Hill
IC3 North Texas
www.ChristianCycling.com
Please support me in the 2008 MS150:
http://www.ms150.org/dallas/donate/donate.cfm?id=208000
"Hassan" <hassan@.test.com> wrote in message
news:eZ2c73WTIHA.5360@.TK2MSFTNGP03.phx.gbl...
>I would like to check the MDAC version on our SQL Server 2005 servers on
>windows 2003. How can I do so ?
>|||Go to the Microsoft download site and look for CC_PKG.exe the MDAC Utility:
Component Checker 2.0
'"Hassan" <hassan@.test.com> wrote in message
news:eZ2c73WTIHA.5360@.TK2MSFTNGP03.phx.gbl...
>I would like to check the MDAC version on our SQL Server 2005 servers on
>windows 2003. How can I do so ?
>

check link server availability in sp

I am changing a stored proc to use linked servers.
We have 5 linked sql servers, each in different physical locations and
from time to time the network connection at one of the locations may go
down. It is critical that if I can't get to a linked server, that my sp
doesn't fail and return an error code. I just need to run a different
sql statement against just the one sql server.
I am trying to simulate this in my lab by doing any of the following:
- physically disconnecting the linked sql server's cat5 cable from the
network
- pausing the linked server
- changing the name of linked server on my local server so the names
don't match.
In each case I get a message saying
Server: Msg 11, Level 16, State 1, Line 1
General network error. Check your network documentation.
I can't change the code, I really need to accomplish this in stored
procedure(s)
Here is my stored procedure.
SET XACT_ABORT OFF
SET @.sSQL = ' SELECT count(id) FROM LINKEDSVR1.dbName.dbo.tli '
EXEC @.iReturnCode = sp_executesql @.sSql
SET XACT_ABORT ON
PRINT CONVERT(CHAR(5), @.@.Error) + ' - @.@.ErrorCode'
PRINT CONVERT(CHAR(5), @.iReturnCode) + ' - @.iReturnCode'
IF @.iReturnCode = 1
BEGIN
PRINT 'can't connect to linked server'
-- run sql statement1 on local sql server
END
ELSE
BEGIN
PRINT 'no error'
-- run sql statement2 on local and linked sql server
END
Any ideas?I have written a small activeX dll that I use to ping the target servers
using the sp_OA methods for active X integration with transactSQL. I've
wrapped this up in a procedure IsHostAlive_sp @.hostName that will check.
The server itself must be able to resolve the address.
You can have the DLL if you want, its a VB6 project.
Phil
<rinfo@.mail.com> wrote in message
news:1130424229.400896.218240@.g14g2000cwa.googlegroups.com...
>I am changing a stored proc to use linked servers.
> We have 5 linked sql servers, each in different physical locations and
> from time to time the network connection at one of the locations may go
> down. It is critical that if I can't get to a linked server, that my sp
> doesn't fail and return an error code. I just need to run a different
> sql statement against just the one sql server.
> I am trying to simulate this in my lab by doing any of the following:
> - physically disconnecting the linked sql server's cat5 cable from the
> network
> - pausing the linked server
> - changing the name of linked server on my local server so the names
> don't match.
> In each case I get a message saying
> Server: Msg 11, Level 16, State 1, Line 1
> General network error. Check your network documentation.
> I can't change the code, I really need to accomplish this in stored
> procedure(s)
> Here is my stored procedure.
> SET XACT_ABORT OFF
> SET @.sSQL = ' SELECT count(id) FROM LINKEDSVR1.dbName.dbo.tli '
> EXEC @.iReturnCode = sp_executesql @.sSql
> SET XACT_ABORT ON
> PRINT CONVERT(CHAR(5), @.@.Error) + ' - @.@.ErrorCode'
> PRINT CONVERT(CHAR(5), @.iReturnCode) + ' - @.iReturnCode'
> IF @.iReturnCode = 1
> BEGIN
> PRINT 'can't connect to linked server'
> -- run sql statement1 on local sql server
> END
> ELSE
> BEGIN
> PRINT 'no error'
> -- run sql statement2 on local and linked sql server
> END
> Any ideas?
>|||Ping is probably a decent first step, but a small one.
If it's not on the same LAN, pings may get dropped on the floor due to
outright refusal of traffic, this is very common, e.g. ping
www.microsoft.com
Even a successful ping result does not mean everything is okay. Did you
check the actual port SQL Server is listening on (may be disabled or
blocked)? Are you sure that the specific SQL Server instance is running?
Are you sure that your login credentials are good?
Another approach might be to inspect the results of an osql call.
create table #foo( dbname sysname null )
insert #foo exec master..xp_cmdshell
'osql -S<linkedservername> -U<username> -P<password> -dMaster -Q"SELECT TOP
1 Name FROM sysdatabases"'
SELECT * FROM #foo
drop table #foo
This will take 10 seconds if <linkedservername> is not available. The
result will be:
(3 row(s) affected)
dbname
----
----
[DBNETLIB]SQL Server does not exist or access denied.
[DBNETLIB]ConnectionOpen (Connect()).
NULL
(3 row(s) affected)
"Phil Simpson" <phil.simpson@.nsdlsystems.com> wrote in message
news:uOu4tow2FHA.400@.TK2MSFTNGP09.phx.gbl...
>I have written a small activeX dll that I use to ping the target servers
>using the sp_OA methods for active X integration with transactSQL. I've
>wrapped this up in a procedure IsHostAlive_sp @.hostName that will check.
>The server itself must be able to resolve the address.
> You can have the DLL if you want, its a VB6 project.
> Phil|||You can use SQLDMO as in this example
http://www.sqldbatips.com/displaycode.asp?ID=38
In SQL2005 there is a bultin system procedure to do this
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
<rinfo@.mail.com> wrote in message
news:1130424229.400896.218240@.g14g2000cwa.googlegroups.com...
>I am changing a stored proc to use linked servers.
> We have 5 linked sql servers, each in different physical locations and
> from time to time the network connection at one of the locations may go
> down. It is critical that if I can't get to a linked server, that my sp
> doesn't fail and return an error code. I just need to run a different
> sql statement against just the one sql server.
> I am trying to simulate this in my lab by doing any of the following:
> - physically disconnecting the linked sql server's cat5 cable from the
> network
> - pausing the linked server
> - changing the name of linked server on my local server so the names
> don't match.
> In each case I get a message saying
> Server: Msg 11, Level 16, State 1, Line 1
> General network error. Check your network documentation.
> I can't change the code, I really need to accomplish this in stored
> procedure(s)
> Here is my stored procedure.
> SET XACT_ABORT OFF
> SET @.sSQL = ' SELECT count(id) FROM LINKEDSVR1.dbName.dbo.tli '
> EXEC @.iReturnCode = sp_executesql @.sSql
> SET XACT_ABORT ON
> PRINT CONVERT(CHAR(5), @.@.Error) + ' - @.@.ErrorCode'
> PRINT CONVERT(CHAR(5), @.iReturnCode) + ' - @.iReturnCode'
> IF @.iReturnCode = 1
> BEGIN
> PRINT 'can't connect to linked server'
> -- run sql statement1 on local sql server
> END
> ELSE
> BEGIN
> PRINT 'no error'
> -- run sql statement2 on local and linked sql server
> END
> Any ideas?
>

Check last access/update date on each database

I need to check the date of the last update on each database on some
servers.
If the last update is many months ago, I'll need at least stop SQL Services.
How is the best was to do it?
Thanks folks!!!
Carlos Felipe França da FonsecaHi,
SQL Server will not keep track of these info by itself. Only way is to
verify the modifiedon column in your table. If you do not have modified on
column
then you may need to setup a profiler trace and based on the log you need to
go further.
Thanks
Hari
SQL Server MVP
"Carlos Felipe França da Fonseca" <carlos@.felipe.com.br> wrote in message
news:%23B0kfB52GHA.2196@.TK2MSFTNGP06.phx.gbl...
>I need to check the date of the last update on each database on some
>servers.
> If the last update is many months ago, I'll need at least stop SQL
> Services.
> How is the best was to do it?
> Thanks folks!!!
> Carlos Felipe França da Fonseca
>|||Hello,
Alternative way is look into sysprocesses table in each server .
For SPID > 50 look for last_batch . Check the date and time .
Note this will provide database accessed time and not updated time .
You have to look into all user databases for last_batch before
stopping the service .
M A Srinivas
Carlos Felipe Fran=E7a da Fonseca wrote:
> I need to check the date of the last update on each database on some
> servers.
> If the last update is many months ago, I'll need at least stop SQL Servic=es.
> How is the best was to do it?
> > Thanks folks!!!
> > Carlos Felipe Fran=E7a da Fonseca

Tuesday, March 20, 2012

check for queries running with parallelism

I want to check for all queries running with parallelism on our sql servers
for a 24 hour period. How can I do so ?
THanksTake a look at http://msdn2.microsoft.com/en-us/library/ms187943.aspx, and
read up on server side traces.
Note that you are warned about the overhead of this particular eventclass -
so it may prove too much of a hit to be running for 24 hours straight.
"Hassan" <hassan@.test.com> wrote in message
news:ub1Y8GKYIHA.1132@.TK2MSFTNGP06.phx.gbl...
>I want to check for all queries running with parallelism on our sql servers
>for a 24 hour period. How can I do so ?
> THanks|||To add on to Will's response about the server side trace, consider
specifying a filter to narrow down the number of events as much as possible.
Unfortunately, a filter can't be specified on the binary data column that
includes the number of CPUs used. Also, consider specifying a trace file
rollover to keep the trace file sizes reasonable if you have a busy server,
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Hassan" <hassan@.test.com> wrote in message
news:ub1Y8GKYIHA.1132@.TK2MSFTNGP06.phx.gbl...
>I want to check for all queries running with parallelism on our sql servers
>for a 24 hour period. How can I do so ?
> THanks|||You can use this but it is built off of the procedure cache. There are
limitations especially if you have have memory bottleneck or plan reuse
issues.
select
qs.sql_handle,
qs.statement_start_offset,
qs.statement_end_offset,
q.dbid,
q.objectid,
q.number,
q.encrypted,
q.text
from sys.dm_exec_query_stats qs
cross apply sys.dm_exec_sql_text(qs.plan_handle) as q
where qs.total_worker_time > qs.total_elapsed_time
http://www.microsoft.com/technet/scriptcenter/scripts/sql/sql2005/default.mspx?mfr=true
--
Jason Massie
www: http://statisticsio.com
rss: http://feeds.feedburner.com/statisticsio
"Hassan" <hassan@.test.com> wrote in message
news:ub1Y8GKYIHA.1132@.TK2MSFTNGP06.phx.gbl...
>I want to check for all queries running with parallelism on our sql servers
>for a 24 hour period. How can I do so ?
> THankssql

Thursday, February 16, 2012

CHARINDEX doesn't work

My charindex seems to always return 0 no matter what. I tried it on
different SQL servers and I always get 0 no matter what. Here was a
test script I tried and still got zero.
DECLARE @.myvar as varchar(25)
DECLARE @.myvar2 as varchar(25)
SET @.myvar = 'hello'
SET @.myvar2 = 'll'
PRINT CHARINDEX( @.myvar, @.myvar2 )
PRINT CHARINDEX( 'test', 's' )
Both print zero... can anyone tell me what i'm doing wrong?Never mind.. I had the parameters mixed up. What a dumb mistake.|||try this, you reversed them!
DECLARE @.myvar as varchar(25)
DECLARE @.myvar2 as varchar(25)
SET @.myvar = 'hello'
SET @.myvar2 = 'll'
PRINT CHARINDEX( @.myvar2, @.myvar )
PRINT CHARINDEX( 's','test' )
http://sqlservercode.blogspot.com/

Tuesday, February 14, 2012

character sets, sort order, collations

Just trying to determine character set and sort order for a couple servers.
I see that the output for sp_helpsort has changed, such that it used to be
more helpful than it is now. I guess it changed at some point. On a SQL 7
system, I can easily get the charset and sortorder (below), as well as a
listing of the characters in order.
Character Set = 1, iso_1
ISO 8859-1 (Latin-1) - Western European 8-bit character set.
Sort Order = 52, nocase_iso
Case-insensitive dictionary sort order for use with several We
stern-European languages including English, French, and German
. Uses the ISO 8859-1 character set.
Alternatively, EXEC sp_serverinfo 18: charset=iso_1 sort_order=nocase_iso
charset_num=1 sort_order_num=52
But on some SQL 2000 systems, sp_helpsort returns:
Latin1-General, case-insensitive, accent-sensitive, kanatype-insensitive,
width-insensitive
And EXEC sp_server_info 18: charset=iso_1 collation=Latin1_General_CI_AS
How do I confirm that newer systems are 72 - nocase_1252 rather than 52 -
nocase_iso when such descriptive output isn't provided any more?
Dale.these might be of help:
http://msdn.microsoft.com/library/en-us/instsql/in_collation_3oa6.asp
select *
from ::fn_helpcollations()
-oj
<Dale Kerr> wrote in message news:%23GKAhQovFHA.3152@.TK2MSFTNGP12.phx.gbl...
> Just trying to determine character set and sort order for a couple
> servers. I see that the output for sp_helpsort has changed, such that it
> used to be more helpful than it is now. I guess it changed at some point.
> On a SQL 7 system, I can easily get the charset and sortorder (below), as
> well as a listing of the characters in order.
> Character Set = 1, iso_1
> ISO 8859-1 (Latin-1) - Western European 8-bit character set.
> Sort Order = 52, nocase_iso
> Case-insensitive dictionary sort order for use with several We
> stern-European languages including English, French, and German
> . Uses the ISO 8859-1 character set.
> Alternatively, EXEC sp_serverinfo 18: charset=iso_1 sort_order=nocase_iso
> charset_num=1 sort_order_num=52
> But on some SQL 2000 systems, sp_helpsort returns:
> Latin1-General, case-insensitive, accent-sensitive, kanatype-insensitive,
> width-insensitive
> And EXEC sp_server_info 18: charset=iso_1 collation=Latin1_General_CI_AS
> How do I confirm that newer systems are 72 - nocase_1252 rather than 52 -
> nocase_iso when such descriptive output isn't provided any more?
> Dale.
>|||Cheers, I'll see if I can get my head around it.
"oj" <nospam_ojngo@.home.com> wrote in message
news:O4k18covFHA.2880@.TK2MSFTNGP12.phx.gbl...
> these might be of help:
> http://msdn.microsoft.com/library/en-us/instsql/in_collation_3oa6.asp
> select *
> from ::fn_helpcollations()

character sets, sort order, collations

Just trying to determine character set and sort order for a couple servers.
I see that the output for sp_helpsort has changed, such that it used to be
more helpful than it is now. I guess it changed at some point. On a SQL 7
system, I can easily get the charset and sortorder (below), as well as a
listing of the characters in order.
Character Set = 1, iso_1
ISO 8859-1 (Latin-1) - Western European 8-bit character set.
Sort Order = 52, nocase_iso
Case-insensitive dictionary sort order for use with several We
stern-European languages including English, French, and German
. Uses the ISO 8859-1 character set.
Alternatively, EXEC sp_serverinfo 18: charset=iso_1 sort_order=nocase_iso
charset_num=1 sort_order_num=52
But on some SQL 2000 systems, sp_helpsort returns:
Latin1-General, case-insensitive, accent-sensitive, kanatype-insensitive,
width-insensitive
And EXEC sp_server_info 18: charset=iso_1 collation=Latin1_General_CI_AS
How do I confirm that newer systems are 72 - nocase_1252 rather than 52 -
nocase_iso when such descriptive output isn't provided any more?
Dale.these might be of help:
http://msdn.microsoft.com/library/e...lation_3oa6.asp
select *
from ::fn_helpcollations()
-oj
<Dale Kerr> wrote in message news:%23GKAhQovFHA.3152@.TK2MSFTNGP12.phx.gbl...
> Just trying to determine character set and sort order for a couple
> servers. I see that the output for sp_helpsort has changed, such that it
> used to be more helpful than it is now. I guess it changed at some point.
> On a SQL 7 system, I can easily get the charset and sortorder (below), as
> well as a listing of the characters in order.
> Character Set = 1, iso_1
> ISO 8859-1 (Latin-1) - Western European 8-bit character set.
> Sort Order = 52, nocase_iso
> Case-insensitive dictionary sort order for use with several We
> stern-European languages including English, French, and German
> . Uses the ISO 8859-1 character set.
> Alternatively, EXEC sp_serverinfo 18: charset=iso_1 sort_order=nocase_iso
> charset_num=1 sort_order_num=52
> But on some SQL 2000 systems, sp_helpsort returns:
> Latin1-General, case-insensitive, accent-sensitive, kanatype-insensitive,
> width-insensitive
> And EXEC sp_server_info 18: charset=iso_1 collation=Latin1_General_CI_AS
> How do I confirm that newer systems are 72 - nocase_1252 rather than 52 -
> nocase_iso when such descriptive output isn't provided any more?
> Dale.
>|||Cheers, I'll see if I can get my head around it.
"oj" <nospam_ojngo@.home.com> wrote in message
news:O4k18covFHA.2880@.TK2MSFTNGP12.phx.gbl...
> these might be of help:
> http://msdn.microsoft.com/library/e...lation_3oa6.asp
> select *
> from ::fn_helpcollations()

character sets, sort order, collations

Just trying to determine character set and sort order for a couple servers.
I see that the output for sp_helpsort has changed, such that it used to be
more helpful than it is now. I guess it changed at some point. On a SQL 7
system, I can easily get the charset and sortorder (below), as well as a
listing of the characters in order.
Character Set = 1, iso_1
ISO 8859-1 (Latin-1) - Western European 8-bit character set.
Sort Order = 52, nocase_iso
Case-insensitive dictionary sort order for use with several We
stern-European languages including English, French, and German
. Uses the ISO 8859-1 character set.
Alternatively, EXEC sp_serverinfo 18: charset=iso_1 sort_order=nocase_iso
charset_num=1 sort_order_num=52
But on some SQL 2000 systems, sp_helpsort returns:
Latin1-General, case-insensitive, accent-sensitive, kanatype-insensitive,
width-insensitive
And EXEC sp_server_info 18: charset=iso_1 collation=Latin1_General_CI_AS
How do I confirm that newer systems are 72 - nocase_1252 rather than 52 -
nocase_iso when such descriptive output isn't provided any more?
Dale.
these might be of help:
http://msdn.microsoft.com/library/en...ation_3oa6.asp
select *
from ::fn_helpcollations()
-oj
<Dale Kerr> wrote in message news:%23GKAhQovFHA.3152@.TK2MSFTNGP12.phx.gbl...
> Just trying to determine character set and sort order for a couple
> servers. I see that the output for sp_helpsort has changed, such that it
> used to be more helpful than it is now. I guess it changed at some point.
> On a SQL 7 system, I can easily get the charset and sortorder (below), as
> well as a listing of the characters in order.
> Character Set = 1, iso_1
> ISO 8859-1 (Latin-1) - Western European 8-bit character set.
> Sort Order = 52, nocase_iso
> Case-insensitive dictionary sort order for use with several We
> stern-European languages including English, French, and German
> . Uses the ISO 8859-1 character set.
> Alternatively, EXEC sp_serverinfo 18: charset=iso_1 sort_order=nocase_iso
> charset_num=1 sort_order_num=52
> But on some SQL 2000 systems, sp_helpsort returns:
> Latin1-General, case-insensitive, accent-sensitive, kanatype-insensitive,
> width-insensitive
> And EXEC sp_server_info 18: charset=iso_1 collation=Latin1_General_CI_AS
> How do I confirm that newer systems are 72 - nocase_1252 rather than 52 -
> nocase_iso when such descriptive output isn't provided any more?
> Dale.
>
|||Cheers, I'll see if I can get my head around it.
"oj" <nospam_ojngo@.home.com> wrote in message
news:O4k18covFHA.2880@.TK2MSFTNGP12.phx.gbl...
> these might be of help:
> http://msdn.microsoft.com/library/en...ation_3oa6.asp
> select *
> from ::fn_helpcollations()