Quantcast
Channel: Transact-SQL forum
Browsing all 23857 articles
Browse latest View live

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 Article


BEGIN 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 Article


procedure 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 Article

TVP 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 Article

Isolation 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 Article


Identity 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 Article

Help 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 Article

Query 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 Article


SQL: 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 Article


Does 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 Article

ANSI_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 Article

Image may be NSFW.
Clik here to view.

How 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 Article

is 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 Article


help 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 Article

Login 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 Article


Read XML Tags using SQL Select Query

Hi AllI am having the XML as below<University>   <RegistrationCode>12859</RegistrationCode>   <Colleges>      <College>...

View Article

Records 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 Article


Have 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 Article

Datetime 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 Article

Alternate 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
Browsing all 23857 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>