Quantcast
Channel: SQLServerCentral » SQL Server 2012 » SQL Server 2012 - T-SQL » Latest topics
Browsing all 4901 articles
Browse latest View live

Parameterized table names?

Hey,We're going SQL2012 in a few weeks... does this version support parameterized table names? Currently we use dynamic SQL, it would be great if that wasn't necessary anymore.For example:DECLARE @tbl...

View Article


Character '*' in float column

Hi everybody,I m an intern in charge of creating an sql server database for production data. We got basically parts numbers and measurements which are float columns. To avoid having any doubt...

View Article


create a function to remove vowels from a given string

Hi,I am creating a function to remove vowels from a given string but its not working,help me to correct it or give me the correct answer.thank you. CREATE FUNCTION FN_REMOVEL_VOWELS (@STRING...

View Article

Collation conflict between SQL 2012 SP1 and SQL 2005 SP3 ?

I have the following error coming back at meMsg 468, Level 16, State 9, Line 243Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to...

View Article

SERIALIZABLE Transaction Isolation Level Is Not Behaving As I Expected

Inadvertently posted before completion by an improperly executed keystroke. I've removed the body of the post. Please see my other post with the same title.Thanks

View Article


SERIALIZABLE Transaction Isolation Level Is Not Behaving As I Expected

I have 2 goals to accomplish:1. Continuously and atomically migrate data from a primary table to an archive table.2. Ensure that a VIEW of a UNION ALL between the primary and the archive tables never...

View Article

Fibonacci numbers using a function.

Hello,I am calculating the first 20 Fibonacci numbers using a function,but getting wrong answer.The condition is to write a function not a procedure. here is my try,help me.create function fn_fibo(@end...

View Article

DATEDIFF with days and hours

Hi guys, I am trying to calculate the diffs between to days as a decimal. The hours will an easier wayybe in decimal.i can do it in varchar, but i need to be able to agrigate my value.eg. datediff(DD,...

View Article


Better Way of XQuerying

Gurus, I am very new to XQuery. Trying to figure out how I can make use of extended events to monitor long running queries in my system.I know, I am not thinking straight and pretty sure there must be...

View Article


Bulk insert in procedure. Use of quotes for variables

Hi everybody,I struggled with a bulk insert in procedure and i eventually found a working piece of code. Except that i did'nt understand the general rules to wrap variables.Exemple : N'BULK INSERT ' +...

View Article

computed column in view

I have the following "create view" query that s not working, can't figure out what's wrong... :use test1gocreate view dbo.GlobaldataEOLT2asselect [NUMCAM] ,[C_Fourn] ,[date_passage] ,[heure_passage]...

View Article

Determenistic function returns undetermenistic. Why?

Hello,Has any idea why this is classed as non deterministic. DATEFROMPARTS(DatePart(yyyy,DATEADD(dd, (DATEPART(dw, Date_received) - 1) * - 1, Date_received)),DatePart(mm,DATEADD(dd, (DATEPART(dw,...

View Article

extract date

I need extract date from one column which has datatype text.For Ex: - aaaaaaa 02/20/2002 jjjjjj sddsdjjjjsdsd sdsds- asdlajsd fjsdfjkdgn dsjbfks, dfjksflml,fsf,f sdfsdf 9/3/99 sjdfnsdnf sjdfoisofn-...

View Article


Using LinkedServer

Hello comunityOn SQL server 2008 most of the time i have used a linkedserver to access excel file with this script:EXEC sp_addlinkedserver @server = N'ExcelDataSource', @srvproduct=N'ExcelData',...

View Article

Oracle trigger to SQL trigger

Hi,Got a Oracle script with a trigger in it and I want to have it as a SQL trigger scriptCan anyone help me with thisCREATE OR REPLACE TRIGGER MESSAGES_INS BEFORE INSERT ON MESSAGESFOR EACH ROW BEGIN...

View Article


CONTAINED DATABASE OR NOT ...

In a POC project I was looking into the SQL Server 2012 feature of partially contained databases.To my surprise I encountered an error where I didn't expect one.The code hereafter is a simplified...

View Article

T-SQL Cursors

Okay I am kind of new to this and I am trying to create a table and if the user doesn't fill all the fields I need the empty field to not be shown just the fields that are filled. How can I do this...

View Article


best way to transfer data

Hi,I have two tables (one is main table and another one is staging table)Ex: tableA (contains 1.2 billion rows, trigger for arrival timestamp for insert and update and non clustered index)....

View Article

What's wrong in this .. simple calculations

If I run the following on SQL Server 2012 I get two different answers from the first two select statments.Any reason why and what I need to do to avoid this. The second statement gives the wrong answer...

View Article

Question to you all on MERGE

So I've been reading up on Merge and have been experimenting with it lately in my 2012 environment.I've run a few tests and was curious if aside from the readability improvements offered, if you found...

View Article
Browsing all 4901 articles
Browse latest View live