Showing posts with label somebody. Show all posts
Showing posts with label somebody. Show all posts

Thursday, March 29, 2012

Can we encrypt the whole DataBase in Sql Server 2005.

Hi,
I am new to Sql Server. I wanted to know can I encrypt the whole
DataBase in Sql Server 2005. If yes, can somebody guide me step by step
to this. I searched a lot on net. But of no use, as the only help
available is to encrypt columns in the table.
Thanks and Regards
Nitin Verma.SQL 2005 supports column level encryption. So you could encrypt ever
column, but I would not advise it. Check out Laurentiu Cristofor's
blog for some GREAT info on 2005 encryption
(http://blogs.msdn.com/lcris/default.aspx)
Jim Youmans
DBA
St Louis, Missouri
nitinv wrote:
> Hi,
> I am new to Sql Server. I wanted to know can I encrypt the whole
> DataBase in Sql Server 2005. If yes, can somebody guide me step by step
> to this. I searched a lot on net. But of no use, as the only help
> available is to encrypt columns in the table.
> Thanks and Regards
> Nitin Verma.|||In a situation with a need for extreme security, EFS could be used (unless
using a clustered server.)
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"Jim Youmans" <jdyoumans@.gmail.com> wrote in message
news:1154354782.895003.215230@.i42g2000cwa.googlegroups.com...
> SQL 2005 supports column level encryption. So you could encrypt ever
> column, but I would not advise it. Check out Laurentiu Cristofor's
> blog for some GREAT info on 2005 encryption
> (http://blogs.msdn.com/lcris/default.aspx)
> Jim Youmans
> DBA
> St Louis, Missouri
>
> nitinv wrote:
>|||Thanks Jim, for your advice. Atleast I am now sure that SQL Server 2005
does not support DataBase Level Encrytion. I will look for other
options now.
Jim Youmans wrote:
[vbcol=seagreen]
> SQL 2005 supports column level encryption. So you could encrypt ever
> column, but I would not advise it. Check out Laurentiu Cristofor's
> blog for some GREAT info on 2005 encryption
> (http://blogs.msdn.com/lcris/default.aspx)
> Jim Youmans
> DBA
> St Louis, Missouri
>
> nitinv wrote:|||Arnie, I appreciate your advice, but if I use EFS, will my Sql Server
be able to read the files in the folder, which has been encrypted.
I guess that it loads the Database files, but shows the Database as
suspected.
May be you could throw some more light on it.|||I have used EFS for database storage and backup file locations. The key is
that the SQL Server Service Account MUST own the EFS folder(s).
When setting this up, I log in as the service account, create the EFS
folder(s), COPY any existing databases to the location (Keep copies until I
am sure that the process went smoothly. Then attach the database.
Usually all goes well.
But if clustering is used, when the cluster fails over, there is problem
with key transfer. So I do not recommend EFS with Clustering.
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"Nitin Verma" <nitin.verma.in@.gmail.com> wrote in message
news:1154410210.573642.61620@.i42g2000cwa.googlegroups.com...
> Arnie, I appreciate your advice, but if I use EFS, will my Sql Server
> be able to read the files in the folder, which has been encrypted.
> I guess that it loads the Database files, but shows the Database as
> suspected.
> May be you could throw some more light on it.
>|||Thanks Arnie,
I hope it works.
Arnie Rowland wrote:
[vbcol=seagreen]
> I have used EFS for database storage and backup file locations. The key is
> that the SQL Server Service Account MUST own the EFS folder(s).
> When setting this up, I log in as the service account, create the EFS
> folder(s), COPY any existing databases to the location (Keep copies until
I
> am sure that the process went smoothly. Then attach the database.
> Usually all goes well.
> But if clustering is used, when the cluster fails over, there is problem
> with key transfer. So I do not recommend EFS with Clustering.
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
>
> "Nitin Verma" <nitin.verma.in@.gmail.com> wrote in message
> news:1154410210.573642.61620@.i42g2000cwa.googlegroups.com...

Friday, February 24, 2012

Can somebody tell me what is wrong with this?

I am trying to created a view and have a need for conditional logic:

Here is what I presently have (not working):
-----------------------
IF (ISDATE(COMPLETIONDATE) = 1)
BEGIN
CASE
WHEN DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) > (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') THEN 'GREEN'
WHEN DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) < (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') AND DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) > 0 THEN 'YELLOW'
WHEN DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) < 0 THEN 'RED'
END AS THRESHOLDSTATUS
END
ELSE
IF (ISDATE(COMPLETIONDATE) = 0)
BEGIN
CASE
WHEN DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) > (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') THEN 'GREEN'
WHEN DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) < (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') AND DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) > 0 THEN 'YELLOW'
WHEN DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) < 0 THEN 'RED'
END AS THRESHOLDSTATUS
END
-----------------------

Can someone tell me what I am doing wrong?

Basically I am trying to test to see if "completiondate" is a date and if it is then perform a case operation using it, if it is not a date then I want to perform the case operation using "targetcompletiondate".

Thanks...select THRESHOLDSTATUS =
CASE
WHEN DATEDIFF(d, case when ISDATE(COMPLETIONDATE) = 1 then COMPLETIONDATE else TARGETCOMPLETIONDATE end, RESET.RESET_UNIT.MCD) > (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') THEN 'GREEN'
WHEN DATEDIFF(d, case when ISDATE(COMPLETIONDATE) = 1 then COMPLETIONDATE else TARGETCOMPLETIONDATE end, RESET.RESET_UNIT.MCD) < (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') AND DATEDIFF(d, case when ISDATE(COMPLETIONDATE) = 1 then COMPLETIONDATE else TARGETCOMPLETIONDATE end, RESET.RESET_UNIT.MCD) > 0 THEN 'YELLOW'
WHEN DATEDIFF(d, case when ISDATE(COMPLETIONDATE) = 1 then COMPLETIONDATE else TARGETCOMPLETIONDATE end, RESET.RESET_UNIT.MCD) < 0 THEN 'RED'
END
from ...|||First problem: You have a column called "CompletionDate" which may contain something that is NOT A DATE?!?! That's a design issue right there...

Second problem: You are putting this in a VIEW? Complex logic such as this is better off in a stored procedure. You didn't provide your entire CREATE VIEW statement, but depending upon what you are trying to do, your task may not be possible.

You may be able to use nested CASE statements:
CASE WHEN ISDATE(COMPLETIONDATE) = 1
CASE WHEN DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) > (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') THEN 'GREEN'
WHEN DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) < (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') AND DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) > 0 THEN 'YELLOW'
WHEN DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) < 0 THEN 'RED'
END
ELSE
CASE WHEN DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) > (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') THEN 'GREEN'
WHEN DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) < (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE') AND DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) > 0 THEN 'YELLOW'
WHEN DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) < 0 THEN 'RED'
END
END AS THRESHOLDSTATUS

...or a single CASE statement with more complex criteria:
CASE
WHEN ISDATE(COMPLETIONDATE) = 1 AND (DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) > (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE')) THEN 'GREEN'
WHEN ISDATE(COMPLETIONDATE) = 1 AND (DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) < (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE')) AND (DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) > 0) THEN 'YELLOW'
WHEN ISDATE(COMPLETIONDATE) = 1 AND (DATEDIFF(d, COMPLETIONDATE, RESET.RESET_UNIT.MCD) < 0 THEN 'RED'
WHEN ISDATE(COMPLETIONDATE) = 0 AND (DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) > (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE')) THEN 'GREEN'
WHEN ISDATE(COMPLETIONDATE) = 0 AND (DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) < (SELECT GREEN FROM RESET.THRESHOLDS WHERE TYPE = 'SCHEDULE')) AND (DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) > 0) THEN 'YELLOW'
WHEN ISDATE(COMPLETIONDATE) = 0 AND (DATEDIFF(d, TARGETCOMPLETIONDATE, RESET.RESET_UNIT.MCD) < 0 THEN 'RED'
END AS THRESHOLDSTATUS|||I thought that that's what I gave the poster...?|||Yeah, you sniped me by 10 minutes. So you get kudos for being first, but I get points for verbosity!

can somebody please help me with my query?

Hi I'm creating a macro to show how many times a user has logged into our database within a month. The output should look like this :

Name

Kit
Peter
Jeny
Katie
Patricia

Last Login date
Dec 28 2004 07:12AM
Dec 28 2004 09:30AM
Dec 27 2004 10:23AM
Dec 28 2004 10:38AM
Dec 27 2004 10:30AM

Login count
12/26/04
0
0
1
0
0

Login count
12/27/04
1
0
1
1
1

Login count
12/28/04
1
1
0
1
0

Right now my query reflects Name, last login date and the current day login count:

Select a.username, a.login_dt, CASE WHEN
a.isactive = 1 and a.login_dt = current_date() THEN 1
ELSE 0
END
from cms.dbo.usagelog a, cms.dbo.sys_user c
where a.userid = c.user_id and c.group2 IN ('DIS', 'MD', 'PC', 'SYS')
ORDER BY c.group2, a.login_dt, a.username

and this is the OUTPUT:
Name

Kit
Peter
Jeny
Katie
Patricia

Last LOGIN Date
Dec 28 2004 07:12AM
Dec 28 2004 09:30AM
Dec 27 2004 10:23AM
Dec 28 2004 10:38AM
Dec 27 2004 10:30AM

Login COUNT 12/28/04 (CURRENT DAY)
1
1
0
1
0

Can somebody please show me how i can do a loop or an iteration inside my query and get it to show the current day's data and all the data from the previous days (ex. 12/23, 12/24, 12/25, 12/26, 12/27) .You could try using 'GROUP BY':
Select A.Username, A.Login_Dt, Count(*) As Login_Times
From Cms.Dbo.Usagelog A, Cms.Dbo.Sys_User C
Where A.Userid = C.User_Id And C.Group2 In ('Dis', 'Md', 'Pc', 'Sys')
Group By A.Username, A.Login_Dt
Order By C.Group2, A.Username, A.Login_Dt :D|||LKBrwn_DBA, i don't think you can ORDER BY a column in a GROUP BY query if that column isn't in the SELECT list|||LKBrwn_DBA, i don't think you can ORDER BY a column in a GROUP BY query if that column isn't in the SELECT list
True, I kind'a just copied over the ORDER BY ... should have looked more closely.
:o

can somebody help my optimise my code please

Hi

I have the following SQL, which I am using to query our mainframe (some kind of IBM DB2 type thing)
Basically there are two tables joined by account number. One contains info about the customer, and the other contains details about transactions that have happened for each month. I am trying to get the total spend for last month and the month before. (I know I am not using anything from the CUS_ACC table at the mo, but I will need to)

SELECT PROD.CUST_ACC_NUM, Sum(SPEND) AS SUMSPEND, STMT_MONTH, STMT_YEAR
FROM PROD INNER JOIN CUST_ACC ON PROD.CUST_ACC_NUM=CUST_ACC.CUST_ACC_NUM

WHERE PROD.CUST_ACC_NUM=630822
And
(
(STMT_MONTH=Month(DateAdd("m",-1,Date())) And STMT_YEAR=Year(DateAdd("m",-1,Date())))
Or
(STMT_MONTH=Month(DateAdd("m",-2,Date())) And STMT_YEAR=Year(DateAdd("m",-2,Date())))
)
GROUP BY PROD.CUST_ACC_NUM, STMT_MONTH, STMT_YEAR;

now, as the query is at the moment, it takes tens of minutes to run for a single account (I will have to do it for about 3,000 accounts). However, if remove the line that starts with 'OR' and the line below it (i.e. only get last months sales) it runs in seconds.

Any ideas why?
Thanks
Kevinforget it, its working at full speed. hmmmmmm, very very strange

Can somebody find where it fails, please?

Microsoft (R) SQLMaint Utility (Unicode), Version Logged on to SQL Server
'PAC_APPS2' as 'PAC01\Administrator' (trusted)
Starting maintenance plan 'DB Maintenance Plan_weekly' on 5/27/2007 2:00:01 AM
[1] Database IER: Database Backup...
Destination:
[E:\MSSQLSERVER\DATA\MSSQL\BACKUP\IER\IER_db_20070 5270200.BAK]
** Execution Time: 0 hrs, 0 mins, 3 secs **
[2] Database IER: Verifying Backup...
** Execution Time: 0 hrs, 0 mins, 2 secs **
[3] Database MCI: Database Backup...
[4] Database SR_PAC: Database Backup...
Destination:
[E:\MSSQLSERVER\DATA\MSSQL\BACKUP\SR_PAC\SR_PAC_db _200705270200.BAK]
** Execution Time: 0 hrs, 0 mins, 2 secs **
[5] Database SR_PAC: Verifying Backup...
** Execution Time: 0 hrs, 0 mins, 1 secs **
[6] Database Survey: Database Backup...
Destination:
[E:\MSSQLSERVER\DATA\MSSQL\BACKUP\Survey\Survey_db _200705270200.BAK]
** Execution Time: 0 hrs, 0 mins, 2 secs **
[7] Database Survey: Verifying Backup...
** Execution Time: 0 hrs, 0 mins, 2 secs **
[8] Database ServiceReq: Database Backup...
[9] Database whosnext: Database Backup...
Deleting old text reports... 1 file(s) deleted.
End of maintenance plan 'DB Maintenance Plan_weekly' on 5/27/2007 2:00:34 AM
SQLMAINT.EXE Process Exit Code: 1 (Failed)
Hi Dave
"Dave" wrote:

> Microsoft (R) SQLMaint Utility (Unicode), Version Logged on to SQL Server
> 'PAC_APPS2' as 'PAC01\Administrator' (trusted)
> Starting maintenance plan 'DB Maintenance Plan_weekly' on 5/27/2007 2:00:01 AM
> [1] Database IER: Database Backup...
> Destination:
> [E:\MSSQLSERVER\DATA\MSSQL\BACKUP\IER\IER_db_20070 5270200.BAK]
> ** Execution Time: 0 hrs, 0 mins, 3 secs **
> [2] Database IER: Verifying Backup...
> ** Execution Time: 0 hrs, 0 mins, 2 secs **
> [3] Database MCI: Database Backup...
> [4] Database SR_PAC: Database Backup...
> Destination:
> [E:\MSSQLSERVER\DATA\MSSQL\BACKUP\SR_PAC\SR_PAC_db _200705270200.BAK]
> ** Execution Time: 0 hrs, 0 mins, 2 secs **
> [5] Database SR_PAC: Verifying Backup...
> ** Execution Time: 0 hrs, 0 mins, 1 secs **
> [6] Database Survey: Database Backup...
> Destination:
> [E:\MSSQLSERVER\DATA\MSSQL\BACKUP\Survey\Survey_db _200705270200.BAK]
> ** Execution Time: 0 hrs, 0 mins, 2 secs **
> [7] Database Survey: Verifying Backup...
> ** Execution Time: 0 hrs, 0 mins, 2 secs **
> [8] Database ServiceReq: Database Backup...
> [9] Database whosnext: Database Backup...
> Deleting old text reports... 1 file(s) deleted.
> End of maintenance plan 'DB Maintenance Plan_weekly' on 5/27/2007 2:00:34 AM
> SQLMAINT.EXE Process Exit Code: 1 (Failed)
None of the steps seems to have failed, so it may be the job notifications
that are causing the problem! Have you checked the SQL Server Error Log for
any messages?
John
|||Thanks, I will check that
-Dave
"John Bell" wrote:

> Hi Dave
> "Dave" wrote:
>
> None of the steps seems to have failed, so it may be the job notifications
> that are causing the problem! Have you checked the SQL Server Error Log for
> any messages?
> John

Can somebody find where it fails, please?

Microsoft (R) SQLMaint Utility (Unicode), Version Logged on to SQL Server
'PAC_APPS2' as 'PAC01\Administrator' (trusted)
Starting maintenance plan 'DB Maintenance Plan_weekly' on 5/27/2007 2:00:01 AM
[1] Database IER: Database Backup...
Destination:
[E:\MSSQLSERVER\DATA\MSSQL\BACKUP\IER\IER_db_200705270200.BAK]
** Execution Time: 0 hrs, 0 mins, 3 secs **
[2] Database IER: Verifying Backup...
** Execution Time: 0 hrs, 0 mins, 2 secs **
[3] Database MCI: Database Backup...
[4] Database SR_PAC: Database Backup...
Destination:
[E:\MSSQLSERVER\DATA\MSSQL\BACKUP\SR_PAC\SR_PAC_db_200705270200.BAK]
** Execution Time: 0 hrs, 0 mins, 2 secs **
[5] Database SR_PAC: Verifying Backup...
** Execution Time: 0 hrs, 0 mins, 1 secs **
[6] Database Survey: Database Backup...
Destination:
[E:\MSSQLSERVER\DATA\MSSQL\BACKUP\Survey\Survey_db_200705270200.BAK]
** Execution Time: 0 hrs, 0 mins, 2 secs **
[7] Database Survey: Verifying Backup...
** Execution Time: 0 hrs, 0 mins, 2 secs **
[8] Database ServiceReq: Database Backup...
[9] Database whosnext: Database Backup...
Deleting old text reports... 1 file(s) deleted.
End of maintenance plan 'DB Maintenance Plan_weekly' on 5/27/2007 2:00:34 AM
SQLMAINT.EXE Process Exit Code: 1 (Failed)Hi Dave
"Dave" wrote:
> Microsoft (R) SQLMaint Utility (Unicode), Version Logged on to SQL Server
> 'PAC_APPS2' as 'PAC01\Administrator' (trusted)
> Starting maintenance plan 'DB Maintenance Plan_weekly' on 5/27/2007 2:00:01 AM
> [1] Database IER: Database Backup...
> Destination:
> [E:\MSSQLSERVER\DATA\MSSQL\BACKUP\IER\IER_db_200705270200.BAK]
> ** Execution Time: 0 hrs, 0 mins, 3 secs **
> [2] Database IER: Verifying Backup...
> ** Execution Time: 0 hrs, 0 mins, 2 secs **
> [3] Database MCI: Database Backup...
> [4] Database SR_PAC: Database Backup...
> Destination:
> [E:\MSSQLSERVER\DATA\MSSQL\BACKUP\SR_PAC\SR_PAC_db_200705270200.BAK]
> ** Execution Time: 0 hrs, 0 mins, 2 secs **
> [5] Database SR_PAC: Verifying Backup...
> ** Execution Time: 0 hrs, 0 mins, 1 secs **
> [6] Database Survey: Database Backup...
> Destination:
> [E:\MSSQLSERVER\DATA\MSSQL\BACKUP\Survey\Survey_db_200705270200.BAK]
> ** Execution Time: 0 hrs, 0 mins, 2 secs **
> [7] Database Survey: Verifying Backup...
> ** Execution Time: 0 hrs, 0 mins, 2 secs **
> [8] Database ServiceReq: Database Backup...
> [9] Database whosnext: Database Backup...
> Deleting old text reports... 1 file(s) deleted.
> End of maintenance plan 'DB Maintenance Plan_weekly' on 5/27/2007 2:00:34 AM
> SQLMAINT.EXE Process Exit Code: 1 (Failed)
None of the steps seems to have failed, so it may be the job notifications
that are causing the problem! Have you checked the SQL Server Error Log for
any messages?
John|||Thanks, I will check that
-Dave
"John Bell" wrote:
> Hi Dave
> "Dave" wrote:
> >
> > Microsoft (R) SQLMaint Utility (Unicode), Version Logged on to SQL Server
> > 'PAC_APPS2' as 'PAC01\Administrator' (trusted)
> > Starting maintenance plan 'DB Maintenance Plan_weekly' on 5/27/2007 2:00:01 AM
> > [1] Database IER: Database Backup...
> > Destination:
> > [E:\MSSQLSERVER\DATA\MSSQL\BACKUP\IER\IER_db_200705270200.BAK]
> >
> > ** Execution Time: 0 hrs, 0 mins, 3 secs **
> >
> > [2] Database IER: Verifying Backup...
> >
> > ** Execution Time: 0 hrs, 0 mins, 2 secs **
> >
> > [3] Database MCI: Database Backup...
> > [4] Database SR_PAC: Database Backup...
> > Destination:
> > [E:\MSSQLSERVER\DATA\MSSQL\BACKUP\SR_PAC\SR_PAC_db_200705270200.BAK]
> >
> > ** Execution Time: 0 hrs, 0 mins, 2 secs **
> >
> > [5] Database SR_PAC: Verifying Backup...
> >
> > ** Execution Time: 0 hrs, 0 mins, 1 secs **
> >
> > [6] Database Survey: Database Backup...
> > Destination:
> > [E:\MSSQLSERVER\DATA\MSSQL\BACKUP\Survey\Survey_db_200705270200.BAK]
> >
> > ** Execution Time: 0 hrs, 0 mins, 2 secs **
> >
> > [7] Database Survey: Verifying Backup...
> >
> > ** Execution Time: 0 hrs, 0 mins, 2 secs **
> >
> > [8] Database ServiceReq: Database Backup...
> > [9] Database whosnext: Database Backup...
> > Deleting old text reports... 1 file(s) deleted.
> >
> > End of maintenance plan 'DB Maintenance Plan_weekly' on 5/27/2007 2:00:34 AM
> > SQLMAINT.EXE Process Exit Code: 1 (Failed)
> None of the steps seems to have failed, so it may be the job notifications
> that are causing the problem! Have you checked the SQL Server Error Log for
> any messages?
> John

Can somebody find where it fails, please?

Microsoft (R) SQLMaint Utility (Unicode), Version Logged on to SQL Server
'PAC_APPS2' as 'PAC01\Administrator' (trusted)
Starting maintenance plan 'DB Maintenance Plan_weekly' on 5/27/2007 2:00:01
AM
[1] Database IER: Database Backup...
Destination:
& #91;E:\MSSQLSERVER\DATA\MSSQL\BACKUP\IER
\IER_db_200705270200.BAK]
** Execution Time: 0 hrs, 0 mins, 3 secs **
[2] Database IER: Verifying Backup...
** Execution Time: 0 hrs, 0 mins, 2 secs **
[3] Database MCI: Database Backup...
[4] Database SR_PAC: Database Backup...
Destination:
& #91;E:\MSSQLSERVER\DATA\MSSQL\BACKUP\SR_
PAC\SR_PAC_db_200705270200.BAK]
** Execution Time: 0 hrs, 0 mins, 2 secs **
[5] Database SR_PAC: Verifying Backup...
** Execution Time: 0 hrs, 0 mins, 1 secs **
[6] Database Survey: Database Backup...
Destination:
& #91;E:\MSSQLSERVER\DATA\MSSQL\BACKUP\Sur
vey\Survey_db_200705270200.BAK]
** Execution Time: 0 hrs, 0 mins, 2 secs **
[7] Database Survey: Verifying Backup...
** Execution Time: 0 hrs, 0 mins, 2 secs **
[8] Database ServiceReq: Database Backup...
[9] Database whosnext: Database Backup...
Deleting old text reports... 1 file(s) deleted.
End of maintenance plan 'DB Maintenance Plan_weekly' on 5/27/2007 2:00:34 AM
SQLMAINT.EXE Process Exit Code: 1 (Failed)Hi Dave
"Dave" wrote:

> Microsoft (R) SQLMaint Utility (Unicode), Version Logged on to SQL Server
> 'PAC_APPS2' as 'PAC01\Administrator' (trusted)
> Starting maintenance plan 'DB Maintenance Plan_weekly' on 5/27/2007 2:00:0
1 AM
> [1] Database IER: Database Backup...
> Destination:
> & #91;E:\MSSQLSERVER\DATA\MSSQL\BACKUP\IER
\IER_db_200705270200.BAK]
> ** Execution Time: 0 hrs, 0 mins, 3 secs **
> [2] Database IER: Verifying Backup...
> ** Execution Time: 0 hrs, 0 mins, 2 secs **
> [3] Database MCI: Database Backup...
> [4] Database SR_PAC: Database Backup...
> Destination:
> & #91;E:\MSSQLSERVER\DATA\MSSQL\BACKUP\SR_
PAC\SR_PAC_db_200705270200.BAK]
> ** Execution Time: 0 hrs, 0 mins, 2 secs **
> [5] Database SR_PAC: Verifying Backup...
> ** Execution Time: 0 hrs, 0 mins, 1 secs **
> [6] Database Survey: Database Backup...
> Destination:
> & #91;E:\MSSQLSERVER\DATA\MSSQL\BACKUP\Sur
vey\Survey_db_200705270200.BAK]
> ** Execution Time: 0 hrs, 0 mins, 2 secs **
> [7] Database Survey: Verifying Backup...
> ** Execution Time: 0 hrs, 0 mins, 2 secs **
> [8] Database ServiceReq: Database Backup...
> [9] Database whosnext: Database Backup...
> Deleting old text reports... 1 file(s) deleted.
> End of maintenance plan 'DB Maintenance Plan_weekly' on 5/27/2007 2:00:34
AM
> SQLMAINT.EXE Process Exit Code: 1 (Failed)
None of the steps seems to have failed, so it may be the job notifications
that are causing the problem! Have you checked the SQL Server Error Log for
any messages?
John|||Thanks, I will check that
-Dave
"John Bell" wrote:

> Hi Dave
> "Dave" wrote:
>
> None of the steps seems to have failed, so it may be the job notifications
> that are causing the problem! Have you checked the SQL Server Error Log fo
r
> any messages?
> John

Can somebody explain what this is doing... select ...status & 4096 ...

Can somebody explain what "status & 4096" is doing in this SQL:
"select name, (status & 4096) as 'SingleUser' from sysdatabases.
In SQL Books, I find reference to "bitwise" operation. In my case, a databa
se has a status value of 4104 (which means "single user" and "trunc. log on
chkpt"). This statement returns a value of 4096 for this particular databas
e. I want to understand wh
y a 4096 (and 0 for ones that are not "single user") is being returned.
Thanks> I want to understand why a 4096 (and 0 for ones that are not "single
user") is being returned.
From the SQL 2000 Books Online:
<Excerpt href="http://links.10026.com/?link=tsqlref.chm::/ts_operator_7fax.htm">
The bitwise & operator performs a bitwise logical AND between the two
expressions, taking each corresponding bit for both expressions. The bits in
the result are set to 1 if and only if both bits (for the current bit being
resolved) in the input expressions have a value of 1; otherwise, the bit in
the result is set to 0.
<Excerpt>
Since the binary value of 4096 is 0001000000000000, a single bit is
evaluated and the expression 'status & 4096 will yeild either 0 or 4096.
This allows the single-user status bit to be examined independently of the
other bit values.
Hope this helps.
Dan Guzman
SQL Server MVP
"john lantz" <anonymous@.discussions.microsoft.com> wrote in message
news:060E090D-18F1-4649-980B-FF4FB64DB205@.microsoft.com...
> Can somebody explain what "status & 4096" is doing in this SQL:
> "select name, (status & 4096) as 'SingleUser' from sysdatabases.
> In SQL Books, I find reference to "bitwise" operation. In my case, a
database has a status value of 4104 (which means "single user" and "trunc.
log on chkpt"). This statement returns a value of 4096 for this particular
database. I want to understand why a 4096 (and 0 for ones that are not
"single user") is being returned.
> Thanks

Can somebody explain what this is doing... select ...status & 4096 ...

Can somebody explain what "status & 4096" is doing in this SQL:
"select name, (status & 4096) as 'SingleUser' from sysdatabases.
In SQL Books, I find reference to "bitwise" operation. In my case, a database has a status value of 4104 (which means "single user" and "trunc. log on chkpt"). This statement returns a value of 4096 for this particular database. I want to understand wh
y a 4096 (and 0 for ones that are not "single user") is being returned.
Thanks
> I want to understand why a 4096 (and 0 for ones that are not "single
user") is being returned.
From the SQL 2000 Books Online:
<Excerpt href="http://links.10026.com/?link=tsqlref.chm::/ts_operator_7fax.htm">
The bitwise & operator performs a bitwise logical AND between the two
expressions, taking each corresponding bit for both expressions. The bits in
the result are set to 1 if and only if both bits (for the current bit being
resolved) in the input expressions have a value of 1; otherwise, the bit in
the result is set to 0.
<Excerpt>
Since the binary value of 4096 is 0001000000000000, a single bit is
evaluated and the expression 'status & 4096 will yeild either 0 or 4096.
This allows the single-user status bit to be examined independently of the
other bit values.
Hope this helps.
Dan Guzman
SQL Server MVP
"john lantz" <anonymous@.discussions.microsoft.com> wrote in message
news:060E090D-18F1-4649-980B-FF4FB64DB205@.microsoft.com...
> Can somebody explain what "status & 4096" is doing in this SQL:
> "select name, (status & 4096) as 'SingleUser' from sysdatabases.
> In SQL Books, I find reference to "bitwise" operation. In my case, a
database has a status value of 4104 (which means "single user" and "trunc.
log on chkpt"). This statement returns a value of 4096 for this particular
database. I want to understand why a 4096 (and 0 for ones that are not
"single user") is being returned.
> Thanks

Can somebody explain this event in Sql Server Profiler?

Sql Server 2005; debugging a web application that accesses multiple databases.

I'm debugging some tsql in my web application using Profiler. Every once in awhile an Audit Login event will show up. This event contains the following text data:

-- network protocol: TCP/IP
set quoted_identifier on
set arithabort off
set numeric_roundabort off
set ansi_warnings on
set ansi_padding on
set ansi_nulls on
set concat_null_yields_null on
set cursor_close_on_commit off
set implicit_transactions off
set language us_english
set dateformat mdy
set datefirst 7
set transaction isolation level read committed

When this event shows up, there is a noticable lag in the time it takes for the query to return. I'm wondering if anybody can tell me

1) What causes this event

2) How often can I expect this to happen. I.e., it happens once per application instance, once per application instance touching a database for the first time, once every X minutes, once every x queries executed, etc.

TIA!

Every time a new connection is made by a client -and is very normal and necessary.