enow.com Web Search

Search results

  1. Results from the WOW.Com Content Network
  2. Generate Insert Scripts of Existing Rows with if Exists...

    www.codeproject.com/Tips/1218208/Generate-Insert-scripts-of-Existing-Rows-with...

    Open SSMS and run usp_CreateInserts.SQL in your DB. Example of generating all inserts from “ Orders ” table: SQL. Shrink . EXEC [dbo].[usp_CreateInserts] @TableName = 'Orders', @FromAndWhere = 'FROM Orders' /* Query will give result in this format. IF NOT EXISTS(SELECT TOP 1 1 FROM Orders WHERE 1=1) BEGIN.

  3. Using SQLite in C#/VB.Net - CodeProject

    www.codeproject.com/Articles/1210189/Using-SQLite-in-Csharp-VB-Net

    The statement below creates a new file based database and creates a table within it (The SQLite system does not (by default) recreate a table. You should receive a corresponding exception, if you execute the statement twice): C#. vb. // create a new database connection: SQLiteConnection sqlite_conn =.

  4. Need a UUID Generator for Postgres? Here are Two Ways to Set One...

    www.codeproject.com/Articles/5318885/Need-a-UUID-Generator-for-Postgres-Here...

    CREATE EXTENSION IF NOT EXISTS " uuid-ossp";. The IF NOT EXISTS clause allows you to avoid re-installing the module. To generate the UUID values based on the combination of the computer’s MAC address, current timestamp, and a random value, you use the uuid_generate_v1() function: SELECT uuid_generate_v1();

  5. Check that Sql Server exists prior to connection - CodeProject

    www.codeproject.com/articles/612751/check-that-sql-server-exists-prior-to...

    Sql Server communicates via a TCP connection to a client. The code below simply attempts to open a socket connection to the specified TCP port of a specified machine. If it fails, it returns false. Sql Server's default port is 1433, but the method accepts a port number as a parameter. You can also use an IP address as the address parameter, or ...

  6. Understanding Service Principal Names for SQL Server Integrated...

    www.codeproject.com/.../5360561/Understanding-Service-Principal-Names-for-SQL-Serv

    Start with the SQL Server log and see if the SPNs were automatically generated or not. If not, check which two SPNs are supposed to exist for the instance, based on the instance name and port number. Use the powershell Test-Connection cmdlet to verify network connectivity. Check if the port number is dynamic or fixed.

  7. An Ultimate Guide to Write an SQL Query - CodeProject

    www.codeproject.com/Articles/5326846/An-Ultimate-Guide-to-Write-an-SQL-Query

    To avoid it, to the ‘CREATE TABLE’ statement, you should also add the ‘IF NOT EXISTS’ statement. Step #4: Start with the Basic SQL Statements. When the table is ready and operational, you can now continue writing SQL queries by inserting data inside the table. Here are all basic statements to input and manage the data inside the table:

  8. Executing Raw SQL Queries using Entity Framework Core 6 -...

    www.codeproject.com/Articles/5321286/Executing-Raw-SQL-Queries-using-Entity...

    Creates a raw SQL query that will return elements of the given generic type. In older Entity Framework versions, there was Database.SqlQuery<T> which used to do a similar thing, but dropped in newer versions/core. Now this generic type mapping can be done in two ways: Mapping data manually. Mapping data automatically.

  9. .NET8/EF8 - Exception: Microsoft.Data.SqlClient ... - CodeProject

    www.codeproject.com/Articles/5388664/NET8-EF8-Exception-Microsoft-Data-Sql...

    If your database is SQL Server 2016 (13.x) or newer, or if you're using Azure SQL, check the configured compatibility level. If the compatibility level is below 130 (SQL Server 2016), consider modifying it to a newer value; If your SQL Server is older, you have no other option than to change the compatibility level in EF

  10. Best Practices in SQL Coding - CodeProject

    www.codeproject.com/Articles/5389951/Best-Practices-in-SQL-Coding

    If we do not need the unique results, use Union all instead of Union. If we just need to verify the existence of a value in a table, prefer EXISTS to IN. The EXISTS process exits as soon as it finds the search value. In contrast, IN will scan the entire table. Avoid Nested Loops. Try to minimize the use of nested loops and subqueries where ...

  11. Holidays Table and GetWorkDays Function in SQL Server -...

    www.codeproject.com/.../5284659/Holidays-Table-and-GetWorkDays-Function-in-SQL-Ser

    Using the Code. When a holiday will fall on Saturday, move it to Friday and when it falls on Sunday, move it to Monday. SQL. create FUNCTION [dbo].[ShiftHolidayToWorkday](@date date) RETURNS date AS BEGIN IF DATENAME( dw, @Date ) = 'Saturday' SET @Date = DATEADD(day, - 1, @Date) ELSE IF DATENAME( dw, @Date ) = 'Sunday' SET @Date = DATEADD(day ...