|
|
-
|
|
Run the following code
select ' ' ' ' -- Query 1
select '''' -- Query 2
How does the first query return single space whereas the second query returns single single quote?...
|
|
-
|
|
Run this code
select $k
You will get following error
Msg 126, Level 15, State 1, Line 1
Invalid pseudocolumn "$k".
What is the pseudocolumn in SQL Server?......
|
|
-
|
|
Out of these four queries, only one query will throw an error. Without running these queries find out the query and error message that it would generate.
Queries
Query 1 : select top 1 1 from sysobjects,syscolumns where 1=1
Query 2 : select top 1 1 from syscolumns,syscolumns where 1=1
Query 3 : ......
|
|
-
|
|
Without running the query, can you guess the answer?
Query
select 100.-89_90
Answers
Answer 1 : Incorrect syntax near .
Answer 2 : _79
Answer 3 : Incorrect syntax near 89_90
Answer 4 : 11
......
|
|
-
|
|
Table and Database designers
and uncheck......
|
|
-
|
|
BCP is one of the fastest methods to export data to various formats like csv,txt,etc and doing this in a command mode is faster than doing it via SSMS.
Let us create this simple tablecreate table test(id int, name varchar(50))
insert into test(id,name)...
|
|
-
|
|
Often developers use Import wizard from SSMS or SSIS to import data from a text file into a table. You may or may not import it successfully based on the nature of the data.
Create a text file named test.txt with the following data
id|name|address1|rame...
|
|
-
|
|
Often I see lot of SQL deveopers complaining about the error when using datetime values in their queries. The common error that almost everyone would heard about is "Conversion failed when converting date and/or time from character string."
But in gener...
|
|
-
|
|
In this series at Part 1 Removing unwanted characters , I posted a method that used a function. In part 2 I posted a method that used Dynamic SQL. Here is another improved method that uses Dynamic SQL
--Create test data
create table #data (data varchar(100))
insert #data
select 'tes^@&t......
|
|
-
|
|
As you know I have started a new series on "Exploring SSMS" by which I will be posting some features that are available in SSMS which will be very helping during the development. In this post we will see how to open query window at default when opening SSMS.
When you start SSMS, by default it opens......
|
|