|
|
-
14 Liked
| 10 Learned
| 3 Comments
|
|
Hello friends, one interviewer asked that suppose you have two tables
`Employee_Details`, `Employee_Details_History`
now I want to delete original table `Employee_details` and maintain it’s history to other table.
How can it’s possible with only sin...
|
|
-
10 Liked
| 10 Learned
| 10 Comments
|
|
Normally, people uses PARSENAME fuction to retrieve Server,Database,Owner and Object from four part query.
Here is another use of same to remove decimal points
SELECT PARSENAME('$12,345.00',2) -- $12,345...
|
|
-
13 Liked
| 10 Learned
| 9 Comments
|
|
Sometimes when SQL Server is configured to use some port other than default port number (1433), then you may not be able to connect directly in SSMS just by specifying the name of the server in the **Server Name** field in **Connection to Server** dialo...
|
|
-
10 Liked
| 10 Learned
| 4 Comments
|
|
As we know, automatically created statistics, as can be see with
SELECT * FROM sys.Stats WHERE object_id LIKE OBJECT_ID('MyTable')
(only change 'MyTable' for something else), has name starting with _WA_Sy_.
Were you ever curious what wa...
|
|
-
|
|
The Regex functions are useful for changing the format of existing strings, for example, suppose you want to display Phone no in (ddd) ddd-dddd format instead of ddd-ddd-dddd. To do this, Right click on the required textbox --> click expression... and e...
|
|
-
|
|
Just learned from Pinal's blog about right align the numeric value in output pane of SSMS.
Go to Tools -> Options -> Query Results -> Results to Text, Check the checkbox, "Right align numeric values"
Once this setting has been done, when the query is...
|
|
-
10 Liked
| 10 Learned
| 2 Comments
|
|
Set `ARITHABOBRT` and `ANSI_WARNINGS` as OFF to handle division by Zero error
SET ARITHABORT OFF
SET ANSI_WARNINGS OFF
SELECT 1/0
This will not throw an error. Result will be NULL
...
|
|
-
17 Liked
| 10 Learned
| 12 Comments
|
|
Sometimes it happens that we need random row (or set of randoms rows) from table.
Itzik Ben-Gan shows us, in one of his book, the efficient way to do this:
SELECT TOP(1) * FROM someTable ORDER BY NEWID()
Changing the value in TOP operator, we can, in...
|
|
-
|
|
Just learned that in SSIS 2008 Script task skips Breakpoints in run in 64 bit environemnt. Goto solution porperties -> Debugging and set Run64bitRuntime to False and the Script task will start debugging....
|
|
-
|
|
Microsoft announced that SQL Server ODBC Driver for Linux will be available along with next version of SQL Server 2012 at Pass Summit 2011.......
|
|