I have Configured server database with My SQL server 2014. My database montage name.
i have not seen my table in left object explorer . but i have use select query its showing Results but i can't able view table left side.
please any one tell me how to generate Full script my server database. Even also i cant able to see tasks also .. please any one tell i want generate full script .
and tired to get script from i can't able . even i tired stored procedure got script using "Sp_helpText" . how to get script from table using query
Related
I have a linked database in MS SQL Server management Studio. I can query it and get the exact data I need in the format I need with headers and all.
I need a way to automate this query on a schedule and export as a csv automatically.
Currently my process is to open the query in MS SQL SMS, and run the query (which mind you takes 15 minutes to run) and then in the results area right click and "save results as"
I would like to either automate it with in SMS, or be able to script it. What's confusing to me is how to write a script for a linked database.
I noticed that when you right click on the Linked Server there are a couple of options to script. For example, there's "Create To", "DROP To", and "DROP And CREATE To". Each of the scripts seem to be formated in a similar way with the following:
USE [master]
GO
/****** Object: LinkedServer [QREMOTE] Script Date: 2/24/2022 10:59:26 AM ******/
EXEC master.dbo.sp_dropserver #server=N'QREMOTE', #droplogins='droplogins'
GO
I'm not familiar with this scripting and I'm not sure how to use it. Any assistance would be appreciated!
Some background, this is a quickbooks database connected through the QODBC driver in which I'm using SMS to query specific fields from a table that need to be exported in a specific order so they can be imported into another system.
I have set up a linked server on a on a SQL Server 2016 (SP2-CU4) (Windows Server 2012R2 ) for an Oracle DB (version 12.1.0.2.0) for data migration purposes. Now I see all the tables in duplicate and can not explain where this comes from. See the screenshot:
Screenshots
What also seen on the screenshots is that when I call the ORA Info View ALL_TABLES, the tables are NOT duplicated. Also when I click on a table via SSMS via "Script Table as" | "Select To" generate a Select script, all columns are duplicated also.
The whole thing is not a problem for me now, I would still understand where it comes from!
regards Volker
currently im using Sql server 2008 r2 (will soon be upgrading to 2014). I need some help in changing job step properties using script.
I have around 20 jobs with each job having 4 steps.
I'm trying to change the below highlighted option using sql server script. Because manually changing all these options is a difficult task.
Please help me in writing script to remove the output log path, uncheck append to log, check log to table and check append log to table options.
I got the script
EXEC msdb.dbo.sp_update_jobstep #job_id=N'5e998659-8539-45d2-bf4f-874375c0a111', #step_id=1 ,
#output_file_name=N'',
#flags=16
I am using PostgreSQL
PostgreSQL 9.0.12, compiled by Visual C++ build 1500, 32-bit
I have two identical database on same server. I need to fetch data from a particular table from fist database and insert those data into other table in second database. I have read something about "EXTENSION" in postgres but I still don't get idea about how to use it.
So which is the better way to do it?
Any suggestion would help so much. Thank you.
first open
share/contribs/dblink.sql
it is the path where postgreSQL is installed.
when you open this file , you will find some operations. copy it and paste it to the query window of your database and execute.
In my case i have executed this operations on both database.
now you will be able to run following kind of code
select * from dblink('dbname=databasename port=5432; password=P#ssw0rd123','select "id" from "State"')
as P("id" bigint);
I have approximately 100 SQL views that are a variation of this:
select * from RTC.dbo.MyTable
...now I find I need to change the name of the RTC table to something else. Rather than edit one view at a time, is there a way to script out all their drop/create statements to a text file so that I can do a global replacement?
In SSMS right click the database, go to Tasks and select there 'Generate Scripts...'. Select 'Views', select the views you want exported, export.
I'd use PowerShell. If you're not using SQL 2008 Client Tools, install them. Then get the PowerShell client, add the registered snapins (plenty of information out there on how to do that), and then use the directory structure to get to the folder representing your Views.
Then script them using something like:
Get-ChildItems | % {$_.Script()}
Use ScriptOptions to tell it to use an Alter script.
And replace "RTC." with the new database name... and run them using sqlcmd.
PowerShell actually becomes a really nice deployment option too.