Showing posts with label command. Show all posts
Showing posts with label command. Show all posts

Wednesday, March 28, 2012

Finding Difference In Strings

Hey everyone, I am hoping someone can help me with a command that I am struggling to find. What I want to do is run a T-SQL command where it will return only the difference between 2 strings.

For example: If i have "This is a test" and "This is a test which will be good", then i want the command to return "which will be good" I believed there had to be this sort of a command, but i could not find anything close to it. Any ideas on how i would accomplish this?

Quote:

Originally Posted by willwmagic

Hey everyone, I am hoping someone can help me with a command that I am struggling to find. What I want to do is run a T-SQL command where it will return only the difference between 2 strings.

For example: If i have "This is a test" and "This is a test which will be good", then i want the command to return "which will be good" I believed there had to be this sort of a command, but i could not find anything close to it. Any ideas on how i would accomplish this?


You may need a stored procedure to do this. CHARINDEX and SUBSTRING functions may be useful|||what do expect when the strings are

"This is a test" and "wow,This is a test" ?|||

Quote:

Originally Posted by debasisdas

what do expect when the strings are

"This is a test" and "wow,This is a test" ?


I am not so concerned with what is before the string match, but more so with what is after the matched string.

Wednesday, March 21, 2012

Find top 10 tables which have worst statistics

hi guys,
I use following command to find out statistic of table, but how do I find t
op 10 tables which have worst statistics in a database?
DBCC SHOW_STATISTICS ( table , target )Kevin,
Maybe using SQL-DMO...I think you'd have a little bit more control of the ou
tput there.
However the timing of when the statistics were last updated might provide yo
u with some insight as to which tables may have the worst statistics.
This query might get you started off of the timing of the last stats update
(not fully tested):
SELECT 'Index Name' = i.name,
'Statistics Date' = STATS_DATE(i.id, i.indid)
FROM sysobjects o, sysindexes i
WHERE o.id = i.id and STATS_DATE(i.id, i.indid) IS NOT NULL and i.name NOT
LIKE '_WA%'
and i.name NOT LIKE '%sys%'
ORDER BY 2
Do you have the automatic update statistics set for the database?
HTH
Jerry
"Kevin" <pearl_77@.hotmail.com> wrote in message news:%235WH%23mGxFHA.916@.TK2
MSFTNGP10.phx.gbl...
hi guys,
I use following command to find out statistic of table, but how do I find t
op 10 tables which have worst statistics in a database?
DBCC SHOW_STATISTICS ( table , target )|||yes, I have automatic update statistics set on databases.
but I dont' think that will guarantee statistics to be perfect.
I just want to find out which tables have worst statistics. I found an arti
cle in following link, it's very helpful.
http://www.sqlservercentral.com/scr...utions/1069.asp
thanks
"Jerry Spivey" <jspivey@.vestas-awt.com> wrote in message news:ur44dEHxFHA.27
92@.tk2msftngp13.phx.gbl...
Kevin,
Maybe using SQL-DMO...I think you'd have a little bit more control of the ou
tput there.
However the timing of when the statistics were last updated might provide yo
u with some insight as to which tables may have the worst statistics.
This query might get you started off of the timing of the last stats update
(not fully tested):
SELECT 'Index Name' = i.name,
'Statistics Date' = STATS_DATE(i.id, i.indid)
FROM sysobjects o, sysindexes i
WHERE o.id = i.id and STATS_DATE(i.id, i.indid) IS NOT NULL and i.name NOT
LIKE '_WA%'
and i.name NOT LIKE '%sys%'
ORDER BY 2
Do you have the automatic update statistics set for the database?
HTH
Jerry
"Kevin" <pearl_77@.hotmail.com> wrote in message news:%235WH%23mGxFHA.916@.TK2
MSFTNGP10.phx.gbl...
hi guys,
I use following command to find out statistic of table, but how do I find t
op 10 tables which have worst statistics in a database?
DBCC SHOW_STATISTICS ( table , target )

Friday, March 9, 2012

find out all indexes for a table

Does the command "sp_helpindex table_name" finds out all
indexes related to this table? Thanks.
Yes.
http://www.aspfaq.com/
(Reverse address to reply.)
"Bill" <fei0405@.yahoo.com> wrote in message
news:275801c49cf5$565702c0$a401280a@.phx.gbl...
> Does the command "sp_helpindex table_name" finds out all
> indexes related to this table? Thanks.
|||In a nutshell,
Yes
Rick Sawtell
MCT, MCSD, MCDBA
"Bill" <fei0405@.yahoo.com> wrote in message
news:275801c49cf5$565702c0$a401280a@.phx.gbl...
> Does the command "sp_helpindex table_name" finds out all
> indexes related to this table? Thanks.

find out all indexes for a table

Does the command "sp_helpindex table_name" finds out all
indexes related to this table? Thanks.Yes.
--
http://www.aspfaq.com/
(Reverse address to reply.)
"Bill" <fei0405@.yahoo.com> wrote in message
news:275801c49cf5$565702c0$a401280a@.phx.gbl...
> Does the command "sp_helpindex table_name" finds out all
> indexes related to this table? Thanks.|||In a nutshell,
Yes
Rick Sawtell
MCT, MCSD, MCDBA
"Bill" <fei0405@.yahoo.com> wrote in message
news:275801c49cf5$565702c0$a401280a@.phx.gbl...
> Does the command "sp_helpindex table_name" finds out all
> indexes related to this table? Thanks.

Find N/w adapters remotely

Is there any command I can use to find out the n/w adapters used on a remote
SQL 2000 Server without actually logging onto that box and going to My
Network Place and so on.. Want to be able to do it remotely
ThanksYou can run mmc, add the Device Manager snap-in, point it at your remote
server and have a look at the Network Adapters section to find out what
adapters you're using on that box. Not exactly a cmdline but you don't have
to start a full TS session on your remote server.
HTH.
--
Cheers,
Mike
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:uDDrKNn0EHA.2016@.TK2MSFTNGP15.phx.gbl...
> Is there any command I can use to find out the n/w adapters used on a
> remote
> SQL 2000 Server without actually logging onto that box and going to My
> Network Place and so on.. Want to be able to do it remotely
> Thanks
>|||"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:uDDrKNn0EHA.2016@.TK2MSFTNGP15.phx.gbl...
> Is there any command I can use to find out the n/w adapters used on a
remote
> SQL 2000 Server without actually logging onto that box and going to My
> Network Place and so on.. Want to be able to do it remotely
>
You can try doing an xp_cmdshell ('ipconfig /all') and capturing the results
to a table.
> Thanks
>

Find N/w adapters remotely

Is there any command I can use to find out the n/w adapters used on a remote
SQL 2000 Server without actually logging onto that box and going to My
Network Place and so on.. Want to be able to do it remotely
ThanksYou can run mmc, add the Device Manager snap-in, point it at your remote
server and have a look at the Network Adapters section to find out what
adapters you're using on that box. Not exactly a cmdline but you don't have
to start a full TS session on your remote server.
HTH.
Cheers,
Mike
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:uDDrKNn0EHA.2016@.TK2MSFTNGP15.phx.gbl...
> Is there any command I can use to find out the n/w adapters used on a
> remote
> SQL 2000 Server without actually logging onto that box and going to My
> Network Place and so on.. Want to be able to do it remotely
> Thanks
>|||"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:uDDrKNn0EHA.2016@.TK2MSFTNGP15.phx.gbl...
> Is there any command I can use to find out the n/w adapters used on a
remote
> SQL 2000 Server without actually logging onto that box and going to My
> Network Place and so on.. Want to be able to do it remotely
>
You can try doing an xp_cmdshell ('ipconfig /all') and capturing the results
to a table.

> Thanks
>

Find N/w adapters remotely

Is there any command I can use to find out the n/w adapters used on a remote
SQL 2000 Server without actually logging onto that box and going to My
Network Place and so on.. Want to be able to do it remotely
Thanks
You can run mmc, add the Device Manager snap-in, point it at your remote
server and have a look at the Network Adapters section to find out what
adapters you're using on that box. Not exactly a cmdline but you don't have
to start a full TS session on your remote server.
HTH.
Cheers,
Mike
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:uDDrKNn0EHA.2016@.TK2MSFTNGP15.phx.gbl...
> Is there any command I can use to find out the n/w adapters used on a
> remote
> SQL 2000 Server without actually logging onto that box and going to My
> Network Place and so on.. Want to be able to do it remotely
> Thanks
>
|||"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:uDDrKNn0EHA.2016@.TK2MSFTNGP15.phx.gbl...
> Is there any command I can use to find out the n/w adapters used on a
remote
> SQL 2000 Server without actually logging onto that box and going to My
> Network Place and so on.. Want to be able to do it remotely
>
You can try doing an xp_cmdshell ('ipconfig /all') and capturing the results
to a table.

> Thanks
>