How to Bulk Insert data from csv which contains double quotes to sql server 2014
Input CSV file:"Id","Name","Sal""1","vikas,j","10000.5""2","James","5000.2""3","VJ","4000.3"[code language="sql"]create table dbo.demo( Id char(1), N
View ArticleQuery with specific Output
--My Query to get Space left in a data file.CREATE TABLE ##ALL_DB_Files (dbname SYSNAME,fileid smallint,groupid smallint,[size] INT NOT NULL,[maxsize] INT NOT NULL,growth INT NOT NULL,status INT,perf...
View Articleexpression when sum have minus number then show 0
I have textbox with expression=Sum(Fields!servicetotal.Value, "Service") - Sum(Fields!servicefee.Value, "Service")Got the correct result.If the result number is negative, then I need to show (display) 0.
View ArticlePartition switch with unaligned partition
When I switch a partition off a partitioned table with unaligned indexes, I first drop the unaligned indexes, then switch the partition, and lastly recreate the unaligned index. That has worked...
View ArticleDate Field Calculation Logic
Can somebody please help with this issue.../*Here’s the problem: Let's say we had a table of all US Presidents, with the date they took office and the date they died. Let's say I want to get the...
View ArticleLinked Server Insert to Oracle - DateTime
Hi there! I have a linked server in my SSMS to an Oracle database. I am porting data over from SQL Server to Oracle via the linked server but of course timestamps throw errors because of the...
View ArticleCross compare from within the same table.
I have a list of items with a substitute and a Y/N box to determine that they are old items. (Code to follow.) A10 has a sub of B10 and B10 is old. B10 is subbed back to A10, but A10 is marked N as...
View ArticleSSIS: Changing target table without remapping all table columns
In developing an SSIS package that processes data and writes the output to a table with a 100+ columns, is there a way to change the target table name without having to remap all the columns? For...
View ArticleUpdating a table from a temporary table
Hi everyoneI have a table which needs to be updated by another temporary table, and I'm having problems doing this.The table is called MAILINGPREFERENCE and the particular column that needs updating is...
View ArticleAlternate Way Of Writing the Query
Hello Friends,We have been looking to optimize a query which at times run erratic and keeps changing its execution plan. While this query is static and does not have any parameters passed which could...
View ArticleStored Procedure
Hi,I have a stored procedure that runs for approx 5 mins , its developed by our developers. I need some suggestions that could improve the performance of this SP and probably reduce its time to run,...
View ArticleStatistics on memory optimized tables
I am creating the following statistics on a memory-optimized table:[code language="sql"]
View ArticleIssue with a column name, I think
Someone made typos when creating our tables.Manufaturing is the name of the column in the tables. that is fine.but there is a Period in the [INVOICE DATE.] column. I have pulled that field before, and...
View ArticleView Query Taking more time
I have created a view using below tables. This view takes a lot of time for returning output. I am using this view with other table by left join. Is there any way to increase the performance of below...
View ArticleCount mismatch in validation
My colleagues was working on count validation between source and target tables. There were many joins conditions and in where condition [code language="sql"] where (claim_date<>'01-01-2006' an
View ArticleNew command/functions in 2014
Hi AllI found this for 2012 that shows the new commandshttps://www.itprotoday.com/sql-server-2012-t-sql-glance-new-and-enhanced-functionsI can'
View ArticleError: The view contains a convert that is imprecise or non-deterministic....
I'd like to be able to index a view having a WHERE clause on date. Index DDL[code language="sql"]USE [DistributionCenterFeed]GOCREATE UNIQUE CLUSTERED INDEX vidx_DE
View ArticleHow do I insert into a table that only has a single (identity) column?
I have a table with only 1 column "fldID". That column is a primary key (to ensure uniqueness), identity column with a seed of 9000. How do I insert a new record into this table so that I can return...
View ArticleLet SQL do the work ?
Long time reader, 1st time poster here. I'm trying to build a stored procedure that creates a table that looks like an excel table. I have 1 table that contains Operator Names and 35 other tables that...
View ArticleUpdate trigger
I have insert trigger for inserting records from T_PDF table into T_WV_RESULT Table. The below trigger is fired when new records are inserted into the T_PDF table. Now need update trigger for
View Article