CountWeeksDays
Experts,We have Date table with some sample recorde as :-DECLARE @param_StartDate VARCHAR(10) DECLARE @param_EndDate VARCHAR(10) SET @param_StartDate = '2013-05-19' SET @param_EndDate = '2013-05-26'...
View ArticleBEGIN TRANSACTION within TRY - CATCH or vice versa
Which of the following connotes the correct coding block structure?BEGIN TRANSACTION BEGIN TRY --================================================ -- Add Your Code Here...
View Articleprocedure that has table argument as output
I want to pass a table variable into a procedure that has table argument as output, but not as read only! I want to be able to modify that argument inside the PROC. Is this possible? If it's not...
View ArticleTVP as OUTPUT in PROC in T-SQL
how can i define table type argument as OUTPUT in PROC and don't READONLY? if it's not possinle, is there another way to do same this? thanks!
View ArticleIsolation level scope question
Imagine that sprocA calls sprocB.How is the isolation level determined when:1. Isolation level is set in sprocA but not in sprocB.2. Isolation level is set in sprocA (read committed) and in sprocB...
View ArticleIdentity column Jumped/not sequential in SSRS 2008 R2
We are facing uncanny behavior with one of the Identity Specification column on production server database. It's been three times since our application went live on production server. The jump started...
View ArticleHelp with Complex Query
I am working on my senior project which is a registration system and website. Everything works good, however I need to add that teachers can ONLY teach 3 classes. What I have now:Some more...
View ArticleQuery help
Hi All,I have a situation where I need to select first name from a name column of this format and its count. Schwerdtfeger, Susan C Dodson, Susan I Hubbard, Susan A Hyde, Susan C Mccue, SusanJim,...
View ArticleSQL: How to test store procedure by pass ntext parameter?
We need to test store procedure logic and need to pass a parameter as ntext.the parameter value is like xml stringDeclare @DayPartsChanges ntext Set @DayPartsChanges = '<?xml version="1.0"...
View ArticleDoes SET NOCOUNT ON eliminate @@ROWCOUNT values after table inserts?
Hi All,I'm troubleshooting numerous stored procedures. I notice most of them have "SET NOCOUNT ON" at the top. Later, in each sproc, we set a local variable = @@ROWCOUNT. First I assumed the reason...
View ArticleANSI_NULLS configuration
Hi Team,Is there any way if we can set "ANSI_NULLS" to OFF at database level? I tried changing configuration from database property however I am still getting 0 rows in result when I run query with...
View ArticleHow many days patient was in ICU
Hello All,I am working on a research request to find out how many days a patient was in ICU during the course of his visit. Below is the sample data. If you see the patient_id 1 he came into a Non ICU...
View Articleis it possible to implement filestream on shared hosting server
hi allcan i know, is it possible to implement file stream on shared hosting server, any difficulty occurs
View Articlehelp with complex query
hi i have a subqury below like select count(Weigh),sum(Weigh) from myTable where id=120 and status=0select count(Weigh),sum(Weigh) from myTable where id=120 and status=2select count(Weigh),sum(Weigh)...
View ArticleLogin Properties Window Freezing
Has anyone experienced SQL Mgmt's Login Properties window freezing up for a long time when you try to map a login to the SSISDB? This doesn't happen when I try to map a login to other DBs. It only...
View ArticleRead XML Tags using SQL Select Query
Hi AllI am having the XML as below<University> <RegistrationCode>12859</RegistrationCode> <Colleges> <College>...
View ArticleRecords go missing with Nolock hint - results in deadlock if nolock hint...
I m currently doing my reads using the nolock hint, and updates using the rowlock hint. Here is the experiment setup:Thread 1: while (1 = 1) begin -- Perform a read operation on row 101. Read query...
View ArticleHave valid view that returns data fine but View Design mode will not execute...
This is a valid view that was created. We can query the view and it works fine. But if we select View Design and try to execute it receives an error about ambiguous columns. when using CAST. SQL...
View ArticleDatetime Conversion error
;WITH WCTE AS( Select Header, Convert(DateTime,Value,110) ServiceDate2 from tblUdrElement Where 1=1 and Header = 'Service Date' )SELECT * FROM WCTE where ServiceDate2 >= '2012-01-01 00:00:00.000'...
View ArticleAlternate Way
Hi,I have a table with values in a column10 10 10 20 25 20 30 20 20Q: I want to retrieve the values with single count i.e, 25,30. And I want to accomplishwithout using group by and having clause.i am...
View Article