How to save SQL generated from Dapper? - sql-server

How to save SQL generated from Dapper?
I tried MiniProfiler, but proper code to get SQL is not available. I am using .NET Core and Dapper. I am executing procedure through Dapper. Database being is SQL Server 2016.

Related

Create view in Oracle SQL Developer from Microsoft SQL Server Management Studio

I have two databases; SQL Server uses SSMS to connect and Oracle DB uses Oracle SQL Developer to connect.
I want to create a view in Oracle database from SSMS.
I tried this code in SSMS:
CREATE VIEW LINKDB_ORACLE..user_oracle.ViewCreate_OnOracle
AS
SELECT UserId, UserName
FROM [dbo].[Users]
When I run this query, I get this error:
The object name 'LINKDB_ORACLE..user_oracle.ViewCreate_OnOracle' contains more than the maximum number of prefixes. The maximum is 2.
How to I can query data from SQL Server use Oracle SQL Developer, if not use view method above.
I use SQL Server 2012 and Oracle 12c
You can't use this syntax, it will be easier to create all views using Oracle Tools.
From Microsoft documentation:
A view can be created only in the current database. The CREATE VIEW must be the first statement in a query batch.
Create-view-transact-sql
If you have to use SSMS, you can try syntax:
EXEC ('CREATE VIEV...') AT linked_server
If you want to see SQL Server data from Oracle database, then check this post:
Oracle equivalent for linked server

How to dump SQL Server Express schema to github?

At the moment I'm using SQL Server Management Studio and stored procedures to execute all my API calls. I'm wondering where could I get started if I wanted to transfer the schema and queries within my stored procedures to github. Thanks!

Migration from SQL Server 2005 to SQL Server 2012 - Stored Procedure issue

I'm migrating to SQL server 2012 and after attaching the database to SQL server 2012, I found that I have a lot of stored procedures that building query using concatenate text.
How could I validate the script that written in this way?
And how could I make sure that proc's syntax valid?
thanks in advance
You will have to execute each of them and make sure they work. Even normal stored procedures can break after migrating to SQL Server 2012, in particular if they use OPENROWSET or OPENQUERY.

How to insert multiple records from Vb.net to SQL Server 2005 table?

I have 40000 records in my DataTable. I want to insert all the records into SQL Server.
I am using vb.net 2008 and SQL Server 2005.
Currently I am using XML to pass from vb.net to SQL Server 2005 but it will give me network error. Is there any other way I can achieve this ?
Look at the SqlBulkCopy class:
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.aspx

Get XML schema from database schema (SQL Server 2008 diagram)

Get XML schema from database schema (SQL Server 2008 diagram)
I am using SQL Server 2008. Is their is a way to do this in the SQL studio enterprise manager?
Rather than write code or use an external tool
SQL Server Management studio doesn't provide a way to do this.
Pasting the following into a code window gives you something close:
select * from INFORMATION_SCHEMA.COLUMNS for xml auto
Failing that, the answer is no, not without writing code or using an external tool.

Resources