Query to get details of blocking and deadloack recorded in a table
Hi, whenever any blocking or deadlock occur in the server i have to record that information in a table with the query which is causing the locks with the login name.. Any query for this?
View ArticleHow to get any update and delete happening in database
Hi, I need to capture the insert, delete and update operation performed by AD group users in the database. How i can capture it ?
View ArticleRegarding OUTER JOIN
I'm reading a SQL Server book.I don't understand LEFT OUTER JOIN and RIGHT OUTER JOIN.According to this book, LEFT OUTER JOIN is illustrated like following.A LEFT OUTER JOIN will preserve all of the...
View Articleinsert into oracle_table (column1) select column1 from ms_sql_table
Hi all, how do I export data from ms sql table into oracle table ? begin insert into oracle_table (column1) select column1 from ms_sql_table; commit; end;
View ArticleHow to generate date month-wise from start date untill end date ?
How to generate the second table from the first table ?
View ArticleDifferences between Roles, Schemas, Users and Logins.
I need differences between Roles, Schemas, Users and Logins. Can anyone help me. Thanks in advance
View ArticleCan column default value be based in another column?
I have table Employee with two columns: [EmpCode] and [Dept].Is it possible that [Dept]'s default value be some CASE statement that can be two possible values? If [EmpCode] begins with 'H' then [Dept]...
View ArticleCreate Procedure only if it does not exist.
Maybe I am missing something or making too much of it. But I cannot figure out how to create a procedure only if it does not exist.We restore db from a backup file. the backup file has the most current...
View ArticleHow to sort specific column when using GROUPING SETS in SQL Server?
If I remember correctly, in SQL Server, it is not recommended to use "ORDER BY" when there's already a GROUP BY GROUPING SETS.I have two columns: [UPC#] & [Description] both are varchar.My grouping...
View ArticleIs it advisable or practical to run SQL Agent with Account from another domain?
A SQL Server in domain A needs to mount databases downloaded on a weekly basis to a second SQL Server, in domain B.Right now, the two domains, which were deliberately separated for security, have no...
View ArticleDropped/recreated SQL jobs and now SQL Agent can't run b/c old job_id is...
I've seen a common issue in several of our production environments where after we upgrade our software the SQL Agent can't run some jobs that were recreated as part of the process because they're...
View ArticleSQL server connect with VB6's DataEnvironment
I want to connect VB6's DBEnvironment with SQL ServerDataEnvironment.DEConnection.ConnectionString = ?How could I do this?
View ArticleSet out of range value to a time datatype in sql server 2008
Hi,I have a variable set to time datatype in SQL server 2008. I need to set a value more than 24 hrs to that. Is there any way? I get an error like Conversion failed when converting date and/or time...
View ArticleODBC connection failed for the first time with firewall blocked
Hello,I am trying to setup a ODBC connection with SQL Server driver where I am getting a connection error while testing the connection.Then I allowed all the inbound connections on the firewall...
View ArticleCan a view be created from the below query ?
Can a view can be built from the below requirement :For eg,I have a table having price from period_key 150 to period_key 156 My max(period_key) is 165I want a view that will show price from period_key...
View ArticleMake a good database Design ?
What are the steps/consideration need to make a database ?
View ArticleSQL Server volume licensing
If you have an enterprise agreement with Microsoft, specfici to SQL Server, do you just buy a volume per version of SQL Server, or does buying a volume of SQL Server cover any version you have...
View Article