Powershell invoke-sqlcmd calls stored procedure second time after Query...
We have a very strange issue. We have noticed that a single stored procedure is executed twice when is called by Powershell invoke-sqlcmd command.When we trace it we can see the procedure starts...
View ArticleData Type for a REPLACE statement
Hi,May I know what is the data type of this query after REPLACE is applied? Date or string? declare @date as datetime2(0) set @date = '2013-10-13 23:54:02.32365' print replace(convert(date, @date,...
View ArticleConvert a datetime to YYYYMMDD
Hi,Is there a way to convert a date (e.g. 2013-10-13) to int ( 20131013) without converting the date to varchar first and then to int?cherriesh
View ArticleSPpolicy_purge_history Jobs in progress for more than 9 hours. How to kill...
Dear All,I open the Job history and found that sppolicy_purge_history job was in progress for more than 9 hours and still its in progress. I stop the job but it still in progress.The step 3 is not able...
View ArticleSQL Srever multiple instance on same server
Hi Everyone, To maintan multiple version of sql server I have intalled sql server 2005/2008 R2 and sql server 2012 on same developement server. When I am opening any of the SSMS (2005/2008 r2/2012)...
View Article2012 sql cluster / maintenance job - update statis is slow
2012 sql cluster when using maintenance plan for update stats, it takes about 10 minutes. When using script from the plan, it takes a second. No error. Any checking that we should do? Thanks,
View Articlesql server performance report
Hi Everyone,I got a SQL Server 2k5 instance. Now I want to get some performance report including the average memory usage, average CPU usage, active connections on a weekly basis. Is it possible to...
View Articlesp_send_dbmail problem
I am trying to send an email with the results in the body of the message. Below is the code and below that is the error. DECLARE @mailprofile VARCHAR(200) declare @query nvarchar(max) SET @query =...
View Articletruncate transaction log
Hi,1. I want to move T-logfile from one drive say S: to drive R:,2. I want to truncate the transaction log file, please let me know how to do it?Regards
View ArticleSnapManager for SQL Backups
Hi Folks:Is any one configured SnapManager for SQL Server backups in virtual enviornments.If yes: Please let us know the Advantages and Dis-advantages of this.Thanks for your help...!Satish...
View ArticleSQL Server management studio is not showing the entire data
Hi Team,There is varchar(max) column in a table when i do select on that column in management studio it is not showing entire data it is only showing 4000 characters. How to enable to show the entire...
View ArticleCursor in userdefined function
Hi All,Please help me this is a urgent requestI have a oracle function that has been created now i wanted that to be created in sqlserver. Can u pelase suggest me any link or script where i can use the...
View ArticleSQLSERVER Function with cursor
Hi All,Am basically from oracle, i have a function with cursor here i have created in oracle. May you please help me in modifying this into sqlserver. FUNCTION fun_din (id IN NUMBER, dim IN VARCHAR2...
View ArticleMsg 6522, Level 16, State 1, Procedure sp_printstatement, Line 0
Hello. we got a problem after patching our Windows server 2008R2 on which SQL 2012 cluster is built. when we run sp_browsereplcmds it gives following message. when SQL server on unpatched node, there...
View ArticlePerformance issues with change tracking
HI ,We ahve change tracking enabled on one of our server an year back (SQL Server 2008 + SP1), we are seeing the "'sys.syscommittab'" is 50 GB in size and anything running on that instance is very slow...
View ArticleRegarding the Batch file running the stored proc to backup the Databases
Hello,I have a SQL Server 2008 R2 Express edition.I created a batch file at c:\SQLServer\Backups . This Batch file contains the Stored procedure which takes the Backup of all the Databases and places...
View ArticleStart with Connect by prior
Hi All,Can anyone please help me in making this oracle sequel statement into Sql Server. select name from (select id, info_id from wp_tasks start with id = task_id connect by...
View ArticleMultiple Partition on one Filegroup in SQL Server 2008
Hi Experts,My business requires to create the filegroup year base and partition on quarter base which resides in that year base filegroup.Ex: 2010 (FG) --> Q1,Q2,Q3,Q4 (Partitions).I google it but...
View ArticleDB Server Freezing!!
Dear Gurus, I am not even able to log in to the SQL Server machine!! Any ideas why that happens? Any way to find out more details when the machine lets me back in? Do you think it is the machine or the...
View ArticlePowerShell script to delete BAKs from mulitple child folders on a UNC share
Afternoon,I have been trying to roll my own ps script to accomplish a cleanup task but I am rather new to ps and am not getting the results I am needing.Here are the criteria I am shooting for:1....
View Article