Equivalent T-SQL to Microsoft Access - sql

I am trying to replicate my T-SQL script written in Microsoft SQL Server Management Studio to Microsoft Access Query Design.
I have pretty much figured out most of the script except the following;
convert(char, 'Approved') as status
or rather
status = 'Approved'
How would i write any of those two into Microsoft Access SQL Designer?

Related

How to check SQL Server 2008 script will work properly on SQL Server 2005

Is there a way (a tool) to check that a SQL Server 2008 script will run on SQL Server 2005?
Open up SQL Management studio, rt mouse click on the database name, select properties, select option, set compatability level. Test. A far as is known, when the compatabailty level is set to a (lower) level, functionality is disabled and errors raised entirely in line with the selected level. MS are a bit relctant to comit http://msdn.microsoft.com/en-gb/library/bb510680.aspx but in practice I've not found any issues. You can of course install an instance of the 2005 build and bulk insert for a really thorough check.
You can use SQL Fiddle for SQL Server 2008
At the left top you can select the RDMS

What is the difference between MSSQL and TSQL?

MSSQL and T-SQL are often thrown around as interchangeable synonyms on the web.
I know that T-SQL is a flavor of SQL used in many Microsoft products. Is MS-SQL actually another flavor of Microsoft owned SQL or is it just an umbrella term used by the Microsoft’s marketing department to refer to their server database solutions?
As a side question, what flavor SQL, if any, does MS Access use?
MS SQL is simply a short version of the (complete) product name Microsoft SQL Server. (Similar to "MS Office", "MS Windows" or "MS Access").
T-SQL is the SQL dialect that the product Microsoft SQL Server is using - and is short for "Transact-SQL" (thanks Aaron for reminding me!)
I wouldn't call the dialect that Microsoft Access is using SQL. It's a query language that somehow resembles SQL
The MS SQL Stands for ( Microsoft SQL). This is the product of Microsoft which they released MS SQL 2005, 2008 and recently released 2012.
T- SQL stands for Transact SQL. This is the syntax of writing the expression in the sql database. You can write T- SQL statments in MS SQL Server Database
Link to Refer

Using SQL user defined function in MS Access 2007

I am very new to Access and need a bit help over here.
I was working on MS Access 2007 (in VB) with SQL 2008 Server as my database.
I wanted to show a SQL table in the frontend of Access but faced the problem while using SQL user defined function with my SQL query in Access 2007. I wrote this function and the query in SQL Query design of Access and tried to Run it.. but its showing error (Userdefined "timepart" function not recognized) !!
CREATE function dbo.timepart (#date as SMALLDATETIME)
RETURNS SMALLDATETIME
AS
BEGIN
RETURN #date - DATEADD(d, DATEDIFF(d,0,#date), 0)
END
SELECT * FROM TABLENAME WHERE dbo.timepart(FIELDNAME) Between '9:30' AND '17:30';
I guess MS Access doesn't allow to write UDF SQL functions! I tried this same query in my local SQL Server 2008 database (SQL management studio) and is working perfectly fine.
You should create a pass-through query. With a pass-through query, the code is run on SQL Server and the results are returned to MS Access. You can therefore use SQL Server T-SQL.
Also access-SQL pass-through query (creating SP) error

How can I write a message to SQL profiler from Sql a query?

I am troubleshooting for some SQL issue and I use SQL Profiler in order to diagnose some problem.
Is it possible to write some messages into SQL Profiler by adding some lines in a TSQL query?
thanks!
you can do by adding comment to your t-sql
like
-- My message
select * from table1
and send all to sql
The Application Name should also be different. For our installation, activity on the website gives an application name of ".Net SqlClient Data Provider", while queries from SQL Server Management Studio are designated as... well... "SQL Server Management Studio"

SQL Server 2005 or Visual Studio 2005 - writing my first procedure, any tips or good starting points?

I'm about to write my first procedure to check if yesterdays data exists in one database, and if it select some of the data, use a count and insert that data into another database. If the data doesn't exist, then send me an email.
I'm using SQL Server 2005 and I'd like to ask the community for tips or good starting knowledge on smart procedure coding.
Thanks!
Here is an article on MSDN about stored procedures on SQL Serve 2005 that should help.