Viewing 15 posts - 3,976 through 3,990 (of 59,067 total)
As a bit of a sidebar, my personal preference for assigning alias names to columns is not to use "expression AS aliascolumnname". I use aliascolumname = expression.
Some people don't like...
January 29, 2022 at 12:20 am
Hey Ratbak,
Thanks again, I tried SELECT CAST('A1-'+CustomerID as text) as CustomerID FROM Customers
Get the message. Conversion failed when converting the varchar value 'C25-' to data type int. Any help...
January 29, 2022 at 12:09 am
Use the test data you were kind enough to post (nicely done there), here's an answer that uses a CROSSTAB. If you actually DO want NULL to appear, just change...
January 28, 2022 at 2:40 am
Perhaps the following but of study will convince you... 😀
https://docs.microsoft.com/en-US/sql/t-sql/queries/select-transact-sql?view=sql-server-ver15
https://www.w3schools.com/sql/sql_select.asp
https://www.techonthenet.com/sql_server/select.php
https://sql-server-tutorial-blog.blogspot.com/2022/01/sql-server-select-statement.html
January 28, 2022 at 2:02 am
Don't use functions in a WHERE clause, that's a very bad habit. Yes, SQL Server now generally covers for you with dates/datetimes, but not always, there are...
January 28, 2022 at 1:54 am
every night we perform Index maintenance on that database
As a bit of a sidebar, I can almost guarantee that you're doing you index maintenance wrong. Spend more time doing...
January 27, 2022 at 8:50 pm
I'd clean up the prod problem first. You can use a backup and research to research the other stuff, if you think it's necessary.
Only if you have a place...
January 27, 2022 at 8:41 pm
Ummmmm... I don't see anywhere where the OP did an EXEC [art].[pCreateArtList_View]... 😉
You DO have to actually execute the stored procedure for IT to create the view.
January 27, 2022 at 8:33 pm
Don't use functions in a WHERE clause, that's a very bad habit. Yes, SQL Server now generally covers for you with dates/datetimes, but not always, there are some restrictions. ...
January 27, 2022 at 8:25 pm
Don't rely on the DB_ID() to reference a db. Assume it could change at any time.
If you'll notice, in its system tables, MS stores the db name rather than...
January 27, 2022 at 8:21 pm
Not sure what you are alluding too but I tried all three options without creating a new database and in each case the id was reused. Only the following...
January 27, 2022 at 8:18 pm
We are using the sql agent job to take the local drive backup of all the databases on the source and having sufficient permissions on the destination server .xp_CmdShell...
January 27, 2022 at 2:55 pm
@ktflash - Just as a suggestion to help clarify exactly what you want for future posts.. It would be helpful if you'd post a clipping of a spreadsheet or columnized...
January 27, 2022 at 2:52 pm
And here is the the result I need:
businessdayColumnNameColumnViewBUSINESS_RISKMARKET CREDMONETARY FUND
2022-01-01ABCDIM_VIEW2.351.35 / $2.404.80
2022-01-01ABCAPP_VIEW0.95nullnull
2022-01-01DEFDIM_VIEW1.15 / $0.90null71.70 / $122.47
2022-01-01DEFAPP_VIEW5.60nullnull
2022-01-01GHKAPP_VIEW3.85 / $10.08nullnull
The pivot columns can vary from week to week....
January 27, 2022 at 2:46 pm
Out of curiosity, did some tests
Offline/Online - No Change Detach/Attach - No Change Delete/Restore - No Change
However if you attach or restore a database with an id that is...
January 27, 2022 at 2:21 pm
Viewing 15 posts - 3,976 through 3,990 (of 59,067 total)