Code dotnet in the sql injection in management studio
Hello,I have developed a solution that allows to inject code directly in dotnet requettes sql . which allows to use all the dotnet framworks on the fly in the sql management studio.an example of which...
View ArticleSyntax question
I have a robust query that returns a dataset and the data is good, however some of the records contain the exact same data with the exception of the 'Price' field. I want to combine the records that...
View ArticleLike Statement With Parameters
I have a table :Person(Id bigint , FirstName nvarchar(50) , LastName nvarchar(50),Address nvarchar(100))and I have a sp for search data in "Person" table:CREATE PROCEDURE SelectPerson @First...
View ArticleHelp with query
I need to create a query where patients have delivered and may have returned within a certain number of days for another admittance. each visit a new chart(sessionid) will be created. I thought I could...
View ArticlePartitioning Table Strategie
Im just starting to get into this topics and looking for general advice on how to set up the partitions.I have a transaction table with 50 million records that's very hard to query. it holds data for...
View ArticleRandom number !
I have a function which generate random number in range :[code="sql"]CREATE FUNCTION Func_Rand ( @MAX BIGINT , @UNIQID UNIQUEIDENTIFIER )RETURNS BIGINTAS BEGIN RETURN (ABS(CHECKSUM(@UNIQID)) % @MAX)+1...
View ArticleAlternative query which can have better performance
Hello All,Is there an alternative to this update query mentioned below.[code="xml"]DROP TABLE #FinalMeetings CREATE TABLE #FinalMeetings ( RowNumber INT IDENTITY(1,1), MeetingType VARCHAR(60),Country...
View ArticleWorking on type 2 dimension in 2014 visual studio
Actually , for historical record I have to update End date as Updated Date where end date is Default date '2099-12-31'and for new record with same id , have to insert with Default date '2099-12-31'.But...
View ArticleHelp - Sql update commands being reversed
Hi, Can you help me please? I'm running a update on a table and it appears to work. But when I check the data about 10 mins later it has been reversed back to the original form! Any ideas/suggestions...
View Articlelast exected date for stored proc
Hi All, Is it possible to find out the last executed date for any stored proc in the database using system tables or writing any other query.Thanks.
View ArticleClarion Date Conversion
The database for our software stores dates and times in clarion format. I'm trying to write some custom reports in T-SQL and I need to convert these dates but it's giving me a lot of trouble. How do I...
View ArticleIndexed View not being used for Partitioned Clustered Columnstore Index
I am trying to use an indexed view to allow for aggregations to be generated more quickly in my test data warehouse. The Fact Table I am creating the indexed view on is a partitioned clustered...
View Articlemulti-part identifier could not be bound
Greetings Everyone,I scoured the forum and internet trying to figure out what is wrong with this query. Aside from it being hard on the eyes I cannot pin point the error. I know it is complaining about...
View ArticleConcatenating rows in a select horizontally...
Hi, Can you help me please? I'm using the SQL indicated below:[code="sql"]SELECT DISTINCT C.Field1 As 'Group', A.Field2 As 'Security Object' E.Field3 As 'User'FROM TableA AS AJOIN TableB AS B ON B.key1...
View ArticlePersisted computed column not acting very persisted...
The short version of the story is this...I have a Column called "BillID" that is a VARCHAR(20) data type. A typical value looks something like this... A6304158-2The problem is that the numeric portion...
View ArticleBest way to find how much of my partition filegroup contains data?
I have partitions that I have filled with data. I am not trying to figure out exactly how much data the partitions contain, and therefore I will be able to see if any of them are close to hitting their...
View ArticleDynamic trigger logging
I would like to have a dynamic trigger on INSERT, UPDATE and DELETE. (each their own trigger).What i want, is the trigger to log what has happened with the record. For the insert trigger, i would like...
View ArticleTrying to calculate running difference in values between days
Hello,I am trying to write a query to calculate the running difference between data on different dates. Below is what my table of data looks like. Basically I want to calculate the difference between...
View ArticleSSMS 2014, Visual Studio 2013 and Windows 10 insights?
I work for a small company that hasn't been accustomed to thinking about how desktop upgrades may affect the functionality of SSMS, Visual Studio (used by me for SQL Server administration, and SSIS and...
View ArticleProblems with duplicates
HiI am having some problems coding with sql. Very new at this. I'm using sql server 2014.Anyway, I want to clean my table which have seveal duplicates in the name column. ID Tr Namn Säsong Lag date...
View Article