Quantcast
Channel: Forum SQL Server Database Engine
Viewing all 15694 articles
Browse latest View live

CDC & Replication on same Database. How to tweak @maxtrans & @maxscans

$
0
0

We have CDC & Replication on same Database. When there are huge DML i.e. 30-40 million updates within 60 minutes the CDC is behind for 3+ hours. We wanted to tweak @maxtrans & @maxscans options as per the below article to improve performance however we cannot use  sys.sp_cdc_change_job to make the change as CDC is handled through replication. What are the alternate options available to make the change?

https://technet.microsoft.com/en-us/library/dd266396(v=sql.100).aspx


Thanks, Kranthi


SQL Server 2012 Table Partitioning

$
0
0

Hi All,

we have table that contains large number of records and this table growing very rapidly. To avoid performance issues in future we are planning to do table partitioning for large count tables (creating secondary files and distributing data on ndf file, creating partition function and schema, etc.....).

Please review below scenario and share your advise on this.

1. Table contains 18 columns and We have selected two columns fortable partitioning that is PRODID (Uniqueidentifier datatype, primary key column with clustered index) & another column CreatedOn (datetime datatype).

2. we are rarely using CreatedOn column in our sql scripts/or stored procedure. 

Can you please tell me which column is best for table partitioning that is PRODID or CreatedOn.

Please advise.


Access "Central Management Servers" (CMS) from SQL

$
0
0

Hi, 

Does anyone know how to access the CMS from within SQL 2008R2?  I know which server\instance it is stored in from the 

properties and also because I added it, I've read they can be accessed via this system table in msdb, however this returns no rows when I run it.  

SELECT [name]
, server_name
, [description]
FROM [msdb].[dbo].[sysmanagement_shared_registered_servers_internal]
ORDER BY server_name;
GO

Tried this one too

sysmanagement_shared_registered_servers

determining how long a query ran

$
0
0
Hi. On my local 2008 r2 instance, I left a query running in ssms and left the office.  I know the query finished but it looks to me like sql decided to disconnect me before I returned this morning.  I'm not sure but I'm guessing that in that situation, ssms doesn't retain its display of how long the query ran.  I'd like to know how long it ran.  Is there a log somewhere I can look at to determine the run time? 

Hungry sqlserver.exe?

$
0
0

Hi all of you,

Why does sqlserver.exe so expensive? A picture worths a thousand words:

https://gyazo.com/bbeb4bb9e29307838c47835c53648993

I’ve started my laptop OS Win 7 Ultimate 4 Logical CORE where I have installed a couple of Sql12k instances and after idle for 20 minutes (no scheduled Agent jobs (it would use SQLAGENT.EXE as well), no SSMS opened, no backups, nothing at all, jeez) I've seen these values in taskmgr, ain’t not very high? I mean, apart of the services nothing else is running in my Sql Server.

One of my colleagues always complain that I am a pretty neurotic individual, maybe he’s right but, you know, what the heck is Sql using so many memory?? It does make any sense or at least without any reasonable explanation.

 

Thanks for your comments, always are veryappreciated!



Build month! So much new to know! SS DBE Gurus needed - to help catalogue all this new stuff!

$
0
0

A wonderful week of news and new technology advances from Build this week have filled our minds with new possiblilities!

So much to play with!

Can you help us document some of the new features coming out over the next year?

Do you have a good grasp on how we should now be doing that thing that we do?

Did you find a knowledge gap in the web for the new features now available?

This is a great chance to jump into the TechNet Guru competition and stamp your authority on your favoutrite subject.

All you have to do is add an article to TechNet Wiki from your own specialist field. Something that fits into one of the categories listed on the submissions page. Copy in your own blog posts, a forum solution, a white paper, or just something you had to solve for your own day's work today.

Drop us some nifty knowledge, or superb snippets, and become MICROSOFT TECHNOLOGY GURU OF THE MONTH!

This is an official Microsoft TechNet recognition, where people such as yourselves can truly get noticed!

HOW TO WIN

1) Please copy over your Microsoft technical solutions and revelations toTechNet Wiki.

2) Add a link to it on THIS WIKI COMPETITION PAGE (so we know you've contributed)

3) Every month, we will highlight your contributions, and select a "Guru of the Month" in each technology.

If you win, we will sing your praises in blogs and forums, similar to the weekly contributor awards. Once "on our radar" and making your mark, you will probably be interviewed for your greatness, and maybe eventually even invited into other inner TechNet/MSDN circles!

Winning this award in your favoured technology will help us learn the active members in each community.

Below are February's mighty winners and contenders. We should have March's winners by about mid month.

Guru Award BizTalk Technical Guru - February 2016  

Gold Award Winner

Steef-Jan WiggersBizTalk Server ConvoySandro Pereira: "Explaining what it is and its concepts, it as well, so important as explain how it's done. Very good choice of topic, really well explained and in clearly way. Great job Steef-Jan. For me the best of the month. "
Ed Price: "The diagrams really bring this alive!"
LG: "It is really full description of one of the complex idea in BizTalk." 

Silver Award Winner

Eldert GrootenboerDeploying web services with BizTalk Deployment FrameworkEd Price: "Thank you! This is a much-needed scenario that's very well written!"
Sandro Pereira: "Again well explain and in clearly way, an excellent article for BTDF lovers :). Great job."

Bronze Award Winner

lanaxContinuous deployment - BizTalk Applications built using BTDF and Octopus deploySandro Pereira: "Good article, nice to see people right about new tools and how that they can add value."
Ed Price: "Great scenario on continuous deployment! The code could use a breakdown to explain the parts, but the introduction is very thorough!"

 

Guru Award Forefront Identity Manager Technical Guru - February 2016  

Gold Award Winner

Jeff IngallsMIM 2016: Privileged Access Management (PAM) - FAQEd Price: "Great resource to come back to!"
Søren Granfeldt: "Good start"

Silver Award Winner

Wim BeckFIM2010: Selective Import Attribute FlowSøren Granfeldt: "Nice ideas...."
Ed Price: "Great scenario and thorough Intro and Possible Solutions sections! Could benefit from a breakdown of the code or a conclusion. Great formatting!"

Guru Award Microsoft Azure Technical Guru - February 2016  

Gold Award Winner

Steef-Jan WiggersAccess Azure Redis Cache with an API AppJH: "Nice article about combining Redis and API Apps, especially the integration of Swagger is great."

Silver Award Winner

XAML GuyIoT Suite Under The Hood - Predictive MaintenanceJH: "Have played with the template myself. Great to see an article about it. Would love to see an article on how to customize the template in more detail."

Bronze Award Winner

Samir FarhatHow to access an ARM Azure virtual machine from InternetJH: "Had the problem myself in the beginning. Found a way through the portal. Good to see PowerShell scripts to do it in a repeatable fashion."

 

Guru Award Miscellaneous Technical Guru - February 2016  

Gold Award Winner

Geetanjali AroraAn Introduction to Microsoft Graph APIRichard Mueller: "Very well explained with good detailed steps. I like the references."
Peter Laker: "Top marks Geentanjali, nice article"

Silver Award Winner

Gaurav Kumar AroraCruds in NancyFx using ASP.Net and FluentNHibernate Using Repository PatternRichard Mueller: "Lots of good code and images. Grammar needs work."
Peter Laker: "Very interesting, thanks Gaurav"

Bronze Award Winner

SYEDSHANUASP.NET MVC User Role Base Menu Management Using WEB API And AngularJS

Peter Laker: "Wow great article!"
Richard Mueller: "Lots of code and detailed steps."

 

Guru Award SharePoint 2010 / 2013 Technical Guru - February 2016  

Gold Award Winner

Nathanaël StassartOneDrive : Next Generation Sync Client Deployment guideEd Price: "Wow this is thorough! Great formatting, color-coding the tables, including images, code formatting, and a general breakdown of each step, in depth!"
Richard Mueller: "Good use of Wiki guidelines and great links. The "See Also" should be Wiki articles, this is really "Other Resources"."

Silver Award Winner

Rakhi JainSharePoint 2013 : Customize Document Library TreeView Navigation BarRichard Mueller: "Great use of Wiki guidelines."
Ed Price: "Short and sweet. Great scenario and good use of an image and code formatting! Very clear steps."

Bronze Award Winner

TenPartSharePoint 2010: Updating TermStore using PowerShellEd Price: "Good details and formatting. Could benefit from a TOC, breakdown of the code, and a See Also section at the end for Wiki links. Thank you!"
Richard Mueller: "Good code. We could use some references."

Guru Award Small Basic Technical Guru - February 2016  

Gold Award Winner

Ed Price - MSFTSmall Basic 1.2: Installation GuideRichard Mueller: "Good use of Wiki guidelines. Great images that detail the steps."

Silver Award Winner

Nonki TakahashiSmall Basic: DesktopMichiel Van Hoorn: "Realy cool to interact with Windows components."
Richard Mueller: "Excellent use of Wiki guidelines"

Bronze Award Winner

Ed Price - MSFTSmall Basic: How to Publish Your ProgramRichard Mueller: "Good images and useful information."
Michiel Van Hoorn: "Sharing is caring. How much fun is it to share your code with friends and family"

Guru Award SQL BI and Power BI Technical Guru - February 2016  

Gold Award Winner

Benchmark your SQL Server instanceSSIS - Transfer data from Multiple tables using a single DFTPT: "Vinay, this is a very creative and useful solution to a difficult problem. I've seen multiple ETL frameworks for SSIS over the years and I think your approach is quite sound. Congratulations on winning the Guru award this month!"
RB: "Nice walkthrough and solution to a common scenario"

Silver Award Winner

Visakh16SSRS Tips : Implementing OR Based Logic for Dataset FiltersPT: "Visakh, thanks for posting this useful information about report filters. This is a powerful feature that takes a bit of effort to use effectively."

Bronze Award Winner

Greg DecklerDates Prior to 1900 in DAXPT: "Greg, thanks for this insightful contribution. The date range limit is something I run into all the time and is a tough problem to solve. This is a good work-around technique."
RB: "Interesting workaround"

Guru Award SQL Server General and Database Engine Technical Guru - February 2016  

Gold Award Winner

FLaufferWorkaround for Delay in Transaction Log Truncation: Snapshot ReplicationUR: "good and short explanation of a common problem with transaction logs."
DRC: "The article talks about executing sp_repldone as workaround which can be used only as a last resort. "

Guru Award System Center Technical Guru - February 2016  

Gold Award Winner

Darren JoyceSCOM Reset Health on Alert CloseAlan Carlos: "Thanks for article!"
Ed Price: "Great depth and details in this article! "

Guru Award Transact-SQL Technical Guru - February 2016  

Gold Award Winner

Olaf HelperSQL Server: Implementation of N-Gram Search Index

Richard Mueller: "Very interesting ideas for search. Good use of Wiki guidelines"

Ed Price: "I love how you break down the code and explain it so thoroughly!"

Silver Award Winner

Natig GurbanovSQL SERVER:Using Datalength() function

Richard Mueller: "Interesting. This could use some references."

Ed Price: "Great topic. It could benefit from more explanation of the code."

Guru Award Universal Windows Apps Technical Guru - February 2016  

Gold Award Winner

George ChondrompilasReal-time chat UWP application using Azure Mobile App and SignalR

JH: "Nice and simple example. Would love to see more examples using SignalR."

Ed Price: "The breakdown of the code and the images add great value."

Silver Award Winner

Magnus (MM8)UWP: Disabling Selection Of Items In a ListView

JH: "Nice workaround for disabling items."

Ed Price: "Fantastic formatting and great explanations!"

Guru Award Visual Basic Technical Guru - February 2016  

Gold Award Winner

.paul.calc2 - A VB.Net OOP CalculatorMR: "Nice example!"
Richard Mueller: "Interesting ideas. Lots of well documented code. Good use of Wiki guidelines."

Silver Award Winner

SYEDSHANUControl Chart Using VB.NetMR: "Nice and easy to use chart!"
Richard Mueller: "Nice GUI. Lots of code."

Guru Award Visual C# Technical Guru - February 2016  

Gold Award Winner

SYEDSHANUASP.NET 5 CRUD using Scaffolding and Entity FrameworkCarmelo La Monica: "Very interesting article, very detailed and good images and video."
Jaliya Udagedara: "Good article with a detail explanation. And the sample code is available in MSDN Code Gallery. Hint: you can use EF itself to generate the database and seeding the data rather than running the scripts."

Silver Award Winner

Emiliano MussoBinary Clock in C# and WPFJaliya Udagedara: "This is interesting. Great explanation using code snippets, images and a video. And the sample code is available in MSDN Code gallery. Just great!"
Carmelo La Monica: "Congratulation, very impressive imeges, good video dimostration and lot of funny :)"

Bronze Award Winner

Brian SeekfordHow to access legacy forms checkboxes and ActiveX checkboxes in Word using C#! by Brian SeekfordJaliya Udagedara: "Would love to have a better formatting in the article and of course a sample to download and try it out."
Carmelo La Monica: "Good article. it can benefit format C# code and table of contents."

 

Guru Award Wiki and Portals Technical Guru - February 2016  

Gold Award Winner

Ed Price - MSFTWiki: Dynamics CRM PortalRichard Mueller: "A great portal with great links."

Guru Award Windows PowerShell Technical Guru - February 2016  

Gold Award Winner

Pierre-Alexandre Braeken MCSERSA with PowerShell - PowerRSAEd Price: "Great depth! This article will be a good resource to return to!"

Silver Award Winner

Richard MuellerPowerShell AD Module Cmdlets Cannot Clear, Add, Remove or Replace Back Link AttributesEd Price: "Beautiful formatting, and great use of the different sections!"

Guru Award Windows Presentation Foundation (WPF) Technical Guru - February 2016  

Gold Award Winner

Andy ONeillCombobox Matching Complex Type

Peter Laker: "Nice work Andy. Well presented and useful, just like you!"

Ed Price: "I love how Andy's articles break down each snippet like this!"

Silver Award Winner

Brian SeekfordHow to display a different value in a WPF combobox based on selection i..e None instead of blank by Brian Seekford

Peter Laker: "Thank you Brian, good contribution"

Ed Price: "Good scenario. Could benefit from See Also links and code explanations. Good article!"

Guru Award Windows Server Technical Guru - February 2016  

Gold Award Winner

Kia Zhi Tang (Ryen Tang)Nano Server: Deploying an Internet Information Services (IIS) Web ServerAlan Carlos: "Great article! Congratulations!!! Nano Server is amazing!"
JM: "This is an excellent article on Nano server, thanks for your contribution"
Richard Mueller: "Good references and step by step instructions."
Mark Parris: "Good insight into the one of Nano server's capabilities."

Silver Award Winner

Mahdi TehraniLoad balancers and Active DirectoryMark Parris: "Critical information that people need to be aware of."
JM: "This is a good article that could use an edit pass for clarity"
Richard Mueller: "I share your concern for the need of a load balancer. Any AD integrated app should use AD group memberships."

Good luck!
Pete Laker


#PEJL
Got any nice code? If you invest time in coding an elegant, novel or impressive answer on MSDN forums, why not copy it over toTechNet Wiki, for future generations to benefit from! You'll never get archived again, and you could win weekly awards!

Have you got what it takes o become this month's TechNet Technical Guru? Join a long list of well known community big hitters, show your knowledge and prowess in your favoured technologies!

How to configure automated email alert in SQL Server 2012 based on query results

$
0
0

I need to identify and be notified when records in my SQL Server 2012 R2 database table meet a specific condition. For example, when a record in the trans_record table has any entries in the “status” column of “error”.

The query is simple enough and I have setup an SSIS package to query the table with the appropriate “where” clause. I followed this with a SQL Agent job to run the SSIS package daily at 7:00am and export the offending records to a flat text file.

What I need to understand is how I can be emailed only when a record is found with the query performed by the SSIS package. It appears that the SSIS package will always create a file regardless if any records are found.

I see that SQL Server supports Alerts and defined Operators to be notified, but I don’t understand how to be notified only if my query returns a valid record.

How can I set this up in SQL Server?

Thanks

Recovery model for Development databases - do you use simple? Disadvantages?

$
0
0
In our office, Im typically the one that wears the "dba" hat and some of our development and /or test servers have most of their datbases set to use the full model, when we never really need to bother recovering anything from a transaction log. There are maintenence plans even for the dev servers, keeping db backups as well as tlog backups.  So Im of the opinion that setting ALL databses on a dev server to use simple, rather than full.  What would be the downside or potential problems one might encounter doing this?

Setting Alert on Performance "Lock Timeouts (timeout > 0)/sec

$
0
0

I have a couple questions about this. I am using SQL Server 2014.  The database that has problems is less the 100 MB.  I will get how busy the server is later.

Background.  I am helping someone identify the source of intermittent timeouts.  My understanding is that their .Net applications are running fine most of the time.  But then the application begins timing out.  I haven't established yet whether this is a connection time out or whether the query times out (that will come later).  I am toying with the following approach.

I create an alert on Lock:Lock Timeouts (timeout > 0)/sect on instance _total, if counter > 0.

The response is to run a job that runs a script that will dump the current connections, their waiting status, whether they are head blocker, etc (I can build this) into a table.

Next for Options, I want to set the Delay between responses to 4 minutes.

Questions:

1) What performance issues can I anticipate?  Is there no risk, moderate risk or high risk of this alert causing performance problems in a scenario of moderate work load, high work load (100 transactions per second, a number I pulled out of my hat).

2) My second question I think that I can test.  But off the top of your head, does an ADO.Net command cause a timeout that this alert can listen to.

 


Russel Loski, MCT, MCSE Data Platform/Business Intelligence. Twitter: @sqlmovers; blog: www.sqlmovers.com

Compare database scripts

$
0
0
Hi all,

My requirement is to move the database objects changes done in Testing DB to the Production DB (only the structual changes, not the data).

What is the best way to achieve it?

Website throwing error that user cannot login to database

$
0
0

Hi, I created a SQL database on Azure. I am able to connect from SQL Server management studio from my local machine as well from the SQL database portal online.

However, when my web site (web application) tries to start up and connect to the database, Azure throws an error that login by user failed. I've added the IP address of the azure web application to the firewall as well, and configured access by Azure services to True. In my web.config, I'm using the same connection string that Azure provided me (with my password included of course)

What else should I be doing? Any help will be appreciated.

Query performance - SQL server

$
0
0

Hi All,

Can you please suggest how to reduce the clustered index cost and operation from scan to seek.

SystemUserID column is primary column in table with unique identifier data type.

Database Index Rebuild Job suggestions for 24x7 live application dataabase.

$
0
0

Hi, 

 I am looking for best practices and suggestions for the 24x7 live application Database Maintenance. 

Have one application database on SQL 2012 which 24x7 live application. I am running rebuild job when i get maintenance window. But the problem i am facing is when I run this job its get locked with users transaction and run for infinite time until i manually kill the maintenance job. Steps i am running is

1) Kill Database connections

2) Run Index rebuild job. 

Even though killing all connection at first step rebuild job get locks up with users connection. So while I am running Index Rebuild job manually I have to kill all users connections manually. Index Rebuild job is set through maintenance plan and HAve added first step to kill database connections. 

Any best suggestion , workaround or best practices will help to solve this . 

Thank you. 


Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach

how to divide the rows based on data in column

$
0
0

Hi all,

 i have a typical query to divide the data based on column



In tmpdet table for vouchid 101025 refernce column has data more than40 lines as below:

jb 12000 paid
jb 700 paid
jb 700 paid
dhgsdasg
wuwwefwjf
dgfedgfe
dhfeuhfehf
jhfuehfuehf
yfuyruywu
this is a toy
a car
i10 is a car
sdwduwduw
gwyfgwewsch
abcdefeghslds
turkey is a country
golf is a game
dwdwdwyd
gdwgfydfg
qeqewrqw
qwretuturtyir
12123141255
12345678910
movie is cinema
cinema is movie
good movies always refre
banty returns
jaalk is a boy
he is mad
dwydydg
yfwetywuguwior
qydtyqwgdsd
qrwyu is held
joo is hg
mercury hg
maganes metal
aadjdhadasdfj
dyADYDASYDUA
QEATSFADG
qshajshaddadqweqyweqywe
pandas live in antarcitica
dquweqeqwueyuq

now, i have a query as below:

SELECT A.vouchid, Split.a.value('.', 'VARCHAR(100)') AS String INTO #temp FROM (SELECT vouchid, CAST ('<M>' + REPLACE(isnull(reference,''), char(13) + char(10), '</M><M>') + '</M>' AS XML) AS String FROM tmpdet) AS A CROSS APPLY String.nodes ('/M') AS Split(a); select td.vouchid,reference, --CASE --WHEN COUNT(String) < 33 THEN '0' --ELSE '1' --END IsVoid , T.String --ROW_NUMBER() over(order by reference) RowNumber From tmpdet td LEFT JOIN #temp T ON td.vouchid=T.vouchid

where td.vouchid in (101025,101026,107547) group by td.vouchid,reference,T.String order by td.vouchid drop table #temp

which resulting data as :

here in vouchid column i have 101025,101026,107547 id's and string in reference column is divided based on the lines in reference column.

now, i need another column Is_Void with datatype integer  in which result is :

As of now string column is having data divided from refernce column (if reference column forvouchid 101025 has 42 lines of data string column is divided as 42 rows for same vouchid.

now, what i need is if no.of lines in refernce colulmn for single vouchid is greater than 33 lines then Is_Void should be '1',if not '0'. if suppose no.of lines in reference column exceeds 33 lines then Is_void should be '1' for vouchid 101025 and vouchid 101025 should continue for next lines in refernce column (34-42) and should have Is_Void column to be '0'...since (34-42 lines)is < 33 lines.and later next vouchid 101026 should be coming with its refernce colulmn and string division and IS_void result based on no.of lines in reference column.  Please help ..i need this in urgent..

thanx in advance..


lucky

Cannot send mails to mail server. (The operation has timed out.)

$
0
0

HI Everyone,

  IF anyone faces this issue with Database mail  on SQL 2012 SP3? it used to work till yesterday and all of sudden stopped receiving mail alerts from SQL and found this. 

The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2016-04-03T17:32:25). Exception Message: Cannot send mails to mail server. (The operation has timed out.).
)

Any help or workaround is greatly appreciated. 

Thanks


Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach


how to display page number starting from given number

$
0
0

hi all,

 Till now i'm using page number in header and footer so that the page number starts from 1

="Page " & Globals!PageNumber 

but now i need page number starting from what number i needed

i have one parameter in which values come from drop down as 1,2,3,4,5..etc

now if select parameter value as 1 my page number should start from 1..if i select 2 it should start from 2...etc

how can i acheive this..

pls help

thanx in advance..


lucky

Linked servers and ODBC/SQR

$
0
0

I am attempting to write an SQR (it will run from PeopleSoft) that updates a linked server.  It fails with the following error:

 

(SQR 5528) ODBC SQL dbexec: SQLExecute error 7412 in cursor 2:
   [Microsoft][SQL Native Client][SQL Server]OLE DB provider "SQLNCLI" for linked server "DUL41" returned message "No transaction is active.".
(SQR 5528) ODBC SQL dbexec: SQLExecute error 7391 in cursor 2:
   [Microsoft][SQL Native Client][SQL Server]The operation could not be performed because OLE DB provider "SQLNCLI" for linked server "DUL41" was unable to begin a distributed transaction.

Error on line 58:
   (SQR 3735) Could not execute SQL.

SQR for PeopleSoft: Program Aborting.

--------------------  Details ------------------------------

 

- The code is simply doing a delete right now.   delete from linkedserver.db.dbo.table where column = 1

- The SQL runs fine from Query Analyzer, so I think MSDTC must be setup correctly everywhere, and the linked servers must be defined correctly.  My QA test is using the same ID (sa) as my SQR.

- If I just write a select statement in the SQR, it works fine.

- in this example, SQR is connecting via ODBC, using SQL Native Client driver.

 

------------------  Environment --------------------------

 

- Main server:  Win2003, SQL2005sp2, active/passive cluster.  MSDTC is setup on the cluster.

- Linked server:  Win2003, SQL2000sp4, not a cluster.   (I also tried a SQL2005 server just to test)  This is the DUL41 server referenced in the error message.  MSDTC is running.

- Everything is running from a different Win2003 box, that connects to the main server using ODBC/SQL Native client

 

Thanks for any help or ideas.  Even any way to get better error messages, or a better way to test this.

 

timeout - how to find problem query

$
0
0

Hi all.

We are experiencing issues with a web application, in the log files for the application we see for example this error message:

System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out

I've read about this and similar and figured out we need to check out the query causing this, we get the issue at peak hours when all users log in.

What is the most easy way to find the query, so I can start tuning it?

Im working as a dba, but I have good communication with the application developers.

how to give where clause condition based on parameters

$
0
0

Hi all,

   i have an SP to be for which i have 2 parameters as 

CrownNumber int ,NoofCrowns int

i have a select statement in SP which returns values as below:

vouchid 101025 has refernce column value more than 40 lines..so i divided each line as single row in string column

so that for same vouchid,same refrence column will have string column as row by row in reference column

reference column has data for vouchid 101025 as below:so i divided each line as seperated row in query ..that's why result is as per the image..

jb 12000 paid
jb 700 paid
jb 700 paid
dhgsdasg
wuwwefwjf
dgfedgfe
dhfeuhfehf
jhfuehfuehf
yfuyruywu
this is a toy
a car
i10 is a car
sdwduwduw
gwyfgwewsch
abcdefeghslds
turkey is a country
golf is a game
dwdwdwyd
gdwgfydfg
qeqewrqw
qwretuturtyir
12123141255
12345678910
movie is cinema
cinema is movie
good movies always refre
banty returns
jaalk is a boy
he is mad
dwydydg
yfwetywuguwior
qydtyqwgdsd
qrwyu is held
joo is hg
mercury hg
maganes metal
aadjdhadasdfj
dyADYDASYDUA
QEATSFADG
qshajshaddadqweqyweqywe
pandas live in antarcitica
dquweqeqwueyuq

now, i need column numberofcrowns to divide if string column for vouchid 101025 exceeds more than 33 lines that should be value 1,

and rest of 34-43 values for vouchid 101025 ..numberofcrowns should be 2

next for other vouchid 101026 check whether string rows are >33 or <33 if less than 33 then '3' for newnumberofcrowns value..then next vouchid 107547 check if >33 or <33 <33 rows then '4'....so on...

pls help..thanx in advance..


lucky

truncate_only' is not a recognized BACKUP option

$
0
0

Hello All,

I am able to run the below command in sql 2005 but in 2008 getting error : truncate_only' is not a recognized BACKUP option.


Back Up Log [DBName] with Truncate_Only 
dbcc shrinkfile([logFileName])

Thanks in Advance

Ashwin

Viewing all 15694 articles
Browse latest View live