Pivot to display age span
Hi!I have a task to create a pivot table but i am not familiar on how this works.My customer wants to have a pivottable that contains countries in a row and ages and gender in the columns.The query...
View ArticleWhat do you call a transaction spanning multiple data sources?
What do you call a transaction spanning multiple data sources?a.distributed transactionb.implicit transactionc.explicit transactiond. complex transaction Which of the following is a valid method to...
View ArticleYou want to know the amount of space the transaction log for the Customer...
You want to know the amount of space the transaction log for the Customer database is using. Which T-SQL command would you use?
View ArticleWhich is a large set of disk managed by a high-performance controller that...
Which is a large set of disk managed by a high-performance controller that presents a mount point to various servers across a private network?
View Articlecursor (fetching two variables)
Experts,I have a table with two columns for a cursor. The first column is server name and the second is DB name. I have a table x in all the DBs in all the servers and I want to select from that table...
View ArticleSplit multiple columns into rows using XML
Hi Forum,I am trying to split 2 columns that each contain values separated by semicolon into single rows. The relation between the values of the two columns is that the order in the cells corresponds...
View ArticleRe-Indexing - Only get performance back using management studio
SQL Server 2005 (SP2)I have a nightly job that populates a table that is queried heavily everyday. After about 4 months of no issues, suddenly the performance of the query was slowing down. In the...
View ArticleAuditing on a budget
My client is a small US mail-order company and they use an online credit card (CC) payment terminal to run CC transactions. The work flow is: 1. Customer calls and places order. We take CC...
View ArticleWhat command would you use to check for allocation, structural, or logical...
What command would you use to check for allocation, structural, or logical integrity problems?
View ArticleInsert Values and and column data into another table
SELECT min(cs.purchorderNum) as PurchorderNum, cs.productID, (cs.purchOrderQty / p.weight) AS QtyOrder, (cs.qtyFilled / p.weight) AS QtyFilled, isActive, p.weight FROM CustomerServicePO cs INNER JOIN...
View Articlehow to subtract two date columns & calculate the duration in MSSQL
I have tree columns in one of the tables: check-in time and check-out time, billableHours. check-in & check-out are date fields. billableHours is varchar and would like to format like this: HH:MM.I...
View ArticleGenerate ColumnStore Index through tsql
I am using partition switching for data retention. I would like to truncate the staging table, but the table has a column store index so I need to drop and recreate that columnstore index. Does anyone...
View ArticleT-SQL: Problems to using CONTEXT_INFO to bypass Update Trigger processing
SQL Ver: 2008 R2Problem: I having problems getting CONTEXT_INFO to work properly. I'm trying to run a stored procedure (SP1) which runs an UPDATE statement on records in Table1. Table 1 has an...
View ArticleDynamic TSQL Statement with Dynamic Parameters
I'm trying to utilize a dynamic TSQL Statement where I can have various parameters passed of differing kinds, e.g. In some cases parameter 1 would be an int, other cases it may be a datetime, or...
View ArticleSQL 2012 sys.trace_xe_action_map and synonym dbo.trace_xe_action_map
Why would the creation of a synonym for sys.trace_xe_action_map to accommodate its relocation from its previous schema dbo.trace_xe_action_map not function correctly from the SharePoint 2007...
View ArticleSelect as Login counter for sessions in a period of time
Hello all,I have a SQL database and there is a table with all login sessions (with beginn and end in UNIX timestamp).I now try to find a select query or something to count the logins in a period of...
View Articlecomposite key of varchar columns defies concatenated comparison in where-clause
I have inherited a legacy database which has a table with a composite primary key of varchar columns. One of the triggers on the table does not handle the case of having multiple rows in the inserted...
View ArticleError "Conversion failed when converting date and/or time from character...
I have a table-valued function that run in sql 2005 and when try to execute in sql 2008 r2, return the next "Conversion failed when converting date and/or time from character string".USE [Runtime] GO...
View Articlehaving an insert that runs in sections
Hello. I am not the regular dba that does the stored procs in the db (not my forte). But that person is out for while so I'm left to do the developing and the db work for the project. My question...
View ArticleComplicated Stored Procedure - Need Guidance
Hello All, I am developing a ASP.NET webforms app using SQL Server 2008 R2 Database. AppData database for logging in is stored on same SQL Server (I plan to have other intranet sites to use them). This...
View Article