Browse by Tags

Tagged Content List
  • Wiki Page: Recorrer las filas de una tabla mediante Transac-SQL (es-ES)

    Basado en este articulo Se trata de un pequeño script escrito en Transac-SQL para que a partir de los campos obtenidos en una tabla recorrerlo uno por uno y del texto de cada fila guardar en otra tabla cierto valor: Suponiendo que tengamos que de esta tabla mas especificamente...
  • Wiki Page: SQL Server Result Set In An HTML Email

    The Problem Picture the situation: you have a collection of data that you've been working on to summarise. You've finally found a way of displaying the data in an effective format, but you've overlooked one essential task: how are you going to relay this information back to the audience...
  • Wiki Page: T-SQL: RIGHT, LEFT, SUBSTRING and CHARINDEX Functions

    Table of Contents ​RIGHT and LEFT CHARINDEX ​SUBSTRING ​USING THEM TOGETHER This article explains the functionality and uses of the LEFT, RIGHT, SUBSTRING and CHARINDEX functions in SQL. This article will leave you with sound knowledge and understanding that you can take away and questions...
  • Wiki Page: EOMONTH() Function Usage in SQL Server 2012 and On

    The EOMONTH() function is new in SQL Server 2012. BOL link: http://technet.microsoft.com/en-us/library/hh213020.aspx In the previous version (SQL Server 2008), a popular albeit obscure way to get the end of the month: SELECT CONVERT ( DATE , dateadd(mm, datediff(mm,0, current_timestamp...
  • Wiki Page: Different Methods to get nth maximum salary in a given table

    There are many methods to get N-th Maximum salary in a table.Here are few methods. CREATE TABLE EMP ( EMPNO INT NOT NULL , ENAME VARCHAR (10), JOB VARCHAR (9), MGR INT , HIREDATE DATE , SAL INT , COMM INT , DEPTNO INT ) INSERT ...
  • Wiki Page: Presentation Transcript: Introducing SQL Server 2012 Transact-SQL Improvements

    SQL11UPD03-TSCRIPT-01 This wiki is a transcript of a previously recorded video. Related content assets: Presentation: Introducing SQL Server 2012 Transact-SQL Improvements ( SQL11UPD03-DECK-01 ) Video: Introducing SQL Server 2012 Transact-SQL Improvements ( SQL11UPD03-REC-01 ) Table...
  • Wiki Page: T-SQL: Table Sizes in SQL Server

    --one table sp_spaceused 'TABLE_NAME' --all tables EXEC sp_MSforeachtable 'EXEC sp_spaceused ''?''' --OR IF OBJECT_ID ( 'tempdb..#TableSize' ) IS NOT NULL DROP TABLE #TableSize CREATE TABLE #TableSize ( SEQ INT IDENTITY...
  • Wiki Page: Windows Azure SQL Database Firewall (en-US)

    To help protect your data, the Windows Azure SQL Database firewall prevents all access to your SQL Database server until you specify which computers have permission. The firewall grants access based on the originating IP address of each request. The SQL Database firewall can be managed via Windows...
  • Wiki Page: Fragmentation Percentage of all tables in a SQL database

    The SQL Server Database Engine automatically maintains indexes whenever insert, update, or delete operations are made to the underlying data. Over time these modifications can cause the information in the index to become scattered in the database (fragmented). Fragmentation exists when indexes have...
  • Wiki Page: SCCM 2007: Create Report of Upcoming Maintenance Windows by Client

    How To Calculating the next maintenance window in SCCM is a bit troublesome as you normally have to use WMI to get the data structure that makes up the schedule. What if you want to write a SCCM report? The following table-valued function will calculate the next date/time of a maintenance window...
  • Wiki Page: Truncate a table

    When we try to TRUNCATE a table whose columns are referenced by a FOREIGN KEY constraint it will always gives us an error: Cannot truncate 'table_name' because it is being referenced by a FOREIGN KEY constraint. But what if a column is referencing its own table itself. Let see the below...
  • Wiki Page: Windows Azure SQL Database Billing Numbers Directly From Transact-SQL

    Windows Azure SQL Database exposes two Dynamic Managed Views called sys.database_usage and sys.bandwidth_usage that show you the activity for your account. These can queried to understand your account usage from a billing perspective. Table of Contents Disclaimer Database Usage Summary Disclaimer...
  • Wiki Page: SQL Server Batch Update

    Always we should take care of database server performance but sometimes you need to perform a huge update on your table/tables this will affect performance for concurrent users and they will complain about it. For example if you have a table contains more than billion row and you want to update a...
  • Wiki Page: End of Month Function (id-ID)

    Gak sengaja lagi buka-buka BOLnya SQL Server 2012 kemudian menemukan sebuah function baru dalam pengelolaan tanggal yaitu function End of Month atau ditulis dengan EOMonth() Biasanya kalo kita mau mencari tanggal berapa sebuah bulan berakhir, kita dapat menggunakan cara berikut : DECLARE...
  • Wiki Page: PAGING windows in T-SQL (id-ID)

    di SQL Server 2012 ada metode baru untuk mendapatkan beberapa baris data melalui klausa Select sehingga didapatkan jumlah baris data sesuai yang diinginkan sesuai dengan nilai row offset dan row value yang sudah ditentukan sehingga jumlah record yang di presentasikan di client dapat diatur dengan mekanisme...
  • Wiki Page: SQL Server: How to Find the First Available Timeslot for Scheduling

    In a scheduling application, it may be desirable to find the first available schedule time (timeslot) for a new appointment. The new appointment must fit completely between existing appointments -without overlap. As the schedule fills, new entries are assigned to the next first available schedule...
  • Wiki Page: Inserting Data into 2 Tables with 1 Statement without Trigger (id-ID)

    Biasanya kita menggunakan trigger untuk dapat melakukan memasukkan data ke dalam 2 tabel yang berbeda sekaligus. 1 tabel target yang akan dimasukkan data yang kemudian dibuatkan trigger yang kemudian trigger tersebut akan melakukan proses insert ke tabel ke 2. Namun dalam perkembangannya, Insert...
  • Wiki Page: Processing NOAA Flash Flood Guidance Data In SQL Server

    Author: Ed Katibah (Microsoft) During the recent major weather event, Hurricane Sandy, NOAA published weather forecast information which would be very useful to use in the analysis of the storm. In this particular case, the data was made available as an Esri Shapefile from the following location...
  • Wiki Page: How MS SQL Compiler Does Internal Data Type Casting

    Now lets take few test to get to the conclusion; See how the MS SQL compiler works, MS SQL compiler is smart enough to do the conversion (implicit type casting) for columns. For 'Test 1' MS SQL compiler converts all values of 'ID' column to 'INT', how it decides to...
  • Wiki Page: Comando MERGE (pt-BR)

    Nota de Migração : Este artigo foi migrado para o Portal Wiki em Português. O conteúdo será atualizado aqui http://social.technet.microsoft.com/wiki/pt-br/contents/articles/12574.comando-merge.aspx . Vamos ver um pouco sobre um novo comando do SQL Server 2008...
  • Wiki Page: Count(*) x Count(1) x Count(PK) (pt-BR)

    Nota de Migração : Este artigo foi migrado para o Portal Wiki em Português. O conteúdo será atualizado aqui http://social.technet.microsoft.com/wiki/pt-br/contents/articles/12573.count-x-count-1-x-count-pk.aspx . Muitos desenvolvedores questionam sobre o Count...
  • Wiki Page: Menu Recursivo usando CTE (pt-BR)

    Nota de Migração : Este artigo foi migrado para o Portal Wiki em Português. O conteúdo será atualizado aqui http://social.technet.microsoft.com/wiki/pt-br/contents/articles/12572.menu-recursivo-usando-cte.aspx . Segue abaixo um código utilizado para...
  • Wiki Page: SET x SELECT (pt-BR)

    Nota de Migração : Este artigo foi migrado para o Portal Wiki em Português. O conteúdo será atualizado aqui http://social.technet.microsoft.com/wiki/pt-br/contents/articles/12570.set-x-select.aspx . Uma dúvida comum está relacionada ao uso do...
  • Wiki Page: IDENTITY (pt-BR)

    Nota de Migração : Este artigo foi migrado para o Portal Wiki em Português. O conteúdo será atualizado aqui http://social.technet.microsoft.com/wiki/pt-br/contents/articles/12569.identity.aspx . Em muitas situações, você deseja saber o...
  • Wiki Page: DICA - Cuidado com OR (pt-BR)

    Nota de Migração : Este artigo foi migrado para o Portal Wiki em Português. O conteúdo será atualizado aqui http://social.technet.microsoft.com/wiki/pt-br/contents/articles/12567.dica-cuidado-com-or.aspx . Sempre que possível substituir condições...
Page 3 of 4 (87 items) 1234
Can't find it? Write it!