Search

Source Code

the Source of your life is my code

Category

SQL

[SQL] Select TOP(N) Increase execution time

Adding a TOP clause to the SQL SELECT query may greatly increase its execution time. In this Article I will show you how to resove it and increasing performance of query SELECT TOP(N). This query took few seconds to execute.... Continue Reading →

Advertisements

[SQL] Moving Data From One Database to another

In this post I show you how to move records from sourse table to another table located into two different database. You have to copy data from source table to destination table and after You have to delete records from... Continue Reading →

[SQL] Select a specific day, month or year

This snippet query allows to select all records of a specific date, day, Month or Year For a specific date without using time: For a specific Day: For a specific Month: For a specific Year:

[SQL] SQL Server instances installed on a machine

Two brief solution for the goal. Inside the search field from your taskbar, enter cmd. Then, click on the Command Prompt result. In the windows console enter sqlcmd -L like this: this is my result: Another way for the goal:... Continue Reading →

[SQL] How to get cumulative sum

Do you want to get the cumulative sum but do not know how to do it? I know and use one of these three ways The fist one: The second one: and as last: Result: ID quantity CumulativeSumValue 1 2... Continue Reading →

[SQL] Select,Update and Delete Duplicate rows

In this post we will show you, how to Select, Update or delete the duplicate rows you replace YourTab with Your Table Name and after “PARTITION BY” FirstColumn,SecondColumn My example Table ID FirstColumn SecondColumn ThirdColumn 1 aaa 2 a 2... Continue Reading →

ExecuteStoreQuery how to use it

ExecuteStoreQuery, executes a query directly against the data source and returns a sequence of typed results. Calling the ExecuteStoreQuery method is equivalent to calling the ExecuteReader method of the DbCommand class, only ExecuteStoreQuery returns entities and the ExecuteReader returns property... Continue Reading →

[SQL]How to know structure of your database

In this brief code I show you to know structure of your database and this is my result of query: see also: Change db schema

[SQL] How to change fromdbo schema to todbo

In this post I show you how to change a schema of your table. Open Microsoft SQL Server Management Studio, Create new query and past this code you substitute toschema with your new schema value and fromschema with old schema.... Continue Reading →

Blog at WordPress.com.

Up ↑