BULK INSERT - codepage and formatfile - problem
Hello,I have a problem and I'm stuck. I have to import file .html to table. [code="sql"]create table dbo.test( Full_Row nvarchar(MAX) COLLATE Polish_CS_AS) BULK INSERT dbo.test FROM...
View ArticleData Profling tables within SQL Server w/out SSIS Mean_Value, Min_Value,...
Hello everyone, I have been giving the task of profiling databases and all the tables within it. Right now I'm collecting the following:Null_CountNull_PercentageTotal_Record_CountI'm looking to capture...
View ArticleI have two table in two different database. I have to found count for both...
I have two table in two different database. I have to found count for both table and put into other table.example : Database --> A , table is T1 Database --> B , table is T2I want count of both...
View ArticleEliminating a Distinct SORT operation
I have an UPDATE statement that joins two table by SendId. One table, I'll call it T1, has a clustered index on SendId ASC. The other table I will call T2 also has a clustered index on SendID ASC. All...
View ArticleTrigger and Function Code
I am making a SQL database for a shop and i am have a lil problem in functions and triggers so i really hope someone here can help me outwhat i need isto create a function [GetDiscount] to get the...
View ArticleComposite PK/Surrogate and Sequence/Identity questions.
So, I have some questions about best practice in SQL Server. 1.) I have PK like this (company TINYINT, store TINYINT, action TINYINT, invoice INT, sn SMALLINT). I know JOINS will work faster with...
View ArticleInsert stored procedure output to a table and add datetimestamp
Hi All,I have a need to insert stored procedure output a table and in addition to that add a datetimestamp column.. For example, Below is the process to get sp_who output into Table_Test table. But I...
View ArticleLarge table with multiple search columns
Hi,I've a database with a table that has 16 columns that are searchable. There can be a numerous combination of those columns used for searching...In this case the best solution is to create an index...
View ArticleSQL server 2014 features
Hi, Previously Microsoft had a nice easy to view break down of what features where in what products. Does anyone have a link for the 2014 ones? I can see any break down of the developer edition. Does...
View Articlecolumnstore index and stats
We have two tables with 2.9B and 1.1B rows using clustered column store index. New/changed data is only applied once per week in a published application downtime window.We ALTER INDEX ... REBUILD on...
View ArticleUsing cursor output in SPs
I need a help to fix the below SP which is having cursor output with an alternate logic which can make the SP work.(may be using temp table or any other option)CREATE PROCEDURE Get_IDS /* * SSMA...
View ArticleSQL SERVER RegEx Question
I have been trying to get this condition to be TRUE, but can't seem to get it right.Any suggestions would be helpful. Thanks.DECLARE @stopat datetimeSET @stopat = '2015-06-23 02:16'IF @stopat LIKE...
View ArticleHow to move AG(Availability Group) databases to new location
I would like to move my AG databases to new location using C#.I found article on MSDN which uses SQLCmd utility to do that, but I cant run that utility from my application.I am looking for general...
View Articlecan please help me to write better than this query but i want same output
can please help me to write better than this query but i want same output ...select a. emp_id,a.uid,a.LAST_NAME,a.FIRST_NAME,a.MIDDLE_INIT,a.L_ID...
View ArticleHowto change SQL serevr startup options using SQL SMO
I would to change the SQL service start up params from my C# application,without touching any reg settings from my code.SQL 2014 SDK has a dll named as "Microsoft.sqlserver.sqlwmimanagement.dll" which...
View ArticleScript to search for a string in all DB objects (incl synonyms)
Hi, I'm looking for a "God-script" to search for a given string (case invariant) in all DB objects (esp synonyms) in all DBs on a server?Any comments/suggestions - much appreciated,Colm
View ArticleGood White Paper To Go Over How SQL Handles Queries
Hi All,Not sure if this is the place to put this but I was wondering if anyone knows of a good white paper that goes over how SQL handles queries. What I mean by this is, a white paper that goes over...
View ArticleQuery Help - Some simple (hopefully) grouping
I have been tasked with creating a SQL query which does a couple of things and, being a relative new user to SQL, was hoping the community here might be able to help- I don't necessarily need direct...
View ArticleSQL Profiler and very high reads
HiI am facing a strange situation with a prepared query sent from Java application, SQL profiler is showing a very high reads about 250 000 pages (CPU:63155, duration 63640), when I look in the Query...
View ArticleCapturing column statistics
Hello I'm trying to capture Column Statistics Profile as if I was using SSIS data profiling task. I do not have this option and would like to see how I could go about capturing the min max and avg of...
View Article