Questions tagged [generate-scripts]

23 questions
10
votes
9 answers

Get the T-SQL CREATE statement for SQLCLR stored procedures

I have an application that retrieves the text of stored procedures using sp_helptext. It works great on all my stored procedures except for CLR stored procedures. If I try to use sp_helptext on a SQLCLR stored procedure, I get this error: There…
JosephStyons
  • 57,317
  • 63
  • 160
  • 234
9
votes
2 answers

SQL Server 2012 : How to script all database stored procedures into separate .sql files?

I want to script all the stored procedures from SQL Server 2012 to Visual Studio 2012 as .sql files (in a different project). How do I do that? I want one .sql file for each stored procedure? I get the scripts using the Generate Scripts in Tasks…
user5821224
5
votes
6 answers

Import Existing Stored Procedures In SQL Server

I restored my development database from production, and the stored procedures I need in my development environment doesn't exist in my production database. Is there a command Ii can use to import the developmetn stored procedures back into SQL…
Chris
  • 6,702
  • 8
  • 44
  • 60
3
votes
2 answers

How to create "Script Generator Options" scripts in SQL Server?

I have a SQL Server database and whenever I want to make a backup of the database, first generate a Drop and Create Script of the DB. Because by this way I can make my database in every version of SQL Server. Regardless of the version and…
Behzad
  • 3,502
  • 4
  • 36
  • 63
2
votes
1 answer

How to script sql server database diagrams in sql server 2005?

I use sql server 2005 as my database for my web application.... I generated scripts of the database by, Database->Right Click->Tasks->Generate Scripts I can script all my Tables,Stored Procedures,User Defined functions,Views,Users.... All i missed…
ACP
  • 34,682
  • 100
  • 231
  • 371
2
votes
2 answers

SQL Server Generate Scripts with Identity Insert

When generating database scripts, I'm scripting data to be migrated to a different environment. Is there a setting in the script generation that I can enable to set IDENTITY_INSERT on/off automatically so I don't have to go through each table…
Adam Levitt
  • 10,316
  • 26
  • 84
  • 145
1
vote
1 answer

SQL Server SQLCLR function receives parameter error after copying from one DB to another

I am trying to copy the send email assembly from one database to another. I clicked on script assembly as create to and created it in the new db. When I try to send an email with the function in the newer db I get the following error: The…
user829982
  • 121
  • 1
  • 2
  • 8
1
vote
1 answer

SQL Advanced scripting options

I want to generate a script which will give me an "insert" query with data from my existing database, but only top 1000 rows ordered by ID from each table. I tried to generate a query for a single table by using "Generate scripts..." which is…
Mateusz
  • 324
  • 1
  • 12
1
vote
1 answer

generate script to create only a single row

I was referencing this question How to export all data from table to an insertable sql format? while looking for a way to create an insert statement for a single row from a table without having to manually write it since the table has many columns.…
Don
  • 77
  • 2
  • 6
1
vote
3 answers

Create database, tables and stored procedure using existing script from txt file using C#

I have developed a winform application using C# and SQL Server 2008. Now my job is to implement it on client's machine. I am looking for the best way to create the database tables and stored procedure on client machine to run this application. I…
prograshid
  • 876
  • 3
  • 12
  • 32
0
votes
0 answers

Visual Studio 2019 publish.xml script not recreating all procedures after db Drop

I and a coworker are having this issue intermittently in VS 2019, where the publish.xml script that publishes DB changes is not publishing all the sprocs it is supposed to. The sprocs that are missing do not get added to the SQL script generated by…
DrJaul
  • 73
  • 7
0
votes
0 answers

How do use Sqlcmd to migrate full databases (not just tables)?

I am working on migrating databases from a 2017 SQL server to a 2016 version. The databases I am working with are hundreds of gigabytes so I am using generate script along with sqlcmd to restore. However, when I restore the database on the new…
0
votes
1 answer

Using SSMS 2014, how to generate efficient insert scripts?

When generating INSERT scripts for tables in SSMS 2014, the output of the generated script is in the format of: INSERT [schema].[table] (
Daniel Bragg
  • 1,773
  • 1
  • 12
  • 25
0
votes
0 answers

SQL Server 2014 Generate Scripts ignoring dependency order

We have a SQL Server database deployed out into multiple environments. Usually when we export the data out using Tasks --> Generate Scripts the dependency order is maintained and the resulting script can be run into a fresh database with the same…
Neil
  • 159
  • 10
0
votes
0 answers

Generate script for backup. Invalid symbol in script

INSERT [dbo].[ProcessingJob] ([DF], [ICNumber], [StationId], [UserId], [RecvDate], [StartDate], [CompleteDate], [BatchNumber], [GB1_D01], [GB1_D02], [GB1_D03], [GB1_D04], [GB1_D05], [GB1_D06], [GB1_D07], [GB1_D08], [GB1_D09],…
Xuan
  • 1
  • 2
1
2