Visual Studio Code extension to develop Microsoft SQL Server, Azure SQL Database and SQL Data Warehouse everywhere
I have a one table Called MeetingInfo. In that table there is a info regarding Meeting Start Date and End Date And Metting Room.
I want to make a query by which i want to see all the Meeting start Date and EndDate but From today to 365Days Ago. Below Way i am trying
DECLARE @TodayDATE = GETUTCDATE()
Select * from MeetingInfo
WHERE StartDate between DATEADD(DAY,-365,GETDATE()) and@Today
AND tbia.EndDate between DATEADD(DAY,-365,GETDATE()) and @Today
What do u think this is the correct way to see the results
@alealpha2000 You could use CONCAT(column1, column2) -
Example1:
select COUNT(CONCAT(column1, column2)) from table1 group by CONCAT(column1, column2)
Depending on what you're counting, as you seem to need distinct values, you may need to use window functions to deduplicate first. Google deduplication and "over(partition by" for help with that. If you go that route, you may need to wrap this in a CTE;
Example2:
;with A as (select concat(column1, column2) as 'NewName' from table1) select count(NewName) from A
gympuma
> <@gitter_nj-db:matrix.org> Hi, can anyone please point in the direction of some information to do with using a SQL FileTable in a document versioning system? Thanks
Could you explain a little more? You want to log versioning in SQL? Generate documents from t-sql into a file system?
gympuma
> <@gitter_marcelosf:matrix.org> Message Iteration=2|SQLState=IM006|Native Error=|Message=[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed[Message Iteration=3|SQLState=08001|Native Error=|Message=[Microsoft][SQL Server Native Client 10.0]Client unable to establish connection]'.
What connection string are you using? (blank out sensitive info before sendind)
1 wrapCloseInAction)
at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at Microsoft.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover, SqlAuthenticationMethod authType, SqlAuthenticationProviderManager sqlAuthProviderManager)
at Microsoft.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
at Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
at Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
at Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken, DbConnectionPool pool, SqlAuthenticationProviderManager sqlAuthProviderManager)
at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
at Microsoft.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
at Microsoft.Data.ProviderBase.DbConnectionFactory.<>c__DisplayClass40_0.<TryGetConnection>b__1(Task
1 _)