SqlServerKudos - Stories tagged with SQL
1
kudos
spam Kudos Remove

SQL SERVER – Difference Between Candidate Keys and Primary Key « Journey to SQL Authority with Pinal Dave

published 927 days, 18 hours, 36 minutes ago posted by pinaldavepinaldave 937 days, 13 hours, 30 minutes ago
Friday, November 06, 2009 5:41:40 PM GMT Tuesday, October 27, 2009 10:48:09 PM GMT
Introduction Not long ago, I had an interesting and extended debate with one of my friends regarding which column should be primary key in a table. The debate instigated an in-depth discussion about candidate keys and primary keys. My present article revolves around the two types of keys. Let us first try to grasp the definition of the two keys. Candidate Key – A Candidate Key can be any column or a combination of columns that can qualify as unique key in database. There can be multiple Candidate Key... (more)
category: Query | clicked: 1 | comment | | source: blog.sqlauthority.com
tags: pinaldave, SQL, SQLAuthority, SQLServer
1
kudos
spam Kudos Remove

SQL Server – Multiple CTE in One SELECT Statement Query

published 1012 days, 20 hours, 4 minutes ago posted by sasa 1017 days, 18 hours, 24 minutes ago
Thursday, August 13, 2009 4:13:26 PM GMT Saturday, August 08, 2009 5:53:53 PM GMT
I have previously written many articles on CTE. One question I get often is how to use multiple CTE in one query or multiple CTE in SELECT statement. Let us see quickly two examples for the same. I had done my best to take simplest examples in this subject. Option 1 : / Method 1 / ;WITH CTE1 AS (SELECT 1 AS Col1), CTE2 AS (SELECT 2 AS Col2) SELECT CTE1.Col1,CTE2.Col2 FROM CTE1 CROSS JOIN CTE2 GO Option 2: / Method 2 / ;WITH CTE1 AS (SELECT 1 AS Col1), CTE2 AS (SELECT COL1+1 AS Col2 FROM ... (more)
category: Query | clicked: 7 | comment | | source: blog.sqlauthority.com
tags: CTE, Pinal Dave, SQL, SQL Authority, SQL Joins, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology
2
kudos
spam Kudos Remove

SQL SERVER – 2008 – Copy Database With Data – Generate T-SQL For Inserting Data From One Table to Another Table « Journey to SQL Authority with Pinal Dave

published 1023 days, 26 minutes ago posted by pinaldavepinaldave 1027 days, 3 hours, 42 minutes ago
Monday, August 03, 2009 11:51:18 AM GMT Thursday, July 30, 2009 8:35:17 AM GMT
Just about a year ago, I had written on the subject of how to insert data from one table to another table without generating any script or using wizard in my article SQL SERVER – Insert Data From One Table to Another Table – INSERT INTO SELECT – SELECT INTO TABLE. Today, we will go over a similar question regarding how to generate script for data from database as well as table. SQL Server 2008 has simplified everything. Let us take a look at an example where we will generate script database. In our exam... (more)
category: Query | clicked: 1 | comment | | source: blog.sqlauthority.com
tags: SQL, SQLAuthority, SQLServer
1
kudos
spam Kudos Remove

SQL SERVER – List All Missing Identity Values of Table in Database « Journey to SQL Authority with Pinal Dave

published 1028 days, 7 minutes ago posted by pinaldavepinaldave 1030 days, 1 hour, 5 minutes ago
Wednesday, July 29, 2009 12:11:04 PM GMT Monday, July 27, 2009 11:12:30 AM GMT
The best part of any blog is when readers ask each other questions. Better still, is when a reader takes the time to provide a detailed response. A few days ago, one of my readers, Yasmin, asked a very interesting question: How we can find the list of tables whose identity was missed (not is sequential order) within the entire database? A big thank you to SQL Server Expert, Imran Mohammed, for his excellent response to this question. He also provided an extremely impressive script, which is well descr... (more)
category: Query | clicked: 1 | comment | | source: blog.sqlauthority.com
tags: pinaldave, SQL, SQLAuthority, SQLServer
Previous 1 2 3 Next