Viewing 15 posts - 256 through 270 (of 358 total)
When I hear Archive it makes me think you do not want to overwite the data in the Archive database, you just want to add to it. If you...
July 11, 2008 at 10:33 pm
You have to create a temp table with the new schema. Insert the data from the current table. Delete the current table and then rename the temp table...
July 11, 2008 at 10:14 pm
sa is not listed in the table and the Where clause is filtering out the Roles.
July 11, 2008 at 9:04 pm
Can you use this?
DECLARE @LastMonDay_date DateTime
Set @LastMonDay_date =
CONVERT(varchar(10),dateadd(day, case(datename(weekday,GETDATE()))
when 'Monday' then 0
when...
July 11, 2008 at 9:16 am
You can replace the CTE with a derived table.
SELECT
CAST(su.name AS sysname) COLLATE Latin1_General_CI_AS AS [Orphaned User],
NbrOfObjects
FROM sysusers su JOIN
(select count(*) NbrOfObjects, b.name
...
July 11, 2008 at 9:08 am
How about something like this.
WITH UserObjects
AS
(
select count(*) NbrOfObjects, b.name
from sysobjects a,
sysusers b
where a.uid = b.uid
group by b.name
)
SELECT
CAST(su.name AS sysname) COLLATE Latin1_General_CI_AS AS...
July 11, 2008 at 8:51 am
You will have to post the query. It could be a number of things.
July 11, 2008 at 6:51 am
You can use any, but you would have to do it like this.
Declare @Val1 int
Declare @Val2 int
Declare @Val3 int
Declare @Val4 int
Declare @Val5 int
Set @Val1 = 1
Set @Val2 = 1
Set @Val3...
July 10, 2008 at 10:01 pm
They are automatically created.
dbo
guest
INFORMATION_SCHEMA
sys
July 10, 2008 at 9:46 pm
I know you said you did not wan to write an awful case statement, but if the values are coming from database fields you could do something like this.
Declare @Val1...
July 10, 2008 at 8:27 pm
It depends on your list. Is it a string or does each value come from a field?
Here is a way to get it if the list is a concatenated...
July 10, 2008 at 8:01 pm
Yes. I should have clarified that in the first post. It is the number of database users not the current number of users connected.
July 10, 2008 at 5:54 pm
It is using the following query.
Use DatabaseName
GO
SELECT
u.name AS [Name]
FROM
sys.database_principals AS u
WHERE
(u.type in ('U', 'S', 'G', 'C', 'K'))
July 10, 2008 at 5:45 pm
It depends on how they are capturing the output. They may not be expecting an output parameter.
July 10, 2008 at 5:39 pm
The first line in the last query needs a name.
select ((left(pa.keycode, 1)) + cast(sum(cast(substring(pa.keycode,2,3) as int)) as varchar(5))) AS SomeName
The first query sets the variable @keycode, but I do not...
July 10, 2008 at 5:23 pm
Viewing 15 posts - 256 through 270 (of 358 total)