Learn more about SQL Server tools

   
   


















































SQL Server Question and Answers

Ask a SQL Server Question

Search All Questions:
SQL Server Questions And Answers
<< Previous Page        Next Page >>

Store result of dynamic pivot into temp table
I have the following cte dynamic qury and need to inser teh results into a temp table. Here is the script: DECLARE @serviceid int = 66;  DECLARE @SQL nvarchar(max);  WITH  E(n) AS(  SELECT n FROM (VALUES(0),(0),(0),(0),(0),(0),(0),(0)

asked 6/27/2016 11:31:56 PM
by Helal
0 answers

DB backup initiated by NT AUTHORITY\SYSTEM
We are taking Nativae backups daily and some of backups are intitaited by NT AUTHORITY\SYSTEM. There is job was configured. i am finding the below message from error log. I/O is frozen on database msdb. No user action is required. However, if I/O is not

asked 6/24/2016 4:14:49 PM
by sree
0 answers

Converting Rows to Columns Dynamicly
I need to convert my data set from multiple rows to columns and sum by multiple fields. Below is sample data and desired outcome. The data have 7 rows and I need to pivot this to one row for each serviced and sum the last three columns (ChargeAmount,Adjus

asked 6/23/2016 9:31:35 PM
by Helal
0 answers

SSRS Batch Processing
I have an SSRS report that when ran will generate thousands of records.  Each record has it's own unique ID.  What I want to see happen is to kick off the report and each record (each unique ID) will be exported to a PDF to a predetermined folde

asked 6/20/2016 1:58:08 PM
by Conor Chaput
0 answers

SQL Server 2012 - Licence Quantity Details
Hi,   We have SQL Server 2012 software of Enterprise and Standard Edition.   1. Microsoft SQLSvrEnterpriseCore Sngl Licence/SoftwareAssurancePack  OLP 2Licences LevelC CoreLic -  Quantity 32    2. Microsoft SQLSvrStanda

asked 6/20/2016 8:51:07 AM
by NIKHIL DESAI
0 answers

a severe error occurred on the current command. the results if any should be discarded
Hi, We usually get the below error in my organisation dont know the exact reason please help "a severe error occurred on the current command. the results if any should be discarded"

asked 6/8/2016 8:39:19 AM
by Satish Vishwakarma
0 answers

DBCC CHECKDB has failed giving error as "Extent (1:31218136) in database ID 5 is marked allocated in the GAM, but no SGAM or IAM has allocated it", our client has refused to run DBCC REPAIR_REBUILD or DBCC REPAIR_ALLOW_DATA_LOSS. Is there a solution where I can find the table linked to the extent number and drop and rebuild the table only
Below is the complete error as written to the error log of the sql server.   DBCC RESULTS -------------------- <DbccResults>                    &

asked 6/2/2016 5:02:38 PM
by Manish Yadav
1 answers

Recovery Backup
  Hai       This is Mahesh,I have one doubt of SQL SERVER DBA I am settings in backup every sunday 12 am fullback up.     for every 6 hours differential backup.every 15 min t log back up.  If my server cra

asked 5/26/2016 11:55:36 PM
by Mahesh
1 answers

Using Cross Apply to retrieve one random row
-- CREATE TABLES AND LOAD THEM WITH RANDOM DATA SO THAT WE HAVE SOMETHING TO WORK WITH  CREATE TABLE #JJJ(inv int); CREATE TABLE  #PPP (Rand1 INT, Rand2 INT)  ; GO INSERT INTO #JJJ SELECT TOP (60)inv = ABS(CHECKSUM(NEWID())) % 123 FRO

asked 5/6/2016 11:03:44 AM
by Jerry Day
2 answers

SQL Server Always On
Hi , i am planning to build HA SQL solution using Availabily groups , i have cluster on data center and i want to create SQL instance on DR site, and create availability group,  but my application doesnt support AG(so when i switch DR site i need t

asked 4/28/2016 5:48:07 PM
by khaled
0 answers

Is it right to use default schema (dbo) in all objects in sql server
Hi,  I want to know that is it right practice to use default (dbo) schema in all object in sql server ??

asked 4/27/2016 3:39:35 AM
by Saurabh
0 answers

SLOW PERFORMANCE WITH @TABLE and TABLE FUNCTION
Hi, i have a performance problem with a simply query that work very slow!!! this is my scenario Mgmov TABLE  -- with the following definition CDMG CHAR(5), DATA SMALLDATETIME, ANNO AS (YEAR(DATA)), CDAR CHAR(20), Colore CHAR(6) , Ta

asked 4/25/2016 3:37:30 PM
by Gianni
1 answers

A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.) (Microsoft SQL Server, Error: 10054)
Hi all, after patching sql server 2008 sp4 on a passive node of vcs cluster and failover the services/resources to active to passive node, we failed to connect database engine locally through ssms, but from other box we connect the same DB engine easilly

asked 4/21/2016 3:41:00 AM
by Subhamay Chatterjee
0 answers

Use powershell to insert a list of directory files with modification date into a SQL Server table
I know I can search if a particular file exists in a directory, but how to I generate a list of all the files in a directory> If a flatt file is generated, I can always use a SSDT package to import, but is there a way to save the file name and the modi

asked 4/17/2016 3:02:39 PM
by Sandy Shin
0 answers

Windows 2012 Failover Cluster + SQL 2014 tempdb does not shrink
Hello, I've been reading a lot about this topic but nobody seems to have an answer. So I'm trying this forum. We have a VMWare environment where we have a Windows 2012 failover cluster, build with shared vmdk "disks". This all works fine for almost a ye

asked 4/14/2016 8:36:58 AM
by Tom Huis
0 answers

Sql database flagged as suspect
*** NOTE *** - If you want to include code from SQL Server Management Studio (SSMS) in your post, please copy the code from SSMS and paste the code into a texWe run SQL on a Win2K server. The database for an OOB product began to be flagged as 'suspect' a

asked 4/10/2016 9:13:17 AM
by perkins
0 answers

Performance Tuning an off the shelf system
I have read some articles about perfomance tuning and monitoring. They all asume that I have written the application. What if I am using an off the shelf system? Is it feasible or advisable for me to do any performance tuning of SQL? As part of my main

asked 4/7/2016 5:56:23 PM
by Paul Kelly
1 answers

How to create a fixed database db_owner role with dbo behaviour
I suppy specialist data management software to the geothermal industry that uses SQL Server.  This data is "owned" by the program users (geothermal scientists and engineers) - in other words, they collect, collate and enter the data for their own pro

asked 3/18/2016 8:49:23 PM
by Errol Anderson
0 answers

Show all tables where two columns exist - SQL 2008
I want to a search for all tables that includes both of  'Documentversionid' and 'ClientMedicationID' columns.    Thank You,   Helal

asked 2/29/2016 8:02:54 PM
by Helal
1 answers

Slow ETLs on weekends
Hi, I am having slow runs of ETLs that otherwise run for 15 minutes, taking close to two hours on weekends. I have ensured nothing else such as db maintenance is running during the times of delayed runs. The job spids are of the type CXpacket,  Lat

asked 2/22/2016 6:05:31 AM
by Gummy
0 answers


 
Sponsor Information






 

Follow

Get Free SQL Tips

Twitter

LinkedIn

Google+

Facebook

Pinterest

RSS

Learning

DBAs

Developers

BI Professionals

Careers

Q and A

Today's Tip

Resources

Tutorials

Webcasts

Whitepapers

Tools

Search

Tip Categories

Search By TipID

Authors

Community

First Timer?

Pictures

Contribute

Events

User Groups

Author of the Year

More Info

Join

About

Copyright

Privacy

Disclaimer

Feedback

Advertise

Copyright (c) 2006-2016 Edgewood Solutions, LLC All rights reserved
Some names and products listed are the registered trademarks of their respective owners.