Convert table data to (Embadded/Nested)JSON format in SQL server 2014
Hi,How to convert table/tables data to (Embedded/Nested) JSON format in SQL Server 2014? Task is to import data into mongodb which requires data in JSON format.Thanks in advance.Regards,Vijay
View ArticleHow to prevent having XMLNS added to each and every record?
I need to generate and XML file, but the request is it has to be without having xmlns added to each and every line, as it increases the size of the xml.Is it possible to escape it, please? I think in...
View ArticleSQL gourping by multiple columns help
Hello,I have the following table:ID bigint,Name varchar(50),Address varchar(250),RecDate smalldatetime,PurPrice decimal(7,2),PaidBy varchar(50)I am trying to come up with a select statement that will...
View ArticleConverting XML file to SQL table
I need to read and convert a xml file into sql tableAnd I think I´m almost there although I get the content of the columns as NULLSCan anyone help?thanksSo far this is what I have:[code="sql"]USE...
View ArticleSelect continual date ranges from a list that overlaps
Hi There, need some help.I have list of prices and the dates they are valid from and to. For Example:Date From Date To Price20/06/2013 26/08/2013 199.9927/08/2013 21/01/2014 199.993/10/2013 31/10/2013...
View Articleopen a SSIS package in design view fro SSIS catalog
A question for SSIS package in SSIS catalog.Is there a way on server to open a package in data tool?I know it is not good practice to open it directly on server, but sometimes I need to do a quick...
View ArticleHow to drop temp table created by somebody else?
I want to drop a temp table created by somebody else how would I go about doing this? I see the temp tables, but I don't know how you can drop it. I'm trying to shrink tempdb and if somebody else has a...
View ArticleBrowsing network for SQL instances
This isn't really causing me a problem, but I am a bit intrigued ....In SSMS, when connecting to a database instance, you can scroll the bottom of the list of Server Names (which is a list populated by...
View Articlecan this be done in another way
below query returns expected result set. but i am thinking if i have different student status it many take lead in row number based on sorting order.fulltime will always take lead for a student even...
View ArticleIs there a way to extract only credit card numbers from text
i have below sample data, i try to extract valid credit card data. But i was not able to do so ,since data is not in good format. Can any one help? below sample data have a transaction code which is...
View ArticleCREATE FUNCTION with a WHILE LOOP
I am learning and new to CREATE FUNCTIONS - how to I add a WHILE LOOP in a function:CREATE FUNCTION fn_list_the_number(@count INT)RETURNS TABLEASRETURN(WHILE (@count <= 10) BEGIN PRINT CAST(@count...
View ArticleCheck if File exist - Script Task
I am trying to write a logic within SSIS 2014 using script task (script lang:Microsoft Visual C# 2012) where it looks if text file exist or not and returns a value (1,0) in varibale :...
View ArticleUnable to execute JOB (SSIS package)
Hi,I'm trying to run a JOB which should execute an SSIS package. Unfortunately, I landed up on multiple errors stating "Dimension Processing: Error: Either the user. NT SERVICE \SQLSERVERAGENT. does...
View ArticleImport data in parquet format
I have a situation where I need to import data from a Hadoop file that is in parquet format. Preferably, I'd like to do this from within a stored procedure that can truncate the staging table, import...
View ArticleImport data from xml in MS SQL Server 2014
HiThe following is the code which does not give any results. Will highly appreciate if I get some help. Thanks in advance. //HariExpecting result as follows:897;;825 1 3897;;825 2 50 DECLARE @idoc...
View ArticleIssue using sp_send_dbmail for CSV export
Hello, I am using sp_send_dbmail to create a CSV export. However, for some reason, the header line is "Splitting" into multiple lines upon export. I am trying to figure out what is causing this to...
View ArticleQuery optimization
Hello,I want to optimise the following query that is running so slowly. Please help or gimme an advice.MERGE dbo.LocalizedCategories AS T USING ( SELECT L.LanguageID,SC.CategoryID,BC.Value FROM (SELECT...
View ArticleZero down time database migration into production
Hello All,We are working into database migration project. There is requirement to migration sub-set of database into production without any down time .Also we have to migrate data and merge into...
View ArticleDeny DML on a table
Hi allI have a table "test" in my "testdb" database. There is a user "user1" The user has access to all tables in the database. For this particular table "test", I executed "DENY insert on test to...
View ArticleStored Procedure to transfer all DB objects including data from one schema to...
hi,Stored Procedure to transfer all DB objects including data from one schema to another schemathis is the code i tried ALTER PROC sp_schema_to_schema@sourceSchema nvarchar(100),@targetSchema...
View Article