Showing posts with label databases. Show all posts
Showing posts with label databases. Show all posts
Friday, March 30, 2012
How to get two different SQL servers to talk to one another
Hi all I need to create a view for another sql server on the network.
I can create a view for two to databases on the same sql server to talk but how do you do it for a differend sql server??
CREATE VIEW dbo.Revocations_View
AS
SELECT TM#, LastName, FirstName, MI, SSN, [I/R #], Date, ReasonofRevocation, Notes, Termination, Conditional, WasEmployeeFined, LicenseSuspension,
Status
FROM LicensingActions.dbo.Revocations_TblUse sp_addlinkedserver (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_sp_adda_8gqa.asp) to put the servers on "speaking terms" with each other. In a secured network, you may have to deal with Security Account Delegation (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_security_2gmm.asp). After you've resolved that, you need to use four part names (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/acdata/ac_8_qd_12_5vvp.asp) and you're in business.
-PatP|||thanks pat thats exaclty what I need
appreciate it :)|||a fine meal and big bottle of wine outta do it. could'nt resist.
I can create a view for two to databases on the same sql server to talk but how do you do it for a differend sql server??
CREATE VIEW dbo.Revocations_View
AS
SELECT TM#, LastName, FirstName, MI, SSN, [I/R #], Date, ReasonofRevocation, Notes, Termination, Conditional, WasEmployeeFined, LicenseSuspension,
Status
FROM LicensingActions.dbo.Revocations_TblUse sp_addlinkedserver (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_sp_adda_8gqa.asp) to put the servers on "speaking terms" with each other. In a secured network, you may have to deal with Security Account Delegation (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_security_2gmm.asp). After you've resolved that, you need to use four part names (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/acdata/ac_8_qd_12_5vvp.asp) and you're in business.
-PatP|||thanks pat thats exaclty what I need
appreciate it :)|||a fine meal and big bottle of wine outta do it. could'nt resist.
Monday, March 26, 2012
How to get the OS Version
Hey guys,
My team supports databases on about 75 different servers. I would like to know what OS Version is running on those server. I have done some research and I know I can use the following three methods:
1. master..xp_msver
or
2. master..xp_cmdshell 'netsh diag SHOW os /p'
or
3. select right(@.@.version, 44)
are there any other options out there? Option 2 gives me the output I would like, but takes a long time to return the result:
i.e.
Microsoft(R) Windows(R) Server 2003, Standard Edition
5.2.3790
xp_msver and @.@.version gives me the info, but not quite in the format I would like:
5.2 (3790)
and
Windows NT 5.2 (Build 3790: Service Pack 1)
Are there any other options out there?
Thanks,
ReghardtIs this a one time gathering of statistics, or an ongoing thing/ If you have SMS on your network, you can query some of their views much more effectively.|||It will be an ongoing thing, and yes we do have SMS. Thanks for the advice I have to remember to sometimes think outside the box.
My team supports databases on about 75 different servers. I would like to know what OS Version is running on those server. I have done some research and I know I can use the following three methods:
1. master..xp_msver
or
2. master..xp_cmdshell 'netsh diag SHOW os /p'
or
3. select right(@.@.version, 44)
are there any other options out there? Option 2 gives me the output I would like, but takes a long time to return the result:
i.e.
Microsoft(R) Windows(R) Server 2003, Standard Edition
5.2.3790
xp_msver and @.@.version gives me the info, but not quite in the format I would like:
5.2 (3790)
and
Windows NT 5.2 (Build 3790: Service Pack 1)
Are there any other options out there?
Thanks,
ReghardtIs this a one time gathering of statistics, or an ongoing thing/ If you have SMS on your network, you can query some of their views much more effectively.|||It will be an ongoing thing, and yes we do have SMS. Thanks for the advice I have to remember to sometimes think outside the box.
Monday, March 19, 2012
How to get server name and databases name from a server using SQL Command...
can anyone tell me
How to get server name and databases name from a server using SQL Command...
i m using sql server 2000(T-SQL)
Use @.@.SERVERNAME to find the server name -
select @.@.SERVERNAME
& this to find the current database name -
select db_name()
thanks....
Monday, March 12, 2012
how to get rid of free db spaces on sql sever 7
I have a SQL Server 7 and after I shrank one of the databases, I got 14 gb of
free spaces. How to get rid of the extra free spaces on Version 7 of SQL
Server environment?DBCC SHRINKDATABASE or DBCC SHRINKFILE
With version 7.0, however, you will have a heck of a time shrinking the log
file. If you can not get it to shrink as far as you would like, detach the
database, then move the log file somewhere else, and use the
sp_attach_single_file_db. This should regenerate a new log file, but using
the model database as a template instead of the old one.
Sincerely,
Anthony Thomas
"GR" wrote:
> I have a SQL Server 7 and after I shrank one of the databases, I got 14 gb of
> free spaces. How to get rid of the extra free spaces on Version 7 of SQL
> Server environment?
>
free spaces. How to get rid of the extra free spaces on Version 7 of SQL
Server environment?DBCC SHRINKDATABASE or DBCC SHRINKFILE
With version 7.0, however, you will have a heck of a time shrinking the log
file. If you can not get it to shrink as far as you would like, detach the
database, then move the log file somewhere else, and use the
sp_attach_single_file_db. This should regenerate a new log file, but using
the model database as a template instead of the old one.
Sincerely,
Anthony Thomas
"GR" wrote:
> I have a SQL Server 7 and after I shrank one of the databases, I got 14 gb of
> free spaces. How to get rid of the extra free spaces on Version 7 of SQL
> Server environment?
>
how to get rid of free db spaces on sql sever 7
I have a SQL Server 7 and after I shrank one of the databases, I got 14 gb o
f
free spaces. How to get rid of the extra free spaces on Version 7 of SQL
Server environment?DBCC SHRINKDATABASE or DBCC SHRINKFILE
With version 7.0, however, you will have a heck of a time shrinking the log
file. If you can not get it to shrink as far as you would like, detach the
database, then move the log file somewhere else, and use the
sp_attach_single_file_db. This should regenerate a new log file, but using
the model database as a template instead of the old one.
Sincerely,
Anthony Thomas
"GR" wrote:
> I have a SQL Server 7 and after I shrank one of the databases, I got 14 gb
of
> free spaces. How to get rid of the extra free spaces on Version 7 of SQL
> Server environment?
>
f
free spaces. How to get rid of the extra free spaces on Version 7 of SQL
Server environment?DBCC SHRINKDATABASE or DBCC SHRINKFILE
With version 7.0, however, you will have a heck of a time shrinking the log
file. If you can not get it to shrink as far as you would like, detach the
database, then move the log file somewhere else, and use the
sp_attach_single_file_db. This should regenerate a new log file, but using
the model database as a template instead of the old one.
Sincerely,
Anthony Thomas
"GR" wrote:
> I have a SQL Server 7 and after I shrank one of the databases, I got 14 gb
of
> free spaces. How to get rid of the extra free spaces on Version 7 of SQL
> Server environment?
>
how to get rid of free db spaces on sql sever 7
I have a SQL Server 7 and after I shrank one of the databases, I got 14 gb of
free spaces. How to get rid of the extra free spaces on Version 7 of SQL
Server environment?
DBCC SHRINKDATABASE or DBCC SHRINKFILE
With version 7.0, however, you will have a heck of a time shrinking the log
file. If you can not get it to shrink as far as you would like, detach the
database, then move the log file somewhere else, and use the
sp_attach_single_file_db. This should regenerate a new log file, but using
the model database as a template instead of the old one.
Sincerely,
Anthony Thomas
"GR" wrote:
> I have a SQL Server 7 and after I shrank one of the databases, I got 14 gb of
> free spaces. How to get rid of the extra free spaces on Version 7 of SQL
> Server environment?
>
free spaces. How to get rid of the extra free spaces on Version 7 of SQL
Server environment?
DBCC SHRINKDATABASE or DBCC SHRINKFILE
With version 7.0, however, you will have a heck of a time shrinking the log
file. If you can not get it to shrink as far as you would like, detach the
database, then move the log file somewhere else, and use the
sp_attach_single_file_db. This should regenerate a new log file, but using
the model database as a template instead of the old one.
Sincerely,
Anthony Thomas
"GR" wrote:
> I have a SQL Server 7 and after I shrank one of the databases, I got 14 gb of
> free spaces. How to get rid of the extra free spaces on Version 7 of SQL
> Server environment?
>
Friday, March 9, 2012
How to get Recovery Model of a SQL 2000 Database?
Hi ,
Can somebody help with an SQL Statement to list the Recovery models for
all the Databases in a server. I am trying to use the status column from sysdatabases..but i am not able to get the right statement.
Any help/references asap...
Thanks in advance.
Sasi.For SQL 2000
select name, databasepropertyex(name, 'Recovery') as RecoveryModel from master.dbo.sysdatabases order by name
For SQL 2005...
select name, recovery_model, recovery_model_desc from master.sys.databases
Good luck with it...
Wednesday, March 7, 2012
How to get names of all databases using sql statements?
How can i get names of all databases using sql statements or system stored procedures? Thanks in advance!How can i get names of all databases using sql statements or system stored procedures? Thanks in advance!
try this:
select name from master..sysdatabases|||I tried and the result is very good. Thanks a lot
try this:
select name from master..sysdatabases|||I tried and the result is very good. Thanks a lot
Subscribe to:
Posts (Atom)