Open links in new tab
  1. How to print VARCHAR (MAX) using Print Statement?

    Oct 21, 2011 · DECLARE @def as nvarchar(MAX) DECLARE @prt1 as nvarchar(4000) DECLARE @prt2 as nvarchar(MAX) DECLARE @pos1 as int DECLARE @pos2 as int in my …

  2. sql - How to convert DateTime to VarChar - Stack Overflow

    I need to convert a value which is in a DateTime variable into a varchar variable formatted as yyyy-mm-dd format (without time part). How do I do that?

  3. What is the difference between varchar and nvarchar?

    An nvarchar column can store any Unicode data. A varchar column is restricted to an 8-bit codepage. Some people think that varchar should be used because it takes up less space. I …

  4. SQL Server Text type vs. varchar data type - Stack Overflow

    From the docs: Important ntext , text, and image data types will be removed in a future version of Microsoft SQL Server. Avoid using these data types in new development work, and plan to …

  5. Convert float into varchar in SQL Server without scientific notation

    Jun 29, 2011 · Convert float into varchar in SQL Server without scientific notation and trimming decimals. For example: I have the float value 1000.2324422, and then it would be converted …

  6. How to insert a line break in a SQL Server VARCHAR/NVARCHAR …

    How to insert a line break in a SQL Server VARCHAR/NVARCHAR string Asked 17 years, 3 months ago Modified 1 year, 3 months ago Viewed 1.6m times

  7. guid - SQL Server: converting UniqueIdentifier to string in a case ...

    I don't know why I'd pick nvarchar, much less nvarchar(50). A unique identifier, when converted to a text value is treated in hex-dash-36.

  8. What is the difference between char, nchar, varchar, and nvarchar …

    Jun 27, 2013 · 45 nchar and char pretty much operate in exactly the same way as each other, as do nvarchar and varchar. The only difference between them is that nchar/nvarchar store …

  9. SQL Server Convert Varchar to Datetime - Stack Overflow

    Jan 30, 2013 · I have this date format: 2011-09-28 18:01:00 (in varchar), and I want to convert it to datetime changing to this format 28-09-2011 18:01:00. How can I do it?

  10. sql - A table name as a variable - Stack Overflow

    For static queries, like the one in your question, table names and column names need to be static. For dynamic queries, you should generate the full SQL dynamically, and use sp_executesql to …