I have a 2013 excel dynamic spread sheet. It is using a query that is linked to SQL Server Management Studio. There is a DateTime line in the sql query that I want to update with a specific date every time the dynamic spread sheet is opened/refreshed. It seems to me that there is a way to add a pop up window that will ask for a date which will then update the sql query. Thank you for any input.
Related
Using Microsoft Query I'm trying to setup a sql data source for an Excel pivot table, specifically when the sql contains a table valued function. The sql shown in the picture below is how it successfully runs in SSMS.
I've used sql as a data source many times for an Excel pivot table, but never when the sql is using a table valued function as a table source.
I'm getting the following error when I try to add it as the data source for my excel connection.
When I returned to Excel from MS query I was able to update the sql there. It then worked.
I have a SQL Server table with some row (max 6000). With Excel vba, I can create a query and the results can show in a sheet.
Next I can change some record in the worksheet.
After all I can make a copy from the original sheet and after some cells changed I compare all the cells and I can update in the SQL Server database only the different cells.
My question is there a simpler way to do this?
Maybe after I leave a cells the vba compare the before/after content and make an update if required?
Thanks your opinions!
This is the VBA event you should use to catch if a cell is changed:
https://msdn.microsoft.com/en-us/vba/excel-vba/articles/worksheet-change-event-excel
If you don't want to spend much time on it, I have created an Excel AddIn which updates data from Excel to SQL Server. It is a commercial product, but if it is a one time job there is a fully functional 14-day trial which you can download from
https://sqlspreads.com
i have next query
select no,
item
from myTable
and I get next table
no item
1 a
2 b
3 c
4 d
I use tsql, Microsoft SQL Server Management Studio.
Is there any way to write here some code to export table from my select in excel...
I am not aware of any way to write a query in SSMS and then export the results to excel, but you can connect an excel sheet to SQL Server and run queries into an data table from there using the From Other Sources - From SQL Server menu in the Data tab on the ribbon:
This is good if you want to build on that data within Excel and you need to refresh the data but don't want to update your formulas. There are obviously security implications with this as users of the Worksheet may be able to access other data on your server.
If you want to simply export an Excel file with data in to a file store, you would need to use SSRS and a report subscription. Alternatively, if you simply want to save the results of your query to a file, you can either copy and paste manually or choose to Save Your Results To Text in SSMS:
from your excel sheet you can create a dynamic connection between a SQL Server database and your Excel workbook.
Follow the steps in below link.
Steps to Connect a SQL Server database to your workbook
I have a query which is written in SQL Server and this gives me what I require.
I have a new requirement to add a Sharepoint Data source field on to the same SQL Query and perform some matching against them.
I know how to add a Sharepoint source as a Datasource within SSRS, however not quite sure how this can be implemented within SQL itself?
Note: my front end for the SQL query is SSRS i.e. once all sorted on SQL, I copy across to SSRS and design accordingly.
I'm new to SQL Server and today I began writing an SQL query. While writing SQL queries in SSMS (SQL Server Management Studio) for insert statements, I noticed that only table names were getting auto completed, but there is no option to auto complete the column name. Is there any way to autocomplete column names in a query?
INSERT INTO table_name (column1,column2,column3,...)
/* Here table name is auto completed. When i type a,a related tables were generated, but for columns there is no autocomplete. */
VALUES (value1,value2,value3,...);
Assuming you are using SQL Server Management Studio (SSMS), which most use people use when working with SQL Server, there is a weaker built in Intellisense that will fill in certain parts of SQL queries for you. If you want something stronger, you can check out third party addins. The most popular are probably SQL Prompt by Red Gate and SQL Complete by dbForge.