Tag: server

57 votes
14 answers
990 views
How do I escape a single quote in SQL Server?

I am trying to insert some text data into a table in SQL Server 9. The text includes a single quote '. Ho

avatar
Kristopher
0 1 0 9
asked 07 September, 2021
57 votes
6 answers
2.6K views
Difference between JOIN and INNER JOIN

Both these joins will give me the same results: SELECT * FROM table JOIN otherTable ON table.ID = otherTable.

avatar
Scot
0 1 0 9
asked 07 September, 2021
60 votes
14 answers
3.1K views
SQL Server - Best way to get identity of inserted row?

What is the best way to get IDENTITY of inserted row? I know about @@IDENTITY and IDENT_CURRENT and SCOPE_IDE

avatar
Dorinda
0 1 0 9
asked 07 September, 2021
63 votes
16 answers
2.6K views
How can I do an UPDATE statement with JOIN in SQL Server?

I need to update this table in SQL Server with data from its 'parent' table, see below: Table: sale

avatar
Freida
0 1 0 9
asked 07 September, 2021
63 votes
15 answers
385 views
How can I delete using INNER JOIN with SQL Server?

I want to delete using INNER JOIN in SQL Server 2008. But I get this error: Msg 156, Level 15, State 1, L

avatar
Jefferey
0 1 0 9
asked 07 September, 2021
57 votes
30 answers
1.9K views
How do I perform an IF...THEN in an SQL SELECT?

How do I perform an IF...THEN in an SQL SELECT statement? For example: SELECT IF(Obsolete = 'N' OR

avatar
Joseph
0 1 0 9
asked 07 September, 2021
62 votes
30 answers
1.3K views
Insert results of a stored procedure into a temporary table

How do I do a SELECT * INTO [temp table] FROM [stored procedure]? Not FROM [Table] and without defining [temp

avatar
Chelsea
0 1 0 9
asked 07 September, 2021
60 votes
30 answers
2.9K views
How to return only the Date from a SQL Server DateTime datatype

SELECT GETDATE() Returns: 2008-09-22 15:24:13.790 I want that date part without the time part: 2008-09-22 0

avatar
Corrin
0 1 0 9
asked 07 September, 2021
67 votes
30 answers
891 views
How to concatenate text from multiple rows into a single text string in SQL Server

Consider a database table holding names, with three rows: Peter Paul Mary Is there an easy way to turn this i

avatar
Xavier
0 1 0 9
asked 07 September, 2021
63 votes
30 answers
409 views
Add a column with a default value to an existing table in SQL Server

How can I add a column with a default value to an existing table in SQL Server 2000 / SQL Server 2005?

avatar
Dorinda
0 1 0 9
asked 07 September, 2021
61 votes
30 answers
1.7K views
How do I UPDATE from a SELECT in SQL Server?

In SQL Server, it is possible to insert rows into a table with an INSERT.. SELECT statement: INSERT INTO Table

avatar
Jefferey
0 1 0 9
asked 07 September, 2021
65 votes
4 answers
1.8K views
What are Long-Polling, Websockets, Server-Sent Events (SSE) and Comet?

I have tried reading some articles, but I am not very clear on the concepts yet. Would someone like to take a

avatar
Wei
0 1 0 9
asked 07 September, 2021