|
|
-
abhIShek BandI Posted 1 Years ago through Just Learned | 5 Points
We know Data length won't trim the leading spaces.
And it wont give the length of string, It will return how many bytes the string occupied.
CREATE TABLE #TBL(NVAR NVARCHAR(100) , [VAR] VARCHAR(100))
INSERT INTO #TBL VALUES(' ABHISHEK BANDI ',' ABHI
|
-
abhIShek BandI Liked 1 Years ago through Just Learned | 1 Point
We know Data length won't trim the leading spaces.
And it wont give the length of string, It will return how many bytes the string occupied.
CREATE TABLE #TBL(NVAR NVARCHAR(100) , [VAR] VARCHAR(100))
INSERT INTO #TBL VALUES(' ABHISHEK BANDI ',' ABHI
|
-
abhIShek BandI Liked 2 Years ago through Just Learned | 1 Point
Today I learned an tip from my colleague about finding the last executed statement for a process in SQL Server.
[code]
DBCC INPUTBUFFER (52)
[/code]
Here 52 is the SPID, that we want to check last executed statement
|
-
abhIShek BandI Liked 2 Years ago through Just Learned | 1 Point
Inorder to change the owner of the table to dbo, we can do like this.
[code]
sp_changeobjectowner '<tablename>', 'dbo'
GO
[/code]
|
RKA
91
·
2% ·
598
|
|
-
abhIShek BandI Liked 2 Years ago through Just Learned | 1 Point
Suppose you are maintaining some notes in a notepad on a daily basis and you want to add current date and time whenever you finish so that you can keep track of when notes are added. While working in a notead, Press F5 and it will insert current date and t
|
-
abhIShek BandI Liked 2 Years ago through Just Learned | 1 Point
This very simple statement allows you to count how many times a certain character appears in a string.
[code]
Select Len('///xxx') - Len(Replace('///xxx', '/', ''))
[/code]
|
-
abhIShek BandI Liked 2 Years ago through Just Learned | 1 Point
GO command is not only a batch seperator but also acts as while loop starting from version 2005.Run this code and see the output
[code]
select 1
Go 5
[/code]
|