-
Microsoft SQL Server Management Studio Express
Microsoft SQL Server Management Studio Express (SSMSE) is a free, easy-to-use graphical management tool for managing SQL Server 2005 Express…
-
Sql : Database Unknown Owner
SELECT Name AS DBName,suser_sname(sid) AS Owner FROM master.dbo.sysdatabases WHERE suser_sname(sid) IS NULL If you get any results, you can set…
-
SQL : Clone Table
This is short articel – Clone Table Script, we have seen how we can backup or create clone via using…
-
SQL: ALTER Columns Statement to update NULLs to Not NULLs
SQL: This example updates allow NULLs to Not Nulls. ALTER TABLE dbo.tbl_temp ALTER COLUMN UserName VARCHAR(256) NOT NULL
-
SQL – Server – Cannot resolve the collation conflict between “SQL_Latin1_General_CP1_CI_AS” and “Chinese_PRC_CI_AS”
Cannot resolve the collation conflict between “SQL_Latin1_General_CP1_CI_AS” and “Chinese_PRC_CI_AS” in the equal to operation. Check YourFieldName NVARCHAR(20) in Create Table…
-
SQL Server – finding duplicate records in sql
The col1 in a table that exist more than once. SELECT Col1, COUNT (Col1) AS NumOccurrences FROM TBL GROUP BY Col1…
-
CHARINDEX (Transact-SQL)
Syntax: CHARINDEX ( expressionToFind ,expressionToSearch [ , start_location ] ) A. Returning the starting position of an expression The following…
-
Add new columns to existing table. Using by Alter Table.
Add new columns to existing table ALTER TABLE [YOURDATABASENAME].[dbo].[YOURTABLE] ADD NEWCol1 NVARCHAR(20); ALTER TABLE [YOURDATABASENAME].[dbo].[YOURTABLE] ADD NEWCol2 DATETIME; ALTER TABLE…
-
Insert into temp table with Union All in SQL
If you are trying to insert all records from multiple tables to one temp table, the following codes may help.…
-
SQL Zero Date Time
Someone may need to use Zero Date instead of null with datetime datatype SELECT CONVERT(DATETIME,’1900–01–01 00:00:00.000′) Return Result: 1900-01-01 00:00:00.000