Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove the date/time in SQL script generated using SSMS?

When I generate scripts in SQL Server 2008 Management Studio, it seems to insert the date/time in the script also.

For example:

USE [AdventureWorks]
GO

/****** Object:  View [dbo].[vw_test]    Script Date: 18/01/2017 3:27:10 PM ******/
SET ANSI_NULLS ON
GO
<rest of script goes here>

How can I remove that?

like image 235
mrblah Avatar asked Jul 28 '09 21:07

mrblah


People also ask

How do I truncate a date and time in SQL?

In Oracle there is a function (trunc) used to remove the time portion of a date. In order to do this with SQL Server, you need to use the convert function. Convert takes 3 parameters, the datatype to convert to, the value to convert, and an optional parameter for the formatting style.


1 Answers

Tools.. Options.. SQL Server Object Explorer..Scripting

Probably need to set "Include Descriptive Headers" = false

However, your question is unclear so this is a guess.

like image 90
gbn Avatar answered Nov 11 '22 10:11

gbn