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

Special join or other way

Hi Forum,I am having a problem with incosistent data of two columns with semicolon separated values. Column A and column B should have the exact same number of elements, which is not always the case.In...

View Article


sql server database collation

Hi,We have idensitifed that one of the database collation is set to 'Latin1_General_BIN2' which has enabled case-sensitive at database level. When we tried to find out the reason for setting...

View Article


Begin Transaction when Stored Procedure Calls itself

I am experiencing occurrences of long blocking/deadlocks in a system I support.One of the stored procedures this system calls often has the following code:begin transactionbegin tryexecute...

View Article

Tableau Challenges

Please help with these questions... hope someone has an answer to it as I am unable to get answers to these questions.1. What are the differences between tableau7.0 vs tableau 8.0(Desktop and Server)?...

View Article

FIRST_VALUE & LAST_VALUE

Given the following sample data:AverageRate CurrencyDate 1.0001            2001-09-03 1.0001            2001-09-04 1.0002            2001-09-05 1.0002            2001-09-06 1.0005            2001-09-07...

View Article


Compare query result to excel sheet

SQL Query RESULT HpskuNUmber Month 92275A Jan-13 92298A Jan-13 92298X Jan-13 B3B30FN Jan-13 C18231 Jan-13 92275A 13-Feb 92298A 13-Feb 92298X 13-Feb B3B30FN 13-Feb C18231 13-Feb ExcelSheet Submitted...

View Article

WAITFOR DELAY: How can I continue to delay and excute until process is complete?

Hello my friends:Is it possible to run a select statement an wait, then run again until the table has no data?The following is an example code:BEGIN IF (SELECT COUNT(*) FROM MySchema.MyTable) > 1...

View Article

Need advice on preventing duplicate entries in People table

Hi,In my database, I have a "People" table where I store basic information about people e.g. PersonId, FirstName, LastName, Gender, etc.There will be lots of entries made into this table and I want to...

View Article


? Syntax curiosity

I realize that there IS a better way to write the syntax given in this specific example; however, I am curious about something some pseudo-code that I just looked at:where zipcode likeness in (...

View Article


if the value of a variable is either 1 or 2, required: to filter a table...

ST=such thatThe DDL:DECLARE@tTABLE(symbolvarchar(40),[Date]datetime2,OTint,Quantityint,VPricefloat,LastPricefloat,IDNOint,interIDint)INSERTINTO@t VALUES('BIndex','2014-01-17...

View Article

Is this possible? Crosstab query

Hi All,I have a rather complicated requirement am trying to fulfill. I'll make it simple and leave unnecessary details out. I have a table with structure similar to shown below.DECLARE @Trans TABLE (...

View Article

SQL Server 2012 license Web Application for Public

Hi,We have ASP.NET application and planned to host public accessible. So All public users can see my web application, then share the link via twitter,facebook and Linkedin.Can You suggest me which...

View Article

Is "with (nolock)" a good thing?

I've got an application that generates a report using Crystal Reports 9. It is timing out when it runs queries against the SQL Server. At this time I am trying to determine which query is causing this...

View Article


Create View Across multiple databases

Hello,I am attempting to create a view that joins two different tables that reside in different databases but on the same server. What is the proper syntax to accomplish this?I am using Microsoft SQL...

View Article

How can implement Remote DBA can not access Data or view ?

We want give our sql server or apps outsource to different company but we do not want share or view our creditinal data to other outsource DBA . But DBA performed all DBA tasks like Replication,...

View Article


pivot returns 7 rows instead of 1 for pivot on day name

Hi.  We run 2012 enterprise and the following pivot is returning 7 rows per dept instead of 1 ...select dept,[Mon],[Tue],[Wed],[Thu],[Fri],[Sat],[Sun] from #resultset pivot ( sum(calc) for [datename]...

View Article

Image may be NSFW.
Clik here to view.

Why is the FK parent table read

                            0                SQL Server 2012 Enterprise. I have two tables with a FK relationship. The referencing column in the child table is NOT NULL. The FK is trusted. I create a...

View Article


convert am/pm to 24 hour

i have this particular column which has am/pm and i would have to convert it to this particular formatFor example lets say i have 8:30 PM i would have to write the sql statement that converts the 8:30...

View Article

How do i declare a user defined table type sproc parameter as a local variable?

I have a procedure that uses a user defined table type.I am trying to redeclare the @accountList parameter into a local variable but it's not working and says that i must declare the scalar variable...

View Article

List all DB , table and columns in sqlserver instance

Hi All, I need to get all the Database ,  tables under each db and columns under each table. Like Database nameTable NameColumn Name AT1T1C1 AT1T1C2 AT2T2C1 BT1T1C1 I have the below query to get my...

View Article
Browsing all 23857 articles
Browse latest View live


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