Showing posts with label names. Show all posts
Showing posts with label names. Show all posts

Friday, March 23, 2012

Have Svr name, need DBs

Hello Folks!
I have a bunch of servers, actually there are about 340.
I have the names of the servers but what I'd like to do is loop through
the servers and return all the databases on those servers.
I'd also like to find out how busy the servers are.
Got any ideas?
Thanks-In-AdvanceI wrote an SMO application for that. If you are interested, I can send
this to you. Though this is not yet perfect, it evaluates from the
needs of the community Just write me an email and I will share it. It
will eb additionally available on http://www.SQLServer2005.de (When the
site will be relaunched) soon.
HTH, Jens Suessmeyer.|||Jens, please send me the file, my email address is Bob@.BobSweeney.Net
Also, what is an SMO application? Am I supposed to know what that
acronym is?|||Assuming that you have an account that has the appropriate login and
permissions, put the names of all the servers in a text file with one on eac
h
line and run
for /F "tokens=1" %i in (servers.txt) do osql -S %i -E -Q
"sp_helpdb">>output.txt
The file output.txt will have have the listing of all the DBs on all the
servers.
For seeing how busy they are, use Performance Monitor (I think it's just
called "Performance" now) logs, or tool like MRTG.
If you posted to this forum through TechNet, and you found my answers
helpful, please mark them as answers.
"Bob" wrote:

> Hello Folks!
> I have a bunch of servers, actually there are about 340.
> I have the names of the servers but what I'd like to do is loop through
> the servers and return all the databases on those servers.
> I'd also like to find out how busy the servers are.
> Got any ideas?
> Thanks-In-Advance
>|||Slightly cleaner output:
for /F "tokens=1" %i in (servers.txt) do osql -S %i -d "master" -E -Q
"select @.@.SERVERNAME UNION ALL select catalog_name from
information_schema.schemata"
"Mark Williams" wrote:
> Assuming that you have an account that has the appropriate login and
> permissions, put the names of all the servers in a text file with one on e
ach
> line and run
> for /F "tokens=1" %i in (servers.txt) do osql -S %i -E -Q
> "sp_helpdb">>output.txt
> The file output.txt will have have the listing of all the DBs on all the
> servers.
> For seeing how busy they are, use Performance Monitor (I think it's just
> called "Performance" now) logs, or tool like MRTG.
> --
> If you posted to this forum through TechNet, and you found my answers
> helpful, please mark them as answers.
>
> "Bob" wrote:
>sql

Wednesday, March 7, 2012

Hard coding colum names in returned DetailsView table

Hi all,

We're selecting data from our database, FirstName, LastName, MobileNumber etc.

We're using the detaials view function to return it in a table upon selection. However all of the variables are returned as they are in the database, ie:without spaces.

We tried putting in spaces by selecting "AS what ever", but MSSQL does not seem to like spaces.

Any ideas?

Thanks

Hey,

Are you trying to make the column names have spaces, or the data/ If the first, try using:

AS "First Name"

OR

AS [First Name]

|||

You can rename the columns like this:

SELECT PhoneNumber AS [Phone Number]
FROM TestTable

Monday, February 27, 2012

Handling UNC path names

What is the best handling of a UNC Pathname?

What is the max length of a path name?
Which is the best type of field in SQL Server to use for a path name?

Thanks

I would store this in a VARCHAR field with the appropiate value.

HTH, Jens Suessmeyer,

|||

What is the max length of the path & filename? It used to be 255 chars but I believe it has grown since then.

|||

Maximum name of a UNC path is 260 unicode characters (MAX_PATH defined in windows.h I believe). Search google for MAX_PATH to see lots of people talking about this issue.

So a NVARCHAR(260) should be sufficient unless you allow the \\?\ prefix that bypasses normal MAX_PATH length. If you only have one locale you use for paths, then you can potentially use VARCHAR(260).