Viewing 15 posts - 46 through 60 (of 61 total)
Try this one:
select o.name as sp_name,
(len(c.text) - len(replace(c.text, char(10),''))) as lines_of_code,
case when o.xtype = 'P' then 'Stored Procedure'
when o.xtype in ('FN', 'IF', 'TF') then 'Function'
end as type_desc
from sysobjects o
inner join...
April 12, 2011 at 6:52 am
This script will add the user to each DB, but you must have the Login created first.
It will add the user as a db_datareader role.
sp_msforeachdb 'use [?]; CREATE USER [MyDBUser]...
April 11, 2011 at 2:25 pm
Hi,
First, you must make sure that you have [Login Auditing] turned at least for "Successful logins".
If you do not, then run the script below to turn it for for "Both...
April 11, 2011 at 2:07 pm
Follow these steps and you will accomplish what you need:
Step 1)
USE master
GO
--Create a Linked server on the SQL 2005 that points to the SQL 2008'
EXEC master.dbo.sp_addlinkedserver @server =...
April 11, 2011 at 1:36 pm
If you are using SQL Server 2000 here are some views and tables you can query:
SELECT * FROM sysindexes
SELECT * FROM INFORMATION_SCHEMA.tables
SELECT * FROM INFORMATION_SCHEMA.VIEWS
You can also use the [sysobjects]...
April 11, 2011 at 1:20 pm
You should use the sp_helpdb
Stored Procedure
you can pass parameters if you want a specific databases.
i.e. sp_helpdb 'master'
April 11, 2011 at 11:37 am
We have done that in the past and to be honest, there are a lot of things you have to do.
I do not remember the exact list of steps, but...
April 11, 2011 at 11:28 am
You can use the sp_helpdb stored procedure or query the sys.databases system table
sp_helpdb 'master'
GO
SELECT * FROM sys.databases WHERE name ='master'
GO
April 11, 2011 at 11:00 am
IsNull function only replaces data where the value is null, but it does not handle when there is no data.
For that you need something like this:
IF NOT EXISTS ( SELECT...
April 11, 2011 at 10:06 am
Try this code,
I use it to list of the members of a specific AD group or distribution list.
You can modify to display the fields you want.
EXEC master.dbo.sp_addlinkedserver @server...
April 11, 2011 at 9:58 am
The function "DAY" will return the day of the month, not the weekday. This will not help you determine whether the day is Monday or Thursday, etc.
You have you use...
April 11, 2011 at 9:42 am
A view is a select statement from one or many tables.
When you query the view, the SQL Query optimizer chooses the best execution plan based on the least cost.
So, if...
April 11, 2011 at 9:21 am
Hi mashikoo,
First and foremost, you cannot convert a stand alone instance into a cluster one.
Here is my recommendation:
1) Backup your databases and take SQL Server offline
2) Make sure that you...
April 8, 2011 at 11:35 am
Hi,
You can simply create a loop that can iterate through all the different dates.
You can find more documentation on MS website. http://msdn.microsoft.com/en-us/library/ms178642.aspx
Please let me know if that works...
April 8, 2011 at 11:21 am
Hi Grace,
It does not matter that your unique index is a combination of many columns,
you can update any of the columns as long as your update does not violate the...
April 8, 2011 at 9:08 am
Viewing 15 posts - 46 through 60 (of 61 total)