how to execute oracle stored procedure in ms sql
hi friends,please tell me how to execute the oracle stored procedure with parameter in ms sql server.i have created a oracle linked server ( as CBSAF)oracle stored procedure : cbs_interfaceoracle login...
View ArticleBCP text file is adding an extra line at the end of the file
I am using a BCP statement to output file to text so it can be uploaded to another application. However the extra line at the end of the file is causing issues.I am using -T -c -S which is what someone...
View ArticleOPENROWSET in 2012 vs 2008: rollback or not
[url=https://sites.google.com/a/aisowhat.com/data2info/sql-server/sql-t-sql/tsql-openrowset-in-2012-vs-2008][/url]Hello everyone,This is Anibal from Taiwan,I found something interesting, but not sure...
View ArticleParameters in Stored Procedure
I have two sets of tables - one has yearly data and another has monthly data. The only difference between the two is the additional month column in the latter. I have a bunch of stored procedures that...
View ArticlePivot on Month when Missing Months
I have a table with product, month and revenue data.But for some products, there is no data if the product was introduced later on.I need to pivot that data but I am getting divide by zero error when I...
View ArticleGenerate unique invoice number-very CRITICAL application.
dear friends,I need to generate invoice number(s). To keep everything easy lets say I need to generate incremental number for each customer- starting with 1 and increment by 1. I cannot use ID column,...
View ArticleConvert single table to parent-child tables.
I have an application and database that I inherited, and am now trying to normalize the database for future application development. Currently, I have a table (Original) that I want to convert over to...
View ArticleRecursive CTE
Hi,I'm trying to get the hang of recursive CTEs.In this test I am wanting to set a level for downstream replications, but am not getting the expected results.What am I doing wrong here?Resource :...
View ArticleT-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 ArticlePivot with sum of multiple columns
I have a table with product sales by region for three years - 2010-2012tbl1prod region year revenuep1 r1 2010 100p1 r1 2010 15p1 r2 2011 150p1 r3 2012 50p2 r1 2010 200p2 r2 2012 25p3 r1 2011 300p3 r1...
View ArticleSelect Random rows WITH running total, possible?
I know how to select TOP X random rows from a table using NEWID(). Separately, I know how to select a running total using several methods, CTE, etc.BUT, how would one combine these 2 results into one...
View ArticleStrange character stripping when concatenating
This code concats two strings, one that is 4000 chars and one that is 4025 chars.If I put a N in place, i get correct result, but without N the script returns 8000 as length. Why?The funny thing, If i...
View ArticleDebugging 2012
Hi,I'm having trouble getting remote debugging working through SSMS 2012 and could use a bit of help.Debugging on the remote machine (Svr1) works fine, but not from my workstation (ws1).I am an...
View ArticleParameterized dynamic SQL
I was writing some code to check out the check_constraints of tables spread out accross multiple DBs in a partitioned viewMy idea was to use a parameterized query.Turns out you cannot use parameters...
View ArticleDatabase Mail Frustrations
We have a new server with SQL Server 2012. Database mail has been configured and appears to be working. I am seeing some strange behaviour though and I don't know if it is an issue with SQL Server,...
View ArticleChar And int
Consider this Table : CREATE TABLE Test ( field_one nvarchar(10) ); DECLARE @i int; WHILE @i<= 1000 BEGIN INSERT Test VALUES(CAST(@i AS nvarchar(10)) SET @i = @i + 1; END And also this Query:SELECT...
View ArticleActual Execution Plan Causing Error in INSERT table EXEC RemoteProc
On server A, create the following:[code="sql"]create proc remotetest3 (@a int)asset nocount onselect object_idfrom sys.objectswhere object_id < @aRETURNGO[/code]On server B, make a linked server to...
View ArticleOptimization Techniques
All,what are all the new "Optimization Techniques" available in SQL 2012 which is not available in SQL 2008?
View ArticleSQL 2012 on Windows XP or Windows 7
Is it possible to install SQL 2012 (32 BIT OR 64 BIT)on Windows XP or Windows 7 OS?I think windows server 2008 R2 only required. Although I just wanted to hera some experts thought on this.From...
View ArticleSHOWPLAN Enhancement
Hi All,I would like to learn "ShowPlan enhancements in Sql 2012". I searched on Google and tired to find some good link. Can anybosy refer some good article or link ?
View Article