HOW TO TRACK STORED PROCEUDRE, TABLE, FUNCTION ALTERATION IN SQL SERVER ? CREATE TABLE [dbo].[AdministratorLog]( [databasename] [varchar](256) NULL, [eventtype] [varchar](50) NULL, [objectname] [varchar](256) NULL, [objecttype] [varchar](25) NULL, [sqlcommand] [varchar](max) NULL, [loginname] [varchar](256) NULL, [createdon] [datetime] NULL ) GO
CREATE TRIGGER [Admin_Backup_Objects] ON DATABASE FOR create_procedure, alter_procedure, drop_procedure, create_table, alter_table, drop_table, create_function, alter_function, drop_function AS SET NOCOUNT ON DECLARE @data XML SET @data = EVENTDATA() INSERT INTO dbo.AdministratorLog(databasename, eventtype,objectname, objecttype, sqlcommand, loginname,createdon) VALUES( @data.value('(/EVENT_INSTANCE/DatabaseName)[1]', 'varchar(256)'), @data.value('(/EVENT_INSTANCE/EventType)[1]', 'varchar(50)'), -- value is case-sensitive @data.value('(/EVENT_INSTANCE/ObjectName)[1]', 'varchar(256)'), @data.value('(/EVENT_INSTANCE/ObjectType)[1]', 'varchar(25)'), @data.value('(/EVENT_INSTANCE/TSQLCommand)[1]', 'varchar(max)'), @data.value('(/EVENT_INSTANCE/LoginName)[1]', 'varchar(256)'),GETDATE() ) GO Thanks to Deeraj & dotnetfunda
Run following script to load all the data from CSV to database table. If there is any error in any row it will be not inserted but other rows will be inserted.
BULK INSERT CSVTest FROM 'c:\csvtest.txt' WITH( FIELDTERMINATOR = ';', ROWTERMINATOR = '\n') GO --Check the content of the table. SELECT * FROM CSVTest GO
The selected file is a solution file but was created by a newer version of this application and cannot be opened 2012 to 2010 Error when i'm trying to open VS 2012 project in VS 2010 Tried with the below approach, it worked out. But i'm not sure this is a best way to do.Take a risk, do it..
Just open the solution in a text editor
in the second line you can find Microsoft Visual Studio Solution File,
Hi, I have implemented the sharepoint calendar webpart referring this post. I faced an error with recurring events, not working properly. It stretches for all the days , instead of displaying separately. Reason: why the recurring events not working properly in the calendar view ? We are fetching the values from lists using query. In lists recurring events are just one list item instead of repeating for all the recurring days. So the query returns only one list item per recurring events Solution: I found the solution for this recurring events issue from this post. Just change your query as below & assign the ExpandRecurrence as True
// Construct a query that expands recurring events
SPQuery query = newSPQuery();
query.ExpandRecurrence = true;
query.Query = "";
// Look forward from the beginning of the current month
Here i found an interesting article about how to prevent importing disable AD accounts from here. But sometimes you can make good use of LDAP filters toa void importing service accounts for instance, and other filters according to your needs: Example LDAP User Filters
Default user filter:(&(objectCategory=Person)(objectClass=User))
Exclude accounts with no email address:(&(objectCategory=Person)(objectClass=User)(!(userAccountControl:1.2.840.113556.1.4.803:=2))(mail=*))
Exclude accounts with passwords set to expire:(&(objectCategory=person)(objectClass=user)(!userAccountControl=65536))
Include only the accounts with valid email addresses(&(objectCategory=Person)(objectClass=User)(mail=*com)
Include only the accounts that are part of the Branch1 organizational unit(&(objectCategory=Person)(objectClass=User)(memberof:1.2.840.113556.1.4.1941:=(CN=Authenticated Users,OU=Branch1,DC=domain,DC=local)))
Exclude accounts that don’t have a first name (&(objectCategory=Person)(objectClass=User)(!(userAccountControl:1.2.840.113556.1.4.803:=2))(!(!givenName=*)))
Useful links: 1. LDAP Filter syntax: http://msdn.microsoft.com/en-us/library/aa746475(VS.85).aspx 2. LDAP Query Basics: http://technet.microsoft.com/en-us/library/aa996205(EXCHG.65).aspx 3. LDAP ADModify tool (can be useful to test queries): http://modify.codeplex.com/ Thanks to tamtam.nl